Home > SAP software/management Tips > SAP ABAP/Java developer tips > How to do additional dialog processing after SAP COMMIT WORK statement
SAP Tips:
EMAIL THIS
 TIPS & NEWSLETTERS TOPICS 

SAP ABAP/JAVA DEVELOPER TIPS

How to do additional dialog processing after SAP COMMIT WORK statement


Matthew Billingham
10.21.2009
Rating: -4.00- (out of 5)


SAP news, tips and expert advice
Digg This!    StumbleUpon Toolbar StumbleUpon    Bookmark with Delicious Del.icio.us    Add to Google


Recently I needed a program that would display a screen for maintaining Characteristics and Classifications following an SAP COMMIT WORK statement when maintaining a few master data objects, i.e., after the "save" processing when the object is changed or created.

Anyway, I came across a not very well-known technique which helped me solve this real-life programming problem rather neatly. I won't go into the details of the application. What I want to focus on is how to have an action triggered following a successful COMMIT WORK in an SAP transaction.

For my master data object, there is an SAP BADI which runs immediately following a save, but before the COMMIT WORK. There I called a Static Factory Method, in an SAP ABAP class I had developed (ZCL_MYCLASS), which follows the Singleton pattern.

The master data fields I needed for my application, were passed in the parameters of this method, and set in the attributes of the Singleton instance. (You could use global variables in a Function Group with a few Function Modules to achieve the same results.) The last line of ABAP within the BADI is:

In my ABAP class, I define the Static Handler method tx_finished. This method, when triggered, calls additional processing for the maintenance of Characteristics...


Digg This!    StumbleUpon Toolbar StumbleUpon    Bookmark with Delicious Del.icio.us    Add to Google



RELATED CONTENT
SAP ABAP/Java developer tips
How to find a piece of SAP ABAP code without debugging
How to read an SAP transaction in an ABAP code
How to provide an SAP R/3 4.5B application server with a Web service interface
How to find owners and transports of deleted ABAP programs
Fixing a common OPEN_FORM and START_FORM error in SAPscript
Select Text fields: Case-insensitive
Is this the quickest way to find a BADI?
Easily debug error messages in SAP processes
Accessing private attributes in ABAP Objects
Improving performance with ABAP Objects in SAP Workflow

SAP ABAP
SAP talent management FAQ: Fresh answers to frequently asked questions
SAP TechEd Demo Jam 2009: Winners use beer keg in demo
How to implement SAP BADIs
Tips on SAP ABAP
Using subclasses to develop applications that run on different releases of SAP
How to find a piece of SAP ABAP code without debugging
Configuring SAP EDI for sales orders
How to correct an SAP ABAP dump with an oversize condition
How can I get an ABAP program displaying Excel data to wrap text?
How to read an SAP transaction in an ABAP code
SAP ABAP Research

SAP Web applications
SAP talent management FAQ: Fresh answers to frequently asked questions
SAP TechEd Demo Jam 2009: Winners use beer keg in demo
SAP CTO expects today's SAP applications to be running in 2020
SAP TechEd 09 keynoters: Managing change today like trying to board a speeding train
How can I get an ABAP program displaying Excel data to wrap text?
An ABAP user wants to learn XI
SAP exec discusses Imagineering, the future of development
The stars of TechEd: SAP application demos
Validating table fields
The difference between field groups and internal tables

RELATED GLOSSARY TERMS
Terms from Whatis.com − the technology online dictionary
ABAP  (SearchSAP.com)
ABAP Objects  (SearchSAP.com)
ABAP Workbench  (SearchSAP.com)
BAPI  (SearchSAP.com)
CATT  (SearchSAP.com)
R/3 Repository  (SearchSAP.com)

RELATED RESOURCES
2020software.com, trial software downloads for accounting software, ERP software, CRM software and business software systems
Search Bitpipe.com for the latest white papers and business webcasts
Whatis.com, the online computer dictionary


.

Following all the processing involved within COMMIT -- or ROLLBACK -- the system event CL_SYSTEM_TRANSACTION_STATE=>TRANSACTION_FINISHED is raised, which triggers any handler methods for that event. All of this happens within one session, so there is no danger of interference from other processes on the system.

To summarize: In the BADI, I pass relevant data to my class, and set a handler. Following the COMMIT WORK, the handler method runs in the same dialog task and the same memory space, launching my "post save" functionality, which can involve further screens and interaction with the user.

About the creator of this tip: Matthew Billingham is SearchSAP.com's application development expert. He has worked for companies such as Eurotunnel and Vodafone, served as development manager for Coats PLc, and as head of application development with Novartis Pharma in Switzerland, managing the development side of a global SAP rollout. He now runs his own SAP consultancy, providing guidance and designing solutions (particularly for intractable problems) for third parties. His expertise is in program design, troubleshooting and knowing just how SAP works; his clients describe him as "Consultant for everything." He is co-founder of SecureBI, delivering SAP security solutions.

Rate this Tip
To rate tips, you must be a member of SearchSAP.com.
Register now to start rating these tips. Log in if you are already a member.


Submit a Tip




DISCLAIMER: Our Tips Exchange is a forum for you to share technical advice and expertise with your peers and to learn from other enterprise IT professionals. TechTarget provides the infrastructure to facilitate this sharing of information. However, we cannot guarantee the accuracy or validity of the material submitted. You agree that your use of the Ask The Expert services and your reliance on any questions, answers, information or other materials received through this Web site is at your own risk.



NetWeaver SAP White Papers
About Us  |  Contact Us  |  For Advertisers  |  For Business Partners  |  Site Index  |  RSS
SEARCH 
TechTarget provides technology professionals with the information they need to perform their jobs - from developing strategy, to making cost-effective purchase decisions and managing their organizations' technology projects - with its network of technology-specific websites, events and online magazines.

TechTarget Corporate Web Site  |  Media Kits  |  Site Map




All Rights Reserved, Copyright 2000 - 2009, TechTarget | Read our Privacy Policy
SearchSAP.com is a search service provided by TechTarget and is completely
independent of and not affiliated with SAP AG.
  TechTarget - The IT Media ROI Experts