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 BAPI_GOODSMVT_CREATE lock issues

Former Member
0 Likes
1,868

Hi all,

I have a problem with BAPI_GOODSMVT_CREATE, FM

I have using this to post goods movement type 309 & 321 and I am calling this in LOOP as there are more number of goods movement.

In each iteration i have to post the goods movement and after that i have to create the delivery using bdc MBRL Tcode.

The problem is the BAPI is locking the Material document number even after posting the goods movement for a while. Because of this the delivery creation is failing.

After BAPI i'm using BAPI commit work FM

I have used FM deque_all, but its not working. wait up to 2 secs.

Even the combination of deque_all & wait up to 2 secs is not working.

Is there anyother way to release locks?

Thanks

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
775

Hi,

Try this way ......

SET UPDATE TASK LOCAL.

if sy-subrc eq 0.

call function BAPI_GOODS_MVMT_CREATE

......

endif.

if return is initial with no errors then

SET UPDATE TASK LOCAL.

if sy-subrc eq 0.

call function 'BAPI_TRANSACTION_COMMIT'

EXPORTING

WAIT = 'X'

IMPORTING

RETURN = return.

endif.

1 REPLY 1
Read only

Former Member
0 Likes
776

Hi,

Try this way ......

SET UPDATE TASK LOCAL.

if sy-subrc eq 0.

call function BAPI_GOODS_MVMT_CREATE

......

endif.

if return is initial with no errors then

SET UPDATE TASK LOCAL.

if sy-subrc eq 0.

call function 'BAPI_TRANSACTION_COMMIT'

EXPORTING

WAIT = 'X'

IMPORTING

RETURN = return.

endif.