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: 

my own lock object can i get the user who lock the table ?

Former Member
0 Kudos

hi everyone !

i create lock object to my own table.

i would like to get from function module enqueue_ezeliram the user who locked

the table can i get it from fm enqueue ? ?

1 REPLY 1

Former Member
0 Kudos

Hi eliram,

1. Yes we can do this

2. Sy-SUBRC and SY-MSGV1 are the IMPORTANT fields.

3. follow this logic, after calling the lock fm.

4.

DATA : UNAME LIKE SY-UNAME.

DATA : SUBRC TYPE SY-SUBRC.

SUBRC = SY-SUBRC.

UNAME = SY-MSGV1.

--- Error while locking

if subrc = 2 or subrc = 3.

message e013 with applnum.

endif.

<b>if subrc = 1 .</b>

*-- <b>user himself has locked</b>

if uname = sy-uname.

message e012 with applnum.

endif.

  • -- <b>other user has locked.</b>

if uname <> sy-uname.

message e011 with applnum uname.

endif.

endif

regards,

amit m.