‎2009 Apr 20 6:32 PM
hye gurus,
which table stores the login IP and machine name.
Is there any way where we can retrieve the login id (network) of the person logged in the pc.
Note : i am not referring to the SAP GUI log in, instead user logged into the system and using SAP.
Thanks
Imran.
‎2009 Apr 21 12:41 AM
Hello Imran,
Below code would give you the name of the user logged into the OS.
DATA cWinUser TYPE STRING .
CALL METHOD CL_GUI_FRONTEND_SERVICES=>GET_USER_NAME
CHANGING
USER_NAME = cWinUser
EXCEPTIONS
CNTL_ERROR = 1
ERROR_NO_GUI = 2
NOT_SUPPORTED_BY_GUI = 3
OTHERS = 4.
CALL METHOD CL_GUI_CFW=>FLUSH
EXCEPTIONS
CNTL_SYSTEM_ERROR = 1
CNTL_ERROR = 2
OTHERS = 3.
WRITE : cWinUser.Also, you can use CL_GUI_FRONTEND_SERVICES=>GET_IP_ADDRESS to get the IP address.
Amit Purohit.
‎2009 Apr 20 6:45 PM
Hi Imran,
AS i know u can get the IP address and the Computer name...from AL08 transaction or SM04 transaction..
if you wan to get the details..
DATA : th_opcode(1) TYPE x.
CONSTANTS: opcode_detailed_blk_info LIKE th_opcode VALUE 76.
DATA: usr_blksd_tabl TYPE ublksd OCCURS 1 WITH HEADER LINE.
* Full session details of users logged accessing SAP R/3
CALL 'ThUsrInfo' ID 'OPCODE' FIELD opcode_detailed_blk_info
ID 'TAB' FIELD usr_blksd_tabl-*sys*.
Regards,
Prabhudas
‎2009 Apr 21 12:41 AM
Hello Imran,
Below code would give you the name of the user logged into the OS.
DATA cWinUser TYPE STRING .
CALL METHOD CL_GUI_FRONTEND_SERVICES=>GET_USER_NAME
CHANGING
USER_NAME = cWinUser
EXCEPTIONS
CNTL_ERROR = 1
ERROR_NO_GUI = 2
NOT_SUPPORTED_BY_GUI = 3
OTHERS = 4.
CALL METHOD CL_GUI_CFW=>FLUSH
EXCEPTIONS
CNTL_SYSTEM_ERROR = 1
CNTL_ERROR = 2
OTHERS = 3.
WRITE : cWinUser.Also, you can use CL_GUI_FRONTEND_SERVICES=>GET_IP_ADDRESS to get the IP address.
Amit Purohit.