07-03-2006 11:47 AM
hi !!
I have a requirement to give a meesage with the user name when a particular database table is locked using ENQUEUE Function module .
regards
07-03-2006 11:51 AM
Have a look at the FM ENQUEUE_READ. This gives a list of all programs locked at any given time, along with the user's name. You can customize it to your requirement by passing the name of the database table.
The return paramter ENQ should have all the details for you.
Hope this helps.
Sudha
07-03-2006 11:51 AM
Have a look at the FM ENQUEUE_READ. This gives a list of all programs locked at any given time, along with the user's name. You can customize it to your requirement by passing the name of the database table.
The return paramter ENQ should have all the details for you.
Hope this helps.
Sudha
07-11-2006 7:24 AM
Thanks Sudha very much it solved my problem ..i am late in confirming as I was busy in implementing it and testing ...
regards
07-03-2006 11:51 AM
/1BCDWBEN/CEN0003 Lock and unlock functions
ENQUEUE_ESLX_TABLE Request lock for object ESLX_TABLE
/1BCDWBEN/FEN0003 Lock and unlock functions
ENQUEUE_E_TBSK_KEY_TABLE Request lock for object E_TBSK_KEY_TABLE
/1BCDWBEN/FEN0004 Lock and unlock functions
ENQUEUE_E_VTBTABLE Request lock for object E_VTBTABLE
/1BCDWBEN/SEN4
ENQUEUE_E_TABLE
/1BCDWBEN/SENQ
ENQUEUE_E_TABLEE
ENQUEUE_E_TABLES
sy-uname will give u the user name
reward points if it helps
regards
gunjan
07-03-2006 11:54 AM
hi,
try:
sptab-tabname = c_sperr.
sptab-varkey = sy-mandt.
*
CALL FUNCTION 'ENQUEUE_E_TABLE'
EXPORTING
tabname = sptab-tabname
varkey = sptab-varkey
EXCEPTIONS
foreign_lock = 1
system_failure = 2
OTHERS = 3.
IF sy-subrc <> 0.
MESSAGE e001(00) WITH ...
ENDIF.
07-03-2006 12:12 PM
hi
you can just pass an import parameter of type sy-uname in
Function module 'ENQUEUE_lockobjectname'.and then pass user name in this parameter.
To get the user name in Message, you can write Message e(---) with sy-uname.
Regards
Naveen
07-03-2006 1:16 PM
HI
T-Code SM12 will give the info of all the locks. HOwevere you need authorization for this T-code.