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

Getting Window's user logon ID ?

Former Member
0 Likes
2,033

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
Read only

Former Member
1,370

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

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
Read only

athavanraja
Active Contributor
0 Likes
1,370

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

Read only

andreas_mann3
Active Contributor
0 Likes
1,370

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

Read only

Former Member
1,371

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

Read only

0 Likes
1,370

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?

Read only

Former Member
0 Likes
1,370

Got it! (points for solved

..Thanks for the help guys.