Retrieving the user IP address and logon ID
Suresh Kumar Parvathaneni
In order to retrieve the end users terminal ID and IP address, the function module TERMINAL_ID_GET can be used. This functional module will retrieve both the IP address and the logon ID.
REPORT ZSuresh_TEST.
data:
w_terminal like USR41-TERMINAL.
CALL FUNCTION 'TERMINAL_ID_GET'
EXPORTING
USERNAME = SY-UNAME
IMPORTING
TERMINAL = w_terminal
EXCEPTIONS
MULTIPLE_TERMINAL_ID = 1
NO_TERMINAL_FOUND = 2
OTHERS = 3
.
IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
write: w_terminal.
This was first published in September 2004
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.
Join the conversationComment
Share
Comments
Results
Contribute to the conversation