Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

why dont we use Commit statement in Usrer exits?

Former Member
0 Kudos

Hi,

I dont understand one thing that why dont we use commit statement in user exits, Please educate me on this.

Regards,

Kiran

1 ACCEPTED SOLUTION

SuhaSaha
Advisor
Advisor
0 Kudos

Inside the User Exit you are in an SAP LUW & the COMMIT WORK will abruptly end the LUW which is not desirable.

6 REPLIES 6

SuhaSaha
Advisor
Advisor
0 Kudos

Inside the User Exit you are in an SAP LUW & the COMMIT WORK will abruptly end the LUW which is not desirable.

former_member205763
Active Contributor
0 Kudos

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.

Former Member
0 Kudos

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.

Former Member
0 Kudos

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

Former Member
0 Kudos

It violates LUW rule.

Thanks

Shantanu

kesavadas_thekkillath
Active Contributor
0 Kudos

Go through this link:[;