Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

IP and network id

Former Member
0 Likes
762

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.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
582

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.

2 REPLIES 2
Read only

Former Member
0 Likes
582

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

Read only

Former Member
0 Likes
583

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.