Tip

Display all users logged onto a server

Use the code below to display all users logged onto a server:
DATA: BEGIN OF T_USER_TAB OCCURS 0.
INCLUDE STRUCTURE UINFO.
DATA: END OF T_USER_TAB. 

DATA NUMBER_OF_USERS TYPE I.

CALL FUNCTION 'TH_USER_LIST'
TABLES
  LIST   = T_USER_TAB      EXCEPTIONS
  OTHERS = 1.

DESCRIBE TABLE T_USER_TAB  LINES NUMBER_OF_USERS.

WRITE:/ NUMBER_OF_USERS, 'ARE LOGGED IN NOW'.

LOOP AT T_USER_TAB. 
WRITE:/ T_USER_TAB-BNAME.
ENDLOOP.

    Requires Free Membership to View

This was first published in April 2005

Join the conversationComment

Share
Comments

    Results

    Contribute to the conversation

    All fields are required. Comments will appear at the bottom of the article.

    Disclaimer: Our Tips Exchange is a forum for you to share technical advice and expertise with your peers and to learn from other enterprise IT professionals. TechTarget provides the infrastructure to facilitate this sharing of information. However, we cannot guarantee the accuracy or validity of the material submitted. You agree that your use of the Ask The Expert services and your reliance on any questions, answers, information or other materials received through this Web site is at your own risk.