2024 Sep 03 12:04 PM
Hello everyone, I've seen this posted quite few times, posted here but it does not seem to work properly for me, and wanted to know what I was doing wrong.
So what I want to do is end a specific users program/session which they have started, it would be great if I could end it by GUI-id but I havnt been able to find any info on doing that. But atleast to be able to do it by session & tcode, this would have to be done via the background, with no user interaction.
What I've tried is to get the info on users by
CALL FUNCTION 'TH_USER_LIST'
TABLES
list = lt_UINFO
USRLIST = lt_USRINFO
EXCEPTIONS
others = 1.
and then kill the session by
CALL FUNCTION 'TH_DELETE_USER'
EXPORTING
client = sy-mandt " Current client
user = ls_usrinfo-bname " Username of the session
tid = ls_usrinfo-tid " Session ID (TID) to end
EXCEPTIONS
OTHERS = 1.
as I've seen other people on here say it worked for them, but this ends the users entire session, all their current transaction and not just a specific program or tcode and thus wont work for me.
Does anybody know of a good way to end a users specific transaction/program or guiid?
2024 Sep 03 1:29 PM
Could you try:
(NB: Use Include TSKHINCL for constants)
Loop on result of TH_USER_LIST' and list of nodes for each user
CALL 'ThUsrInfo' ID 'OPCODE' FIELD opcode_mode_count
ID 'TID' FIELD tid
ID 'MODES' FIELD modes. " table of type modusDelete one node with
CALL 'ThUsrInfo' ID 'OPCODE' FIELD opcode_delete_mode
ID 'TID' FIELD tid
ID 'MODES' FIELD modus-modus.
2024 Sep 03 2:57 PM
Thank you, but what data value should I define the OPCODE id's with? to my knowledge they are al defined with some number e.g: DATA: opcode_get_mode_list TYPE x VALUE 'INT'.
2024 Sep 03 3:31 PM
2024 Sep 04 8:22 AM
ohh apologies, my reading comprehension is worse than I thought.
2024 Sep 04 9:57 AM
2024 Sep 05 7:11 AM
Thank you for the assistance, that worked 🙂
Just out of curiosity do you know a way to end a users program in fashion similar to LEAVE PROGRAM, as in a service that listens to a request of closing a program and returning the user to their previous "page".