Skip to Content
avatar image
Former Member

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

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

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

3 Answers

  • Best Answer
    Sep 02, 2008 at 11:02 AM

    Employee ID ?

    Employee ID NE Personnel number

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

    Amit.

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Sep 02, 2008 at 10:44 AM

    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

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Sep 02, 2008 at 10:59 AM

    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.

    Add comment
    10|10000 characters needed characters exceeded