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: 

Usage of Bapi_Transaction_Commit?

Former Member
0 Kudos
219

Sorry for not noticing that it is an ABAP Programming forum.

Hi,

How can I use Bapi_Transaction_Commit in conjunction with a standard BAPI_A( for e.g) in webdynpros?

wdContext.currentBAPI_AElement.modelobject.execute();

The above source code would immediately execute the Bapi without knowing about the Bapi_Transaction_Commit.

Or am I missing something crucial?

Regards

MK

2 REPLIES 2

athavanraja
Active Contributor
0 Kudos
78

This is very much relevant for ABAP. I guess you want to know why you want to call BAPI_TRANSACTION_COMMIT after calling a standard BAPI.

Here is the function module documentation explaining that.

This method executes a COMMIT WORK command. It is required for

transactions developed externally to the R/3 System that change data in

the R/3 System via BAPI calls.

When you call BAPIs in your program that change data in the R/3 System,

afterwards you must call this method to write the changes to the

database.

Use the method BapiService.TransactionRollback to prevent changes to the

database being committed.

Regards

Raja

Former Member
0 Kudos
78

hi, MK

Some BAPI will change some data in SAP table, but the change won't be effective, untill you call BAPI_TRANSACTION_COMMIT. And if you call BAPI_TRANSACTION_ROLLBACK, the change will be ineffective.

As you call BAPI in the web dynpro, it belong to a remote call. After call the BAPI you want, and get no error info, then call BAPI_TRANSACTION_COMMIT to submit the data update you want to do on SAP sever.