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: 

BAPI_TRANSACTION_COMMIT

Former Member
0 Kudos

Can anybody tell me the working of bapi_transaction_commit

Using BAPIs we may make changes to different db tables.

How exactly the above FM works ? Which transaction is exactly committed ?

Waiting for expert commnents

Regards

Nitin

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi

Individual BAPI's should not commit work to the database. This is part of the definition for BAPIs.

This allows the calling program to control the Logical Unit of Work (LUW) by calling BAPI_TRANSACTION_COMMIT. You can commit after each BAPI call, or after a sequence of them.

For example, your application may involve several BAPIs being called over several dialog steps. If the user aborts before the last step, you should be able to roll back without having to reverse any individual transactions.

Only if they confirm the last step would you call BAPI_TRANSACTION_COMMIT.

The following is a good summary: http://help.sap.com/saphelp_46c/helpdata/en/a5/3ec8654ac011d1894e0000e829fbbd/frameset.htm

Cheers

Dom

3 REPLIES 3

Former Member
0 Kudos

Hi,

this FM only executes the 'commit'-statement, the name is misleading. The commit is for the current LUW.

Cheers,

Stefan

Former Member
0 Kudos

Hi

Individual BAPI's should not commit work to the database. This is part of the definition for BAPIs.

This allows the calling program to control the Logical Unit of Work (LUW) by calling BAPI_TRANSACTION_COMMIT. You can commit after each BAPI call, or after a sequence of them.

For example, your application may involve several BAPIs being called over several dialog steps. If the user aborts before the last step, you should be able to roll back without having to reverse any individual transactions.

Only if they confirm the last step would you call BAPI_TRANSACTION_COMMIT.

The following is a good summary: http://help.sap.com/saphelp_46c/helpdata/en/a5/3ec8654ac011d1894e0000e829fbbd/frameset.htm

Cheers

Dom

jayanthi_jayaraman
Active Contributor
0 Kudos

Hi,

This is the information I got from a link.

With BAPI_TRANSACTION_COMMIT ..the external systems have a way of deciding on whether to

Commit or to Roll back Changes.

But with Commit Work u have to code it inside ure BAPI and the outside systems then have no chance or have

any hold over the commit...

so i guess the diff lies more in the way how u want to call commit ,either from outside or from within ure BAPI.

u can use both...

SAP though recommends using BAPI_Transaction_Commit and not using Commit_work in the BAPI...

but its upto u and ure middleware guy to decide how u want to do it..

Check this alos.

http://searchsap.discussions.techtarget.com/WebX?msgInContext@966.OLlUbqwbDfe.1@.ee83dd4/2408!viewty...