Application Development 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: 

Getting Window's user logon ID ?

Former Member
0 Kudos
843

Hi All,

Was wondering if there is a way to get the window's logon

user ID, Domain using ABAP code/function module.

Basically I am trying to get all the users logged on to different terminals with their window's logon user id.

Cheers,

Neeth

1 ACCEPTED SOLUTION

Former Member
180

Hi Nameeth,

you could also use function module GUI_GET_DESKTOP_INFO. With parameter TYPE = 5, you will get the name of the logon ID. Please check documentation on this function module for more info.

Please let us know if it helped. Best regards,

Alvaro

5 REPLIES 5

athavanraja
Active Contributor
0 Kudos
180

I am not sure of a function in SAP.

If you just want their IP address from where they logged on and their SAP user id use "THUSRINFO" function module.

If you want their windows logon info, you could try running a VB script from abap to get the same.

Regards

Raja

andreas_mann3
Active Contributor
0 Kudos
180

HI,

e.g.

1)

DATA: username TYPE string.

CALL METHOD cl_gui_frontend_services=>get_user_name

CHANGING user_name = username

EXCEPTIONS cntl_error = 1

error_no_gui = 2

not_supported_by_gui = 3

OTHERS = 4.

CALL METHOD cl_gui_cfw=>flush( ).

WRITE: / username.

2) terminal:

cl_gui_frontend_services=>GET_COMPUTER_NAME

grx Andreas

Former Member
181

Hi Nameeth,

you could also use function module GUI_GET_DESKTOP_INFO. With parameter TYPE = 5, you will get the name of the logon ID. Please check documentation on this function module for more info.

Please let us know if it helped. Best regards,

Alvaro

0 Kudos
180

Doesn't this FM only work for the user running the program? How would it provide the logon ID for all of the users logged on to the SAP system?

Have I misunderstood the problem?

Former Member
0 Kudos
180

Got it! (points for solved

..Thanks for the help guys.