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

Dequeue multiple instances of the same lock

roland_spindler
Participant
0 Likes
2,079

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

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
Read only

Former Member
0 Likes
1,553

hi,

Try FM 'DEQUEUE_ALL'.

Thanks,

Archana

Read only

0 Likes
1,553

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

Roland

Read only

0 Likes
1,553

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

Read only

SuhaSaha
Product and Topic Expert
Product and Topic Expert
0 Likes
1,553

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

Read only

0 Likes
1,553

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

Read only

Former Member
0 Likes
1,553

This message was moderated.

Read only

0 Likes
1,553

Kumar,

1) My name is Roland.

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

Thank you

Roland

Read only

Former Member
0 Likes
1,553

Oh Sure...Roland Sir!!

Many Apologies...Pardon.

Read only

Former Member
0 Likes
1,553

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