Application Development and Automation 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: 
Read only

Table for User Name and User ID?

Former Member
346,403

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
Read only

Former Member
133,757

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
Read only

RichHeilman
Developer Advocate
Developer Advocate
133,756

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

Read only

0 Likes
133,756

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

Regards,

Rich Heilman

Read only

0 Likes
133,756

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.

Read only

0 Likes
133,756

YEs, and Yes

Regards,

RIch Heilman

Read only

0 Likes
133,756

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

Shreekant

Read only

0 Likes
133,756

ThanQ.

Read only

0 Likes
133,756

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

Read only

133,756

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

Read only

ferry_lianto
Active Contributor
133,756

Hi,

Please check table USR03.

Regards,

Ferry Lianto

Read only

Former Member
133,758

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.

Read only

0 Likes
133,755

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.

Read only

133,755

data wa_usr like v_usr_name.

select single * from v_usr_name into wa_usr

where bname = ''.

Thanks

Seshu

Read only

Former Member
0 Likes
133,755

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

Read only

Former Member
0 Likes
133,755

USR21 Personnel number does not match HR Personnel number.

Read only

0 Likes
133,755

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.

Read only

Former Member
0 Likes
133,755

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

Read only

133,755

You Can use USER_ADDR table

Regards

Read only

0 Likes
133,755

This message was moderated.

Read only

0 Likes
133,755

This is the best answer.