2012 Feb 03 2:01 PM
Hi All,
How to get the terminal id for loging user ? I want to use FM 'THUSRINFO' which gives details of all login user but if a same user has multiple session from same host then how to know the TID of any specific session?
Regards,
Anuj
2012 Feb 03 5:51 PM
Have a look at TERMINAL_ID_GET, it gives an exception for multiple terminal id. Just have a look into the code. It will take you to table USR41.
Hi All,
How to get the terminal id for loging user ? I want to use FM 'THUSRINFO' which gives details of all login user but if a same user has multiple session from same host then how to know the TID of any specific session?
Regards,
Anuj
2012 Feb 03 2:09 PM
Why not do a where used list of this FM and see how SAP uses it??
Rob
2012 Feb 03 5:51 PM
Have a look at TERMINAL_ID_GET, it gives an exception for multiple terminal id. Just have a look into the code. It will take you to table USR41.
2012 Feb 04 6:25 AM
Thanks keshav,
table usr41 only maintained terminal id for user which is login through sapgui.In my case i want to track the terminal id of those users which has been logged through erp connecter .
kernal CALL 'ThUsrInfo' is maintaing logs for all users with respective tid but how to track those erp connector users is a question ?
Regards,
Anuj jain
2014 Jan 22 4:07 PM
This seems to work for me, had the same problem with multiple logins from same client terminal:
constants: opcode_list type x value 2.
data: begin of ls_usr_tabl.
include structure uinfo.
data: end of ls_usr_tabl.
data: lt_usr_tabl like table of ls_usr_tabl.
data l_session_id type thfb_session_id.
data lt_tech_info type standard table of techinfo.
data ls_tech_info like line of lt_tech_info.
call 'ThUsrInfo' id 'OPCODE' field opcode_list
id 'TAB' field lt_usr_tabl.
call function 'TH_GET_SESSION_ID'
importing
session_id = l_session_id.
loop at lt_usr_tabl into ls_usr_tabl where bname = sy-uname and type = 4.
clear lt_tech_info.
call function 'TH_SHOW_USR_DETAILS'
exporting
term_id = ls_usr_tabl-tid
tables
tech_info = lt_tech_info
exceptions
others = 10.
if sy-subrc <> 0.
continue.
endif.
read table lt_tech_info into ls_tech_info with key field = 'session_id'.
if ls_tech_info-value ne l_session_id.
continue.
else.
no_modes = ls_usr_tabl-extmodi.
exit.
endif.
endloop.
| User | Count |
|---|---|
| 3 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |