2010 Aug 31 5:27 AM
Hi,
I'm making a program to list users' sessions.
I could list them, and now trying to delete one session of them.
I could delete one of own sessions by TH_DELETE_MODES.
But I cannot find out how to delete one of other user's sessions.
It is possible to delete all sessions of a user by TH_DELETE_USER.
But it delete all of the user's session.
And TH_DELETE_MODES has no parameter to identify a user.
By using SM04, it is possible to delete one of other user's session.
I debugged it but couldn't find out how to.
I hope anyone has some information on this.
Thanks in advance.
Hi,
Sorry for my bad explanation.
After executing SM04, select one line of the list and push Sessions button or double click.
Then a popup dialog shows No, Transaction, Time. I want to kill one of them.
I'm making a program to list those sessions without the dialog and I could do it.
And now I want to kill one of session of a user.
Thanks in advance.
2010 Aug 31 7:29 AM
Hello Todoman
This command ends the session of another user :
CALL 'ThSndDelUser'
ID 'MANDT' FIELD sy-mandt
ID 'BNAME' FIELD usrlist-bname
ID 'SERVER' FIELD t_server_list-name "<-- server name which user logged on
ID 'TID' FIELD usrlist-tid. "<-- session ID of user
You can get server list with function 'TH_SERVER_LIST'
and you can get user list with TID session IDs on a server wih function 'TH_USER_LIST'.
Edited by: Bulent Balci on Aug 31, 2010 8:30 AM
2010 Aug 31 10:22 AM
Hi Bulent,
Thank you for your responce.
By your answer, I could delete ohter user's sessions by TID.
But actually, I want to delete one of External sessions of a user, not all.
By TH_DELETE_MODE, I could delete one of External sessions of myself. But it has no way to set ohter user's mode.
The source of the function TH_DELETE_MODE is below.
CALL 'ThUsrInfo' ID 'OPCODE' FIELD OPCODE_DELETE_MODE
ID 'MODE' FIELD MODE.
So I'm serching a function or method to delete other user's External session (MODE).
Is it impossible?
Thanks
2010 Sep 01 8:56 AM
Hi,
I'll describe in more detail :
Go to transaction SM04 on your system
you'll see the list of logged users on that system
and this list contains a field titled "Type".
You'll see the values GUI, RFC, HTTP Plug In ..
as I understand you want to delete sessions which type HTTP Plug In / external.
Function TH_USER_LIST returns the internal representation of SM04 list
- Now loop on that table
- Find line which type = external
and username = uname u searching for
- Use TID field of that line for the command I sent in previous message
But probably your system is containing more than one application server
than I recommended you to use function TH_SERVER_LIST first
and than get user list for each application server with TH_USER_LIST.
2010 Sep 02 6:02 AM
Hi,
Sorry for my bad explanation.
After executing SM04, select one line of the list and push Sessions button or double click.
Then a popup dialog shows No, Transaction, Time. I want to kill one of them.
I'm making a program to list those sessions without the dialog and I could do it.
And now I want to kill one of session of a user.
Thanks in advance.
| User | Count |
|---|---|
| 3 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |