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: 

Table for User Name and User ID?

Former Member
0 Kudos

Hi Experts,

I hv User ID, that Logs in. So, I waanna to pull the corresponding Name.

So,

Wher Can I find these data i.e. Which is the best Table/source?

ThanQ.

1 ACCEPTED SOLUTION

former_member181962
Active Contributor

Yo ucan alternatively use SUSR_USER_ADDRESS_READ.

The exporting parameter user_address would have the full name of the user in the field name_text.

    DATA: user_address LIKE  addr3_val.
    CALL FUNCTION 'SUSR_USER_ADDRESS_READ'
      EXPORTING
        user_name                    = sy-uname
*       READ_DB_DIRECTLY             = ' '
      IMPORTING
        user_address                 = user_address
*       USER_USR03                   =
      EXCEPTIONS
        user_address_not_found       = 1
        OTHERS                       = 2.

    IF sy-subrc = 0.
       write:/ user_address-name_text.
    ENDIF.

19 REPLIES 19

RichHeilman
Developer Advocate
Developer Advocate

Go to table USR21 and get the person number, then use that person number number to go to ADRP. There should be the name.

Regards,

Rich Heilman

Message was edited by:

Rich Heilman

0 Kudos

Oh, view V_USR_NAME is a view over the USR21 and ADRP tables. Cool.

Regards,

Rich Heilman

0 Kudos

1- can i use this (or any views) in SQL statements?

1- can i use this (or any views) in data declaration like name_first type v_usr_name-name_first?

thaq.

0 Kudos

YEs, and Yes

Regards,

RIch Heilman

0 Kudos

Yes u can use views in the select statements and would works like the normal data base tables.

Shreekant

0 Kudos

ThanQ.

0 Kudos

Hi Rich,

If u hv any idea, then Pls. respond to my thread with title, <i><b>NT Log in IDs & Names</b></i>

Its like,

Where can I find the Names for NT Log in IDs? I mean, What table I hv to look for to grab the Name value for a given NT Log in ID?

ThanQ.

Message was edited by:

Sridhar

Hi experts

i have a problem

i have a role EMP in R/3, having default field employee data with personnel number , in BP it is accepting , but in table it is not showing the data ,

i have a role MKK in R/3 , i added the same field BUCP10 to BP , this field also not showing any data in table BUT000,

what is the reason please help me

ferry_lianto
Active Contributor

Hi,

Please check table USR03.

Regards,

Ferry Lianto

former_member181962
Active Contributor

Yo ucan alternatively use SUSR_USER_ADDRESS_READ.

The exporting parameter user_address would have the full name of the user in the field name_text.

    DATA: user_address LIKE  addr3_val.
    CALL FUNCTION 'SUSR_USER_ADDRESS_READ'
      EXPORTING
        user_name                    = sy-uname
*       READ_DB_DIRECTLY             = ' '
      IMPORTING
        user_address                 = user_address
*       USER_USR03                   =
      EXCEPTIONS
        user_address_not_found       = 1
        OTHERS                       = 2.

    IF sy-subrc = 0.
       write:/ user_address-name_text.
    ENDIF.

0 Kudos

1- can i use this (or any views) in SQL statements?

2- can i use this (or any views) in data declaration like name_first type v_usr_name-name_first?

thaq.

data wa_usr like v_usr_name.

select single * from v_usr_name into wa_usr

where bname = ''.

Thanks

Seshu

Former Member
0 Kudos

Pass User ID in BNAME to USR21 table and you get PERSNUMBER.

Pass PERSNUMBER to ADRP table and you get First and Last Name

Thanks,

SKJ

Former Member
0 Kudos

USR21 Personnel number does not match HR Personnel number.

0 Kudos

parameters namee type usr02-bname.

types: begin of usrz,

name_first type adrp-name_first,

name_last type adrp-name_last,

name_text type adrp-name_text ,

bname type usr21-bname,

end of usrz.

data ln_usrz type usrz.

select single

adrp~name_first

adrp~name_last

adrp~name_text

usr21~bname

into ln_usrz

from adrp

inner join usr21 on adrppersnumber = usr21persnumber

where usr21~bname = namee.

write:

ln_usrz-name_first,

ln_usrz-name_last,

ln_usrz-name_text,

ln_usrz-bname.

Former Member
0 Kudos

Go to SU10 or SUIM, Authorization data -> execute after giving user id

You Can use USER_ADDR table

Regards

0 Kudos

This message was moderated.

0 Kudos

This is the best answer.