cancel
Showing results for 
Search instead for 
Did you mean: 

How to get System Login UserId

Former Member
0 Kudos

how to get login userid from the system for who already logged in into system,with the help of am getting the username but am not getting the userid,how to get userid can u share this answer for me.

Accepted Solutions (0)

Answers (2)

Answers (2)

former_member199125
Active Contributor
0 Kudos

Ramana,

There are so many ways to get user details based on sy_userid. So please let me know your scenario, how are you getting user name so that we will help exactly.

FM To get the user details based on user id.

*DATA IEE_TAB TYPE PERNR_US_TAB.
*DATA WEE_TAB LIKE LINE OF IEE_TAB.
*CALL FUNCTION 'HR_GET_EMPLOYEES_FROM_USER'
*  EXPORTING
*    USER                    = SY-UNAME
**   BEGDA                   = SY-DATUM
**   ENDDA                   = SY-DATUM
**   IV_WITH_AUTHORITY       = 'X'
*  TABLES
*    EE_TAB                  = IEE_TAB
*          .

Regards

Srinivas

Former Member
0 Kudos

suppose one user has id with K515654 and name is ramana ,if i use the sy-uname then am getting ramana only ,but i want that id K515654 .to get that id which system variable i can user ?

please give answer if u know

former_member199125
Active Contributor
0 Kudos

No ramana,

Sy-uname will returrn system user id,it means K515654, for user id we dont maintain user names like ramana....

In which transaction u maintained relation between K515654 and ramana ?

Are you talking about alias?

Regards

Srinivas

Edited by: sanasrinivas on Dec 28, 2011 8:48 AM

Former Member
0 Kudos

how are you getting the username....usually toget these SU03 we will use...sy-userid or sy-uname.....will be used...