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

Lock-unlock order

Former Member
0 Likes
1,462

Hi all,

I thought we lock the record first, then process the function module, then unlock the record. Can someone explain why a program was written this way for posting movement for a production order ?

sy-subrc = 4

while sy-subrc ne 0.

Call FM 'ENQUEUE_ESORDER

endwhile.

Call FM 'DEQUEUE_ESORDER'

Data validation take place

Call FM 'BAPI_GOODSMVT_CREATE

COMMIT WORK

If the record is locked and then unlock immediately, how can it prevent the second user from accessing the same order ?

Any suggestions ?

thanks

Joyce

Joyce

Hi all,

I thought we lock the record first, then process the function module, then unlock the record. Can someone explain why a program was written this way for posting movement for a production order ?

sy-subrc = 4

while sy-subrc ne 0.

Call FM 'ENQUEUE_ESORDER

endwhile.

Call FM 'DEQUEUE_ESORDER'

Data validation take place

Call FM 'BAPI_GOODSMVT_CREATE

COMMIT WORK

If the record is locked and then unlock immediately, how can it prevent the second user from accessing the same order ?

Any suggestions ?

thanks

Joyce

Joyce

3 REPLIES 3
Read only

Former Member
0 Likes
779

The program is checking that the order has finished all previous updates and is unlocked.

Rob

Read only

0 Likes
779

Hi Rob,

That seems to make sense.

Thanks

Joyce

Read only

Former Member
0 Likes
779

thanks,