In below program I have used TH_USER_LIST function module to get lists of logged users in SAP server and also get the host address and other details.
Code :
REPORT zvp_th_user_list.
DATA: user_list TYPE STANDARD TABLE OF uinfo.
CALL FUNCTION 'TH_USER_LIST'
TABLES
list = user_list
* USRLIST =
EXCEPTIONS
auth_misssing = 1
OTHERS = 2
.
IF sy-subrc <> 0.
* Implement suitable error handling here
ENDIF.
cl_demo_output=>display( user_list ).
DATA: user_list TYPE STANDARD TABLE OF uinfo.
CALL FUNCTION 'TH_USER_LIST'
TABLES
list = user_list
* USRLIST =
EXCEPTIONS
auth_misssing = 1
OTHERS = 2
.
IF sy-subrc <> 0.
* Implement suitable error handling here
ENDIF.
cl_demo_output=>display( user_list ).
Try this code in your computer for better understanding. Enjoy the code. If you have any Question you can contact us or mail us. We will reply you as soon as possible.
Post a Comment