02-01-2010 8:34 AM
Hello,
I'm developing a user exit for a standard transaction. In this exit I want to dequeue some of the locks created by the standard transaction. For some reason it has created multiple locks for the same object.
So if I write
CALL FUNCTION 'DEQUEUE_ESORDER'
EXPORTING
mode_aufk = 'E'
aufnr = l_aufnr.
the "use count" in SM12 decreases by one. If I call the same dequeue several times (e.g. in a DO loop), the lock disappears in SM12.
Is there a way to remove all lock instances with a single FM call?
Thanks in advance
Roland
02-01-2010 8:37 AM
02-01-2010 8:40 AM
I don't want to remove all locks, just all locks for a certain object.
Roland
02-01-2010 8:44 AM
Hi Roland,
You may
- lock the whole table SM30 like via lock object E_TABLE or E_TABLEE
CALL FUNCTION 'ENQUEUE_E_TABLE'
EXPORTING
tabname = 'MARA'
EXCEPTIONS
foreign_lock = 1.
- lock the whole set of keys using a wildcard key via the lock object assiociated to records of the table
CALL FUNCTION 'ENQUEUE_EMMARAE'
EXPORTING
mandt = sy-mandt
* MATNR = " generic value will lock whole table
EXCEPTIONS
foreign_lock = 1
system_failure = 2
OTHERS = 3.
But be aware that the lock tools will only lock vs other reports using the same logic/FM. (chek in SM12)
Also read documentation like The SAP Lock Concept (BC-CST-EQ) and samples like Example Program: SAP Locking
02-01-2010 8:43 AM
Hello,
For some reason it has created multiple locks for the same object
If you check the SAP documentation on [SAP Lock Mechanism|http://help.sap.com/saphelp_nw04/Helpdata/EN/aa/fd823730fa874ae10000009b38f8cf/frameset.htm] how can you justify this statement.
BR,
Suhas
02-01-2010 9:31 AM
Suhas,
As I didn't implement the standard transaction - obviously - this question should be sent to SAP, but my best guess is that two different LUWs have been started.
Kumar,
I'm not trying to lock something, I'm trying to remove locks created by someone else.
Roland
02-01-2010 9:39 AM
02-01-2010 9:42 AM
Kumar,
1) My name is Roland.
2) Please do not post any lock-related stuff to a very specific question.
Thank you
Roland
02-01-2010 9:47 AM
02-01-2010 10:02 AM
This is also your final warning!
If you copy&paste again, of answer interview questions with links, or I have to spend more than 1 more minute looking into Abuse Reports about your behaviour... then your user ID will be deleted .
You have been warned plenty of times before!
Julius