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: 

Fecthing Windows Login Name for any SAP Id

0 Kudos
422

Dear all,

I want to fetch the Windows Login name for all the SAP User's , My SAP Id is "ABCD" but my windows login is "XYZ".

Have tried the Function Module GUI_GET_DESKTOP_INFO with option "5" but unforunately it fetches only for the currect user and the same happens with the METHOD CL_GUI_FRONTEND_SERVICES=>GET_USER_NAME.

Could any please help.

with rgds

Ranjith Singh

5 REPLIES 5

FredericGirod
Active Contributor
341

the command line to know this is "whoami"

if you could run system command and catch the result, you will have your answer

matt
Active Contributor
341

frdric.girod whoami gives the same result as METHOD CL_GUI_FRONTEND_SERVICES=>GET_USER_NAME, doesn't it?

anandkumarpsd There is no connection between windows login name and a sap user name.

You log in as sapid ABCD from windows user XYZ

I could log in as sapid ABCD from windows user OPQ.

What you could do is have a program running at login, that calls METHOD CL_GUI_FRONTEND_SERVICES=>GET_USER_NAME and stores the result in a table. Over time you'd find out which windows users were logging as which SAP users.

raymond_giuseppi
Active Contributor
341

Use matthew.billingham's suggestion. I already used Enhancement (SMOD) SUSR001 Customer Exit EXIT_SAPLSUSF_001 to execute method CL_GUI_FRONTEND_SERVICES=>GET_USER_NAME at start of session and save it in a specific table, also with terminal ID and IP address (Just use some robust code, as triggering an error is not an option when using this exit!)

(Or do you use some SSO, in this case, there should be such information somewhere between SAP system and Active DIrectory...)

0 Kudos
341

EXIT_SAPLSUSF_001 'logon user-exit' is executed at logon.

raymond_giuseppi
Active Contributor
0 Kudos
341

Don't use the answer option (read the text 'Before answering') and comment the answer you want to reply.