Application Development and Automation 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: 
Read only

TH_DELETE_USER + TH_DELETE_MODES

Former Member
0 Likes
3,451

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.

4 REPLIES 4
Read only

bbalci
Contributor
0 Likes
1,692

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

Read only

Former Member
0 Likes
1,692

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

Read only

0 Likes
1,692

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.

Read only

Former Member
0 Likes
1,692

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.