Skip to Content
avatar image
Former Member

BAPI_TRANSACTION_COMMIT with WAIT = 'X' Still work after error modify table

Hi Experts,

I have some problems about commit transaction.

in my function module which the processing type is remote-enabled mode (already used for web service)

i have calling function of 'BAPI_GOODSMVT_CREATE' and put

CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
EXPORTING
wait = 'X'

after the 'BAPI_GOODSMVT_CREATE' function.

There is a problem with 2 cases:

the first one is error when modify data of Transparent Table

and the second is some network fail.

my question is why there is an error like above but the commit still working?

i assume when i put wait = 'X' is mean if there is some error in function module, it should not commit the transaction.

here is some of my code:

Thank you in advance :)

*Sorry for my bad english

sap.png (29.0 kB)
Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • Best Answer
    Nov 29, 2017 at 07:51 AM

    Hey, The Bapi_transaction_commit is basically running this command with message handling and buffer cleaning. The "WAIT" variable of the function is a flag decision for using (or not) the "AND WAIT" addition. Read the link and note especially this part: "If the addition AND WAIT is not specified, the program does not wait (in non-local updates) until the update work process has executed it (asynchronous updates), 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)."

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member

      Thank you for your answer, after i read your answer i realize it i was wrong. i think i want to try to replace the commit work at the end of the code. Thank you for your answer. :)

  • Nov 29, 2017 at 08:34 AM
    • You must always read/loop at return parameter when you call a BAPI before committing the work. This Is not optional.
    • The wait option only waits for the high priority update task FM (VB1) to be executed
    • There can be delay due to database or buffering update
    • When using WAIT option BAPI_TRANSACTION_COMMIT can return an error in RETURN parameter, else if some update FM aborts/dumps the error can be seen in SM13 (and trigger a message)

    This information is available and easy to find in online help, look for SAP Transaction Concept or COMMIT WORK statement

    Add comment
    10|10000 characters needed characters exceeded