How to check whether any transaction( QM02)open from one RFC

Question: Hi Gurus,

My requirement is that i want to attach one attachment from my RFC in QM02 transaction. This is i am doing successfully.

Now i want to check whether the Transaction QM02 is open or not before running the RFC. If the Tr QM02 is open for any particular Notification no ( Like 200001687), it will not attach the document and set one flag. How to do it?

Answer:
You could check whether this particular object is locked with the function ENQUEUE_READ. The proper lock object can be found by locking something in QM02 and opening a new window with SM12 to get the lock object name and parameters.
_________________
ilya

More input data: http://abaplog.wordpress.com
Sapfans ABAP FAQ: /forums/viewtopic.php?t=94198
R's ABAP Knowledge Corner: http://www.Rard-harper.net/kb/kb.html
Function modules documentation: http://www.se37.com

Answer:
Hi Ilya,

in the FM,' ENQUEUE_READ', we need to pass table paramater 'ENQ'..what is to be passed for that parameter?

My requirement is if i want to attach a document from my RFC for any Qn no like 200001687 and at the same time if any user has already open that particular QN from QM02, then my RFC would check if any user has open it or now.

a. If it is open, then it wont attach the document( which my RFC is not checking and it is attaching the document irrespective of the QM02 is open or not)

Any way a Big THANKS to you for ur help. pls provide me a bit more clarity for ur suggestion... THANKS gain.

Answer:
Hi Ilya,

in the FM,' ENQUEUE_READ', we need to pass table paramater 'ENQ'..what is to be passed for that parameter?

Double click on the function name to see what are the parameters. ENQ should be an internal table, where all the existing locks will be returned. Use Where-Used-List on this function to get some examples in your system.
_________________
ilya

More input data: http://abaplog.wordpress.com
Sapfans ABAP FAQ: /forums/viewtopic.php?t=94198
R's ABAP Knowledge Corner: http://www.Rard-harper.net/kb/kb.html
Function modules documentation: http://www.se37.com
Copyright ?2007 - 2008 www.jt77.com