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: 

Enqueue/Dequeue - Locking/Unlocking object

Former Member
0 Kudos

Hi all,

Please help me working with this enqueue/dequeue command. What I'm trying to do is to lock a Service Order. My requirement is to do a BDC for the Service Order Settlement Rule. So after hitting SAVE, a secondary process will be kicked off to perform my BDC for the same order. Now what Im doubting is that what if user re-enter the same Service Order again so quick. So my BDC program will not be performed immediately since it will be locked by the usser.

So my idea is to lock it first while my BDC program is still running. Any help please? Thanks.

1 ACCEPTED SOLUTION

Former Member
0 Kudos

If I am not wrong, you are doing two BDCs for same order. If yes, you can use the synchonus update in the first BDC, then the order will be available for the second BDC. No need to look the order.

8 REPLIES 8

Sm1tje
Active Contributor
0 Kudos

After hitting SAVE-button, and within the second program, do a check if the service order is locked or not. If still locked, built in a WAIT and try again until object is no longer locked.

Former Member
0 Kudos

If I am not wrong, you are doing two BDCs for same order. If yes, you can use the synchonus update in the first BDC, then the order will be available for the second BDC. No need to look the order.

0 Kudos

Nope. Just 1 BDC -on my 2nd program only. Or to make it simple, I have modified ZXWOCU07 (IWO10009) to perform/kick off a call function( this is being triggered after hitting on SAVE). And this FM contains my checking if SO is now open for change then do the do the BDC.

What I'm thinking is to lock first the SO to block any user from accessing that SO, so it will do the BDC first. But I'm not yet familiar with the locking/unlocking of objects. Please help me on how to use enqueue or locking object.

0 Kudos

If you are trying the apply BDC on same SO for which the SAVE event is triggered.. then you can't do this.. as the SO would be locked while in the SAVE event..technically this is wrong.. how can you update an order in the SAVE event of the order... if the SO is different then you can do the BDC.

There is no need to lock the SO before BDC, the BDC will throw an error it is already locked by some other user...

0 Kudos

But what if we send this BDC in the background or in new task? Then perform some checking if SO saving already completed before proceeding to BDC. I think this one is possible. What I'm worrying about is what if the user re-enters the SO again so quickly. That's why I'm thinking for possible catch for this concern. Any other bright ides other than the one I'm thinking?

Former Member
0 Kudos

hi Ayem,

I am facing the same problem. My BDC for auto settling (KO88) cannot be executed and the error shown is that the object is locked. If you solved the problem can you please share the solution.

Thanks and regards,

Snehal Chaudhary.

0 Kudos

Hi,

Use  WAIT UP TO n SECONDS. after one complete Save Cycle  of  BDC.

Thanks,

Ams K.

0 Kudos

hi all,

WAIT UPTO did not solve the problem. However I used dequeue_esorder FM.

it unlocked the object.

Thanks Ams K

Regards,

Snehal Chaudhary.