Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

BAPI_GOODSMVT_CREATE Async call

Former Member
0 Likes
715

Hi.

I am calling BAPI_GOODSMVT_CREATE to post 2 goods movements one after the other (501 and 541). I am using BAPI_TRANSACTION_COMMIT, with the wait option after both the movements. (This is not being called in an update task, which might be evident from the call to BAPI_TRANSACTION_COMMIT).

The problem is that immediately after the 501 movement, if I try and post the 541 movement, the call to the BAPI fails. The error is that the data is locked with my user ID. Now if I put a WAIT UP TO n SECONDS, statement, the program works fine. My reasoning is that the control is returned to the program while there is some processing happening at the backend.

The program is working fine now, but using a WAIT UP TO.. doesn't seem an elegant approach. Could anyone suggest anything?

1 ACCEPTED SOLUTION
Read only

Peter_Inotai
Active Contributor
0 Likes
563

You can try 'SET UPDATE TASK LOCAL. ' before your BAPI call. It should work as it will stay in the user context as far as I remember.

Peter

3 REPLIES 3
Read only

Peter_Inotai
Active Contributor
0 Likes
564

You can try 'SET UPDATE TASK LOCAL. ' before your BAPI call. It should work as it will stay in the user context as far as I remember.

Peter

Read only

0 Likes
563

Thanks mate!!!

Right on the money you were!

Cheers.

Read only

0 Likes
563

Great, that it works!

Peter