‎2011 Jun 17 6:22 AM
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.
‎2011 Jun 17 6:30 AM
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
‎2011 Jun 17 7:48 AM
but if i dont call BAPI_TRANSACTION_COMMIT there is there any possiblity that data will be saved.
rgds,
Khushy
‎2011 Jun 17 9:02 AM
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
‎2011 Jun 17 9:39 AM
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
‎2011 Jun 17 9:48 AM
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