2008 Mar 10 8:22 PM
Hi All. Does anybody know how to end/terminate a specific users session? Say for example, a user has 3 sessions: MM01, SE16, and SM37. I would like to end/terminate, using a program, just the MM01 session leaving the other 2 sessions active.
Regards,
RV
2008 Mar 11 4:54 AM
Hi,
there is a command LOGOFF in abap if u execute that command u can logged out of the current user session.
or else call the function module CALL 'SYST_LOGOFF'.
example:
DATA : ANS.
CALL FUNCTION 'POPUP_TO_CONFIRM'
EXPORTING
TITLEBAR = 'Do you really want to log off? '
* DIAGNOSE_OBJECT = ' '
TEXT_QUESTION =
'Do you really want to log off and go home?'
TEXT_BUTTON_1 = 'Go Home'
* ICON_BUTTON_1 = ' '
TEXT_BUTTON_2 = 'Continue Working'
* ICON_BUTTON_2 = ' '
* DEFAULT_BUTTON = '2'
DISPLAY_CANCEL_BUTTON = SPACE
* USERDEFINED_F1_HELP = ' '
START_COLUMN = 25
START_ROW = 6
* POPUP_TYPE =
IMPORTING
ANSWER = ANS
* TABLES
* PARAMETER =
EXCEPTIONS
TEXT_NOT_FOUND = 1
OTHERS = 2.
CHECK ANS = '1'.
CALL 'SYST_LOGOFF'.
rgds,
bharat.
2008 Mar 11 4:53 AM
Hi Rellie,
Have you given a thought of using the standard program 'RSM04000_ALV'.
That program displays all the users currently logged-in and the transactions they are working on.
It got many implicit enhancement points. So, for your purpose you can plug in your code in
those enhancement points.
I have not done anything similar but my guess is, it will work for this scenario.
Try to plug your code in perform build_list and complete user details will be available in the
table 'usr_tabl_alv'. This perform has got enhancement point so make use of it.
Please let me if it works for you.
Thanks & Regards,
Jallu
2008 Mar 11 4:54 AM
Hi,
there is a command LOGOFF in abap if u execute that command u can logged out of the current user session.
or else call the function module CALL 'SYST_LOGOFF'.
example:
DATA : ANS.
CALL FUNCTION 'POPUP_TO_CONFIRM'
EXPORTING
TITLEBAR = 'Do you really want to log off? '
* DIAGNOSE_OBJECT = ' '
TEXT_QUESTION =
'Do you really want to log off and go home?'
TEXT_BUTTON_1 = 'Go Home'
* ICON_BUTTON_1 = ' '
TEXT_BUTTON_2 = 'Continue Working'
* ICON_BUTTON_2 = ' '
* DEFAULT_BUTTON = '2'
DISPLAY_CANCEL_BUTTON = SPACE
* USERDEFINED_F1_HELP = ' '
START_COLUMN = 25
START_ROW = 6
* POPUP_TYPE =
IMPORTING
ANSWER = ANS
* TABLES
* PARAMETER =
EXCEPTIONS
TEXT_NOT_FOUND = 1
OTHERS = 2.
CHECK ANS = '1'.
CALL 'SYST_LOGOFF'.
rgds,
bharat.
2008 Mar 11 5:01 AM
Hi,
Go to Transaction SM04.
Select the user.
And click END SESSION
Reward if helpful.
Regards.
2008 Mar 11 5:56 PM
Thank you all for your prompt replies!
Hello Akshay yes, SM04 will definitely work if youre doing it manually. I would like to do what SM04 can do, in terminating specific sessions, but I want to do it in a program and run the program in background.
Hello Bharat what you suggested will work but I dont want to logoff the user. I just want to terminate one of the users session.
Hello Jalendhar youre right 'RSM04000_ALV' is the place to start. Thats where I found out that I can use a function call to 'ThUsrInfo' that will give me a list of the active users in the system with all the sessions and transactions they are using. When I tried to debug (in system mode) the part that terminates the session, it doesnt show me the exact code that does the termination. Through further research, I found that I can use 'ThUsrInfo' with ID 'OPCODE' FIELD opcode_delete_mode to delete a session. My problem is I cant seem to figure out how to control which session gets terminated.
Does anybody have an idea how to use 'ThUsrInfo' to terminate specific sessions?
Kind regards,
RV
2010 Oct 15 10:34 AM
Hi RV,
Did you get the solution, I have the same issue where I want to delete a particular session. i tried using Th_USER_LIST , but it doesnt give me the list of all the sessions for a user.
2009 Jul 19 9:52 AM
2009 Jul 19 9:55 AM
try SM12 also..and remove the lock..TCODe automatically will be removed...
2010 Aug 30 10:40 AM
Hello!
I have the same problem. Please, tell me, if you have success in this part