Application Development and Automation 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: 
Read only

if BAPI_TRANSACTION_COMMIT is not called

Former Member
0 Likes
693

hello Gurus,

If i call a BAPI create and then i dont call a BAPI_TRANSACTION_Commit explicitly ....... but some database commits is called after that ...... then will the data be created in the system.. or we need to explicitly call BAPI_TRANSACTION_COMMIT or commit work .....

Regards,

khushy.

5 REPLIES 5
Read only

Former Member
0 Likes
646

Hi,

BAPI_TRANSACTION_COMMIT internally calls COMMIT WORK. or COMMIT WORK AND WAIT.

So basically a COMMIT WORK will trigger all database changes up to that point

Regards

Rajvansh

Read only

0 Likes
646

but if i dont call BAPI_TRANSACTION_COMMIT there is there any possiblity that data will be saved.

rgds,

Khushy

Read only

0 Likes
646

The LUW principle is simple, once all updates related to a transaction have been made successfully, a commit work is necessary.

BAPI_TRANSACTION_COMMIT is a wrapper that can be called from outside the SAP system. If you're working within the same box you might as well use a COMMIT WORK statement instead. Don't just rely on implicit commits, e.g. when a program ends. A pure database commit (via native SQL) is not sufficient, the ABAP statement does more (see ABAP help).

Thomas

Read only

0 Likes
646

Thanks Thomas for your reply just one thing more....does it mean that if we won't call BAPI_TRANSACTION_COMMIT then it might or might not create data .........nothg specifc

rgds,

Khushboo

Read only

SuhaSaha
Product and Topic Expert
Product and Topic Expert
0 Likes
646

does it mean that if we won't call BAPI_TRANSACTION_COMMIT then it might or might not create data

Hello Khushy,

As Thomas has mentioned, BAPI_TRANSACTION_COMMIT is just a wrapper for the COMMIT WORK[AND WAIT] statement.

It's always a recommended to call BAPI_TRANSACTION_COMMIT after every BAPI call to commit the changes to the database(more specifically terminate the LUW).

If during the BAPI call there are some errors returned, then you have to revert the changes to the database via BAPI_TRANSACTION_ROLLBACK!

You'll definitely benefit a lot by reading the details on [SAP LUW concept|http://help.sap.com/saphelp_nw04/helpdata/en/41/7af4bfa79e11d1950f0000e82de14a/content.htm]!

BR,

Suhas