07-11-2005 12:41 PM
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
07-11-2005 12:54 PM
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
07-11-2005 12:52 PM
Hi,
this FM only executes the 'commit'-statement, the name is misleading. The commit is for the current LUW.
Cheers,
Stefan
07-11-2005 12:54 PM
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
07-11-2005 1:17 PM
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.