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: 

How to get Employee ID From User ID sy-uname.

Sonal_J
Participant
0 Kudos

Hello all,

If the Infotype 105 of HR master data is not maintained than from where can i get the Employee ID if we have the userid through sy-uname.

Thanks

1 ACCEPTED SOLUTION

former_member181995
Active Contributor
0 Kudos

Employee ID ?

Employee ID NE Personnel number

Are you talking about Personnel number(PERNR). i think no!

Amit.

3 REPLIES 3

Former Member
0 Kudos

hiii

use FM

HRWPC_AP_GET_EMPLOYEE_FOR_USER

or you can use FM RP_GET_PERNR_FROM_USERID

CALL FUNCTION 'RP_GET_PERNR_FROM_USERID'
EXPORTING
BEGDA = sy-datum
ENDDA = sy-datum
USRID = WA_SYUNAME
USRTY = '0001'
IMPORTING
USR_PERNR = WA_PERNR
EXCEPTIONS
RETCD = 1
OTHERS = 2

regards

twinkal

Former Member
0 Kudos

Try using FM 'RP_GET_PERNR_FROM_USERID :

DATA : V_NAME TYPE PA0105-USRID,

V_PERNR TYPE PERSNO.

CALL FUNCTION 'RP_GET_PERNR_FROM_USERID'

EXPORTING

BEGDA = BEGDA

ENDDA = ENDDA

USRID = V_UNAME

USRTY = '0001'

IMPORTING

USR_PERNR = V_PERNR

EXCEPTIONS

RETCD = 1

OTHERS = 2.

former_member181995
Active Contributor
0 Kudos

Employee ID ?

Employee ID NE Personnel number

Are you talking about Personnel number(PERNR). i think no!

Amit.