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

check blocked objects

Former Member
0 Likes
2,782

Hi guys! I'm currently having a problem....

I have a program that creates a production order, after it goes and creates a notification to that order.

The problem I'm having is that sometimes, when the program creates the notification, it gives the error that the material/plant data is blocked, so how could I verify if that data is blocked so the program could wait until the data is unblocked so it can continue and create the notification?

Thanx

Jesus

5 REPLIES 5
Read only

RichHeilman
Developer Advocate
Developer Advocate
0 Likes
1,811

You can check for the lock using the lock object EMMATAE or the lock object EMMARCE. When calling the ENQUEUE function module, set the _WAIT parameter. This will force the system to wait untill a lock is achieved before continuing.

Regards,

Rich HEilman

Read only

0 Likes
1,811

Hey Rich! thanx for your answer!!

but I don't know if I'm getting it straight.... my problem is that the program needs to wait until the material is UNLOCKED so it can continue, and if I'm getting what you said, then what I'll be doing is LOCKING the material, and that's not what I want, it's actually the opposite of what I need

please, do explain a little better...

thanx again!

Jesus

Read only

Former Member
0 Likes
1,811

Hi guys! thanx to rich that gave a hand there... I solved my problem using the FM ENQUEUE_READ to check if the material is locked

Jesus

Read only

0 Likes
1,811

Good, that will work too, sort of. The reason that I was pointing you to the lock objects, is because they will allow you to wait for the lock to be released, then you know that your program can continue, with using the ENQUEUE_READ, there is no mechisum for WAITING(unless you create this your self using a WHILE loop).

You are right, if you use the lock object is will apply a lock, but you can immediately remove the lock after the system waits for the previous lock to unlock and applies your lock.( I hope that I didn't confused you here ).

My point is that when you used the ENQUEUE_READ function module, the system is checking for the locking, but it is not waiting for it to be released.

Regards,

Rich Heilman

Read only

0 Likes
1,811

hey rich! i got it now....

however, I used ENQUEUE_READ inside DO ENDDO, so it can wait for it to be locked.

thank you anyway man, you were very helpful!

Jesus