What would be the effect of using the 'BAPI_TRANSACTION_COMMIT' with 'WAIT' parameter when equals to 'X' inside a BADi? Should I expect that SAP will commit the data when LUW commits?
I'm aware that inside 'BAPI_TRANSACTION_COMMIT' it happens 'COMMIT WORK' or 'COMMIT WORK AND WAIT' if you specify parameter 'WAIT' = 'X'.
I'm also aware that it's not correct to make a 'COMMIT WORK' inside a BADi, but if I use 'COMMIT WORK AND WAIT' via the BAPI?
The SAP documentation regarding to COMMIT says:
This executes all high-priority (VB1) update function modules in the order of their registration and in a common database LUW. If you do not specify the addition AND WAIT, the program does not wait until the update work process has executed it (asynchronous updating), but instead is resumed immediately after COMMIT WORK. However, if the addition AND WAIT is specified, program processing after COMMIT WORK will not continue until the update work process has executed the high-priority update function modules (synchronous updating).
When all high-priority update function modules are completed successfully, the statement executes the low-priority (VB2) update function modules in the order of registration together in a common database LUW.
My confusion arises because we have a BADi implementation where there's a call to the mentioned function with parameter 'WAIT' = 'X' and we have found a SAP Notes where it prohibits the use of 'COMMIT WORK' inside that BADi, however it says 'COMMIT WORK' and not 'COMMIT WORK AND WAIT'.
So I could think that the implementation is right because that data would be commited when LUW finishes ... or not. Any comments?
COMMIT
in a BAdI implementation depends entirely on the program that calls the implementation. – Receiver