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: 

Delete specific user session by system lock entry

0 Kudos

My requirement is to delete a user session by the lock entry.

So assuming I have one lock entry in SM12 that I want to get rid of.

Instead of just deleting this lock entry I want to delete the session that causes this lock entry.

I know one connection is the User. However if the User has two sessions I would only want to delete that session that causes the lock and therefore automatically also get rid of the lock entry.

Any help much appreciated.

BR

3 REPLIES 3

raymond_giuseppi
Active Contributor
0 Kudos

That's a hard solution for the user which is currently creating a 1000 lines document...

In SM12 (or FM ENQUE_READ) did you identifyt the id to use in


      call function 'TH_DELETE_USER'

        exporting

          user          = <lock>-bname

          client        = <lock>-mandt

          tid           = <lock>-tid

        exceptions

          authority_error = 1

          others        = 2.

As you are SAP employee, don't you know someone who could match parameters of  system funcions C_ENQUEUE and ThUsrInfo parameters?

Regards,

Raymond

0 Kudos

There is a way of finding a connection of session to lock entry.

The return table from FM 'th_show_usr_details' has an entry that looks something like this:

field =  *].enq_info

value = '20170402XXXXXXXXXXXXXXX311XXXsuie.........................'

This entry can then be matched with the lock entry fields gusrvb or gusr.

This way you know if a lock entry belongs to a particular session.

Then via FM ENQUE_DELETE the lock entry can be deleted.

Clemenss
Active Contributor
0 Kudos

If I remember right, you can double-click the user in user overview SM04 and delete a specific session.Make sure it's the right session, make sure the last activity is quite some time ago. Try to read the user by phone, mail or so.

Best regards Clemens