Application Development 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: 

Log off all the Users

Former Member
0 Kudos

Hi All,

Is there any program to log off all the users who are currently logged into the system. Using SM04 transaction this can be achieved but I am looking for a report/tcode which will & delete all the users currently logged in at once.

Rgds,

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi,

As far as I know, this is not a desirable operation, even for a super user. Consequently, I don't think there's any report which does that for you. If it is a matter of academic interest then you an set about writing a program of your own.

But the general practice is to let the users know that they should log off themselves, saving anything important that they may be currently working on. You can choose to send an Express Message to all the logged on users, or you can put up a message on the log on screen which tells the users not to log on during a specified time period for the purpose of some system administation tasks.

May I ask you why you need a program like that ? May be there's an elegant alternative that you could use.

Regards,

Anand Mandalika.

2 REPLIES 2

Former Member
0 Kudos

Hi,

As far as I know, this is not a desirable operation, even for a super user. Consequently, I don't think there's any report which does that for you. If it is a matter of academic interest then you an set about writing a program of your own.

But the general practice is to let the users know that they should log off themselves, saving anything important that they may be currently working on. You can choose to send an Express Message to all the logged on users, or you can put up a message on the log on screen which tells the users not to log on during a specified time period for the purpose of some system administation tasks.

May I ask you why you need a program like that ? May be there's an elegant alternative that you could use.

Regards,

Anand Mandalika.

0 Kudos

Thats a very dangerous option and cannot be encouraged.

Just for academic interest you can try in these lines to achieve it.

Define Opcode variables for deletion & commit operations say

DATA: TH_OPCODE(1) TYPE X

OPCODE_DELETE LIKE TH_OPCODE VALUE 25,

OPCODE_COMMIT LIKE TH_OPCODE VALUE 41.

get the user info using fn. module 'TH_USER_LIST' into a table say <ITAB1>

then loop through the user list in <ITAB1> and

CALL 'ThUsrInfo' ID 'OPCODE' FIELD OPCODE_DELETE

ID 'TID' FIELD <ITAB1-TID>.

Then commit the work,

CALL 'ThUsrInfo' ID 'OPCODE' FIELD OPCODE_COMMIT.

This will delete the sessions.

You can go through the include program TSKHINCL to get OPCODE details.

This post is NOT for Notorious programmers