BASIS
Function module
Used the same way in S/4HANA
TH_USER_INFO Get User Session Information
Returns the terminal name, IP address, number of open sessions and maximum number of sessions of the current or given user. It is used to log which computer a program was run from or to detect multiple sessions of a user. Terminal and address information is only meaningful for SAP GUI sessions and may be empty when running in the background.
- Function group
- THFB
- Remote-enabled (RFC)
- No
- Type
- Function module
Importing parameters
| Parameter | Type | Description | Required |
|---|---|---|---|
| CLIENT | SY-MANDT | Client | — |
| USER | SY-UNAME | User name | — |
| CHECK_GUI | SY-INDEX | Check GUI connection | — |
Exporting parameters
| Parameter | Type | Description |
|---|---|---|
| HOSTADDR | MSXXLIST-HOSTADR | Host address |
| TERMINAL | — | Terminal name |
| ACT_SESSIONS | SM04DIC-COUNTER | Number of open sessions |
| MAX_SESSIONS | SM04DIC-COUNTER | Maximum number of sessions |
| MY_SESSION | SM04DIC-COUNTER | Current session |
| MY_INTERNAL_SESSION | SM04DIC-COUNTER | Current internal session |
| TASK_STATE | SM04DIC-COUNTER | Task state |
| UPDATE_REC_EXIST | THFB_BOOL | Update record exists |
| TID | SY-INDEX | Terminal ID |
| GUI_CHECK_FAILED | SY-INDEX | GUI check failed |
| ADDRSTR | NI_NODEADDR | IP address |
| RC | I | Return code |
Call template (ABAP)
A skeleton generated from the interface. It lists mandatory importing parameters, exporting parameters and tables; declare the variables with suitable types in your own program.
CALL FUNCTION 'TH_USER_INFO'
IMPORTING
hostaddr = lv_hostaddr
terminal = lv_terminal
act_sessions = lv_act_sessions
max_sessions = lv_max_sessions
my_session = lv_my_session
my_internal_session = lv_my_internal_session
task_state = lv_task_state
update_rec_exist = lv_update_rec_exist
tid = lv_tid
gui_check_failed = lv_gui_check_failed.Can't find the report you need?
We also build anything that is not in the catalog. Describe it briefly and we will suggest the right solution.