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

User tables

Former Member
0 Likes
4,266

HI Frenz,

in which tables i can find username, user's address, phone number, email id?

i have user ID... i need to print other details also.

Regards

1 ACCEPTED SOLUTION
Read only

RichHeilman
Developer Advocate
Developer Advocate
0 Likes
2,574

You can get the user address information from the ADRC, and ADR6 tables. Check ADRC to get the relevant fields for address.

For example, here is how to join the tables.



report zrich_0001.

data: begin of user_info,
      bname type usr21-bname,
      name_text type adrp-name_text,
      tel_number type adcp-tel_number,
      tel_extens type adcp-tel_extens,
      smtp_addr type adr6-smtp_addr,
      end of user_info.


* Get User Data
clear user_info.
select single  usr21~bname adrp~name_text adcp~tel_number
        adcp~tel_extens adr6~smtp_addr
                into corresponding fields of  user_info
                  from usr21
                  inner join adrc
                    on  usr21~addrnumber = adrc~addrnumber
                  inner join adrp
                    on  usr21~persnumber = adrp~persnumber
                  inner join adcp
                    on  usr21~addrnumber = adcp~addrnumber
                    and usr21~persnumber = adcp~persnumber
                  inner join adr6
                    on  adcp~addrnumber = adr6~addrnumber
                    and adcp~persnumber = adr6~persnumber
                            where usr21~bname = sy-uname.


write:/ user_info-bname, user_info-name_text, user_info-tel_number,
        user_info-tel_extens, user_info-smtp_addr.

Regards,

Rich Heilman

Message was edited by: Rich Heilman

6 REPLIES 6
Read only

RichHeilman
Developer Advocate
Developer Advocate
0 Likes
2,575

You can get the user address information from the ADRC, and ADR6 tables. Check ADRC to get the relevant fields for address.

For example, here is how to join the tables.



report zrich_0001.

data: begin of user_info,
      bname type usr21-bname,
      name_text type adrp-name_text,
      tel_number type adcp-tel_number,
      tel_extens type adcp-tel_extens,
      smtp_addr type adr6-smtp_addr,
      end of user_info.


* Get User Data
clear user_info.
select single  usr21~bname adrp~name_text adcp~tel_number
        adcp~tel_extens adr6~smtp_addr
                into corresponding fields of  user_info
                  from usr21
                  inner join adrc
                    on  usr21~addrnumber = adrc~addrnumber
                  inner join adrp
                    on  usr21~persnumber = adrp~persnumber
                  inner join adcp
                    on  usr21~addrnumber = adcp~addrnumber
                    and usr21~persnumber = adcp~persnumber
                  inner join adr6
                    on  adcp~addrnumber = adr6~addrnumber
                    and adcp~persnumber = adr6~persnumber
                            where usr21~bname = sy-uname.


write:/ user_info-bname, user_info-name_text, user_info-tel_number,
        user_info-tel_extens, user_info-smtp_addr.

Regards,

Rich Heilman

Message was edited by: Rich Heilman

Read only

Former Member
0 Likes
2,574

Hi,

Check the following tables

USR01

USR02

USR03..

You can use the BAPI BAPI_USER_GET_DETAIL..

Thanks,

Naren

Read only

Former Member
0 Likes
2,574

try to use FM SUSR_USER_ADDRESS_GET

Read only

Former Member
0 Likes
2,574

Hi ,

for a standard organisation they will be storing all employee/personal data for communication in "communications Infotype" where different subtype shows mail id,phone number etc....usually it is a custom developed infotype ...it will be starting with PAxxxx....

eg:pa9006...its a very large place to hunt down......

Regards

BX

Read only

0 Likes
2,574

hi,

one more point----

please try <b>pa0105</b> table with subtype <u>20</u> for <u>phone number</u>field =>usrid

pa0105 table with subtype <u>10</u> for <u>mail id</u>field =>usrid_long

it is a communication table and a standard infotype..varying subtypes could give you your desired results

Regards

Read only

Former Member
0 Likes
2,574

Hi

Check this code...

Select single pernr uname

from pa0105

into ( l_pernr, l_user )

where subty = '0001'

and usrid = sy-user.

endselect.

for subty 0010 in pa0105, you will get the e-mail id.

with the help of this pernr, do a select on pa0006 to get the details like address and phone number.

select (fields required)

from pa0006

into table itab

where pernr = l_pernr

and subty = '1'

and endda = '99991231'.

Regards

Navneet