Once you create material, you need to call BAPI- BAPI_TRANSACTION_COMMIT. “BAPI_TRANSACTION_COMMIT” is called to COMMIT a database operation. As COMITT statement can’t be called inside BAPI, we call this BAPI to complete COMMIT.
Let us say you are editing some table fields in BAPI- as per failure or success, you can perform a COMMIT or ROLLBACK.
To perform a COMMIT call BAPI_TRANSACTION_COMMIT. Below is sample COMITT:
CALL FUNCTION 'BAPI_TRANSACTION_COMMIT' * EXPORTING * wait = "bapita-wait IMPORTING return = "bapiret2 . " BAPI_TRANSACTION_COMMIT
You can see full documentation about BAPI_TRANSACTION_COMMIT:
Execute external Commit when using BAPIs
This method executes a COMMIT WORK command. It is required for transactions developed outside the SAP system that change data in the SAP system by using BAPI calls.
When you call BAPIs in your program that change data in the SAP system, you must then call this method to write the changes to the database.
Messages are returned in the parameter 'Return'. The documentation for this parameter contains the return values and their meanings.
Use the method BapiService.TransactionRollback to prevent changes to the database being committed.