Writing a material on SAP system via .NET Connector


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:
FU BAPI_TRANSACTION_COMMIT
____________________________________________________
Short Text
Execute external Commit when using BAPIs

Functionality:
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.

Notes:
Messages are returned in the parameter 'Return'. The documentation for this parameter contains the return values and their meanings.
Further information
Use the method BapiService.TransactionRollback to prevent changes to the database being committed.
Parameters
WAIT
RETURN

Updated on: 11-Dec-2019

184 Views

Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements