Application Development 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: 

question on lock

Former Member
0 Kudos

Hiii

I have an enhancement that have been implement at the end of a creation of an inbound deliveries.

My requirement is as follow

After the creation of the inbound deliveries after the commit of the delviery, I call a FM BAPI_BATCH_CREATE to create batch etc..

The issue i am having is that suppose i am creating 2 delivery

for the first delivery the FM fail BAPI_BATCH_CREATE and this is cause by an collision in enqueue EMMARCS. I saw that in ST05

For the second delivery this work fine

I wanted to correct the error by

by checking before the calling of the FM BAPI_BATCH_CREATE if enqueue EMMARCS fail i dequeue it. But i think there may be regressing since the program may be updating something in MARCS and i am throwing it out because of My dequeue?

Please advise

1 ACCEPTED SOLUTION

former_member226234
Contributor
0 Kudos

Hi,

When there are situations where parallel updates are happening, i usually do a wait to allow significant time for the first process to complete.

Do 5 times.

CALL <ENQUEUE>

IF locked

if cnt eq 5

call <Dequeue>

exit.

else.

cnt = cnt + 1.

Continue.

endif

ELSE.

EXIT.

ENDIF.

ENDDO.

Hope this helps.

Regards,

San

3 REPLIES 3

Former Member
0 Kudos

Use BAPI_TRANSACTION_COMMIT after BAPI_BATCH_CREATE.

former_member226234
Contributor
0 Kudos

Hi,

When there are situations where parallel updates are happening, i usually do a wait to allow significant time for the first process to complete.

Do 5 times.

CALL <ENQUEUE>

IF locked

if cnt eq 5

call <Dequeue>

exit.

else.

cnt = cnt + 1.

Continue.

endif

ELSE.

EXIT.

ENDIF.

ENDDO.

Hope this helps.

Regards,

San

0 Kudos

Hii

Could anyone plesae advise what it the purpose of WAIT in the ENQUEUE

I am told that it wait until it's possible to enqueue the example a material it is true?