Hierarchy
⤷ IS-HMED (Application Component) Clinical System
⤷ NMED_ME (Package) IS-H*MED: Medication
IMG Activity
ID | SIMG_ISHMED_S_COMMIT | BAdI - Control Actions at COMMIT |
Transaction Code | S_ANI_98000241 | (empty) |
Created on | 20050314 | |
Customizing Attributes | SIMG_ISHMED_S_COMMIT | BAdI - Control Actions at COMMIT |
Customizing Activity | SIMG_ISHMED_S_COMMIT | BAdI - Control Actions at COMMIT |
Document
Document Class | SIMG | Hypertext: Object Class - Class to which a document belongs. |
Document Name | N1ME_COMMIT_WORK |
Use
This BAdI is called at all points in programs in Medication where a COMMIT WORK AND WAIT takes place. It should allow you to execute your own actions which are based on changing certain data, e.g. customer-specific prints. The call of this command is encapsulated in the ISHMED_ME_COMMIT_WORK function module which you are also permitted to replace for customer-specific functions.
Requirements
Use this BAdI with care! The BEFORE_COMMIT method is used, for example, between the call of the SAVE methods of the data classes (i.e. before calling the update task) and the COMMIT WORK. The data classes update the contents, but these are not yet in the database. Program errors in this method can damage data integrity.
As mentioned, you can use the ISHMED_ME_COMMIT_WORK function module in your own functions. However you cannot use it in the implementation of this BAdI as it would lead to an endless loop.
When implementing this BAdI you must not do a COMMIT WORK AND WAIT and never a COMMIT WORK (without AND WAIT). This COMMIT would start the update task terminated by the standard program and simultaneously continue the execution of the program which can lead to problems updating subsequent functions on slow systems.
A ROLLBACK WORK is also not permitted as it deletes all waiting update request. Data errors, dumps and even update terminations can therefore occur.
You are not allowed to call dialogs.
Consult the documentation for the individual BAdI methods for more information.
Standard settings
No active standard delivery exists for this BAdI.
Activities
Details for Implementing a BAdI
Example
If you need to filter out some objects which were changed from all the objects that were transferred, you would normally use the IS_NEW, IS_CHANGED, CHECK_CHANGES, standard methods. These however do not work in the methods of this BAdI. The reason is as follows:
The methods of this BAdI are called before and after the COMMIT WORK AND WAIT and after the SAVE methods of the data class have been run. This means that the data classes determine that their content has been saved even if the data has not yet been updated, as no COMMIT was executed. Thus, for example, IS_NEW does not return the value 'X'
To determine changes, you have to execute a SELECT SINGLE on the relevant table in the BEFORE_COMMIT method with the key of the data classes (which you receive with the GET_DATA method). If this selection fails, it means the object has just been created. If the selection returns a result that differentiates from the current data object, it means the object has been changed.
To determine changed or newly modified objects in the AFTER_COMMIT method, you have to define a few global variables. You have to use these variables to retain the result of the search for changes in the BEFORE_COMMIT. You can then evaluate these global variables in the AFTER_COMMIT method.
See also
The following methods are available to you for this BAdI:
Business Attributes
ASAP Roadmap ID | 257 | Create User Exits |
Mandatory / Optional | 2 | Optional activity |
Critical / Non-Critical | 2 | Non-critical |
Country-Dependency | A | Valid for all countries |
Maintenance Objects
Maintenance object type | E | Business Add-In - Definition |
History
Last changed by/on | SAP | 20050314 |
SAP Release Created in | 600 |