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: 

Dequeue multiple instances of the same lock

roland_spindler
Participant
0 Kudos

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

9 REPLIES 9

Former Member
0 Kudos

hi,

Try FM 'DEQUEUE_ALL'.

Thanks,

Archana

0 Kudos

I don't want to remove all locks, just all locks for a certain object.

Roland

0 Kudos

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

SuhaSaha
Advisor
Advisor
0 Kudos

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

0 Kudos

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

Former Member
0 Kudos

This message was moderated.

0 Kudos

Kumar,

1) My name is Roland.

2) Please do not post any lock-related stuff to a very specific question.

Thank you

Roland

Former Member
0 Kudos

Oh Sure...Roland Sir!!

Many Apologies...Pardon.

Former Member
0 Kudos

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