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

SM12 behaviour

0 Likes
1,569

Hi all,

I have to manually remove some lock users: is there a FM to be called via abap that perform the same actions of SM12?

thanks,

Andrea

1 ACCEPTED SOLUTION
Read only

aoyang
Contributor
1,439

Use FM ENQUEUE_READ to get queue info and use ENQUE_DELETE to delete it. Sample code below. It works for me.

DATA: LT_ENQ TYPE STANDARD TABLE OF SEQG3.

CALL FUNCTION 'ENQUEUE_READ'
EXPORTING
GNAME = 'EKKO' "Table in SM12
GARG = '10000000999' "Lock argument in SM12
TABLES
ENQ = LT_ENQ.

CALL FUNCTION 'ENQUE_DELETE'
EXPORTING
CHECK_UPD_REQUESTS = 0
SUPPRESS_SYSLOG_ENTRY = 'X'
TABLES
ENQ = LT_ENQ.

Hi all,

I have to manually remove some lock users: is there a FM to be called via abap that perform the same actions of SM12?

thanks,

Andrea

2 REPLIES 2
Read only

aoyang
Contributor
1,440

Use FM ENQUEUE_READ to get queue info and use ENQUE_DELETE to delete it. Sample code below. It works for me.

DATA: LT_ENQ TYPE STANDARD TABLE OF SEQG3.

CALL FUNCTION 'ENQUEUE_READ'
EXPORTING
GNAME = 'EKKO' "Table in SM12
GARG = '10000000999' "Lock argument in SM12
TABLES
ENQ = LT_ENQ.

CALL FUNCTION 'ENQUE_DELETE'
EXPORTING
CHECK_UPD_REQUESTS = 0
SUPPRESS_SYSLOG_ENTRY = 'X'
TABLES
ENQ = LT_ENQ.
Read only

jmodaal
Active Contributor
1,439

Hello,

you might have a look on function modules ENQUE_READ to get a list of lock entries back in table ENQ and use that table for ENQUE_DELETE. Both not released and of course to be handled with care.

To be honest, I would hesitate to implement a program that somehow automatically deletes lock entries. This should be still a manual task. If there are lock entries that permanently disturb or remain as zombies, I recommend to invest some time in the process / programs behind them.