08-11-2010 6:10 AM
Hi,
I dont understand one thing that why dont we use commit statement in user exits, Please educate me on this.
Regards,
Kiran
08-11-2010 6:23 AM
Inside the User Exit you are in an SAP LUW & the COMMIT WORK will abruptly end the LUW which is not desirable.
08-11-2010 6:23 AM
Inside the User Exit you are in an SAP LUW & the COMMIT WORK will abruptly end the LUW which is not desirable.
08-11-2010 6:38 AM
Since Exits are triggered in between standard SAP transactions which have their own commit that trigger at a specified point so You should be disturbing that hence explicit commit work shouldn't be used.
08-11-2010 7:32 AM
Hi Kiran,
Normally , you shoud not specify COMMIT statement in any user exit , badi etc..
SAP has its own COMMIT statement while execuiting the standard transactions .
Addition of a COMMIT might lead to problems elsewhere .
Syntactitically, this is allowed. But its not advisable, because you never know, which reports are affected by this unexprected commit, because it commits all outstanding modifications and you do not know if a programmer needs to store something in addidtion to end a logical unit of work.
May it helps you.
Regards,
DS.
08-11-2010 7:52 AM
Hi Kiran,
The flow is like this -
SAP Std transaction --> Event(SAVE) --> EXIT code --> Transaction complete(DB commit)
Here when we are in a user exit, SAP is yet to process the business transaction completly. SAP has it's own commit after the complete process.
Also SAP has provided us the exits to manage the transaction data. We should not play with the LUW. If we write commit in Exit, there could be some major table updates which may get commited and in case that there are errors after Exit, and the transaction is not completed , database inconsistency could arise.
Hope this helps.
Regards
Megha
08-11-2010 7:52 AM
08-11-2010 11:19 AM