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

Closing User Session

Former Member
0 Likes
925

I want to query user sessions and then close one based on my findings. I've looked at code in RSM04000, but the specific session info and closing functionality appear to be hidden in system modules.

4 REPLIES 4
Read only

Former Member
0 Likes
812

Paul,

There are utility function modules which can be used for your purpose. But be cautious in using them appropriately.

TH_USER_LIST

TH_DELETE_USER

FYI.

Thanks,

Bala

Read only

0 Likes
812

Unfortunately, I only want to close a single window in the user's session not delete all windows.

Read only

0 Likes
812

I found the code I needed in these modules:

DATA: USRTAB LIKE UINFO OCCURS 1 WITH HEADER LINE,

MODE TYPE I,

OPCODE TYPE X.

CALL FUNCTION 'THUSRINFO'

TABLES

USR_TABL = USRTAB.

LOOP AT USRTAB WHERE BNAME = SY-UNAME.

IF USRTAB-TCODE = 'ME23'.

OPCODE = 25.

CALL 'ThUsrInfo' ID 'OPCODE' FIELD OPCODE

ID 'TID' FIELD USRTAB-TID.

ENDIF.

ENDLOOP.

Read only

0 Likes
812

Hallo Paul,

have you check if your code is working, if the user is log on to a different AppServer?

Regards,

Oliver