Hi Faisal,
Sry i am new to CRM. Will this code work in deleting the SM12 entries programmatically.
I need to delete the session lock for that particular user.
DATA: W_GARG TYPE EQEGRAARG.
CLEAR: W_GARG, ENQ, ENQ[].
CALL FUNCTION 'ENQUEUE_READ'
EXPORTING
GNAME = P_GNAME
GUNAME = P_GUNAME
IMPORTING
NUMBER = P_NUMBER
SUBRC = P_SUBRC
TABLES
ENQ = ENQ
EXCEPTIONS
COMMUNICATION_FAILURE = 1
SYSTEM_FAILURE = 2
OTHERS = 3.
IF ENQ[] IS NOT INITIAL.
CONCATENATE SY-MANDT P_WI_ID INTO W_GARG.
DELETE ENQ WHERE GARG W_GARG.
CALL FUNCTION 'ENQUE_DELETE'
EXPORTING
CHECK_UPD_REQUESTS = '1'
IMPORTING
SUBRC = P_SUBRC
TABLES
ENQ = ENQ.
ENDIF.
ENDFUNCTION.