BAPI Commit Delay Solution

It happens to us all. Sometimes, SAP runs asynchronous processes. If we have to make multiple BAPI calls (or run multiple batch inputs) in a loop, we might get lock errors at the 2nd, 3rd, etc BAPI call (even if we say “COMMIT WORK AND WAIT”).

Here is a simple but effective solution to this problem:

loop at itab.
  ” do stuff
  ” call function ‘BAPI…’
  ” commit work and wait

   wait up to 1 seconds.
   ” check if BAPI recording is finished
   ” look at tables, locks, etc.
   ” if process has finished.


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s