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

HR table

Former Member
0 Likes
1,902

Hello Experts,

In which table I will get both user id & Country to which he/she belongs.

Regards,

Sangeeta

12 REPLIES 12
Read only

Former Member
0 Likes
1,557

hi,

you can refer the tables:

Table USR01 - User master record (runtime data)

field BNAME - User Name in User Master Record

Table USR02- Logon Data (Kernel-Side Use)

Table USR03-User address data

Field LAND1 -Country Key

Table USR04 - User master authorizations

Table USR05 - User Master Parameter ID

Table USR06- Additional Data per User

all the above table will give you the details regarding user.

let me know if you have further concern.

Read only

Former Member
0 Likes
1,557

Hi Sangeeta,

you can use the following code:

Try to use the BAPI BAPI_USER_GET_DETAIL

Anyway the address data should be in ADRC table, you can find the ID address in USR21 table:

So:

DATA T_ID_ADDRESS LIKE STANDARD TABLE OF USR21 WITH HEADER LINE.

DATA: T_ADRC LIKE STANDARD TABLE OF ADRC.

SELECT * FROM USER21 INTO TABLE T_ID_ADDRESS.

IF SY-SUBRC = 0.

SELECT * FROM ADRC INTO TABLE T_ADRC

FOR ALL ENTRIES IN T_ID_ADDRESS

WHERE ADDRNUMBER = T_ID_ADDRESS-ADDRNUMBER

AND COUNTRY = <LAND>.

LOOP AT T_ID_ADDRESS.

READ TABLE T_ADRC TRANSPORTING NO FIELDS

WITH KEY ADDRNUMBER = T_ID_ADDRESS-ADDRNUMBER.

IF SY-SUBRC 0.

DELETE T_ID_ADDRESS.

ELSE.

WRITE: / T_ID_ADDRESS-BNAME.

ENDIF.

ENDLOOP.

ENDLOOP.

ENDIF.

Max

hope this will help to get the user id and country name.

Read only

Former Member
0 Likes
1,557

Hi Sangeeta,

Use the table USR03.

With luck,

Pritam.

Read only

0 Likes
1,557

Hi,

I don't find all SAP user id's in the table USR03.

Can you tell me what could be the reason?

Regards,

Sangeeta

Read only

Former Member
0 Likes
1,557

person ID can be found in infotype 0709.

table p0709,

structure pa709

Read only

Former Member
0 Likes
1,557

PA0102- FOR USED ID

PA0006 FOR COUNTRY

Read only

0 Likes
1,557

Hi sangeeta,

In user03 you have the user id and country.

User ID: Bname.

Coutry:land1.

Thanks,

Swapna.

Read only

Former Member
0 Likes
1,557

Hi Sangeeta

Userid you can get from PA0105 and Country from PA0006.

Read only

Former Member
0 Likes
1,557

For User ID see table PA0105 and use SUBTY = 0001.

For Country see table PA0002.

Both the things are not present in same Table in HR

Read only

0 Likes
1,557

Hello,

As said by Amit.

Thanks,

Jayant

Read only

Former Member
0 Likes
1,557

The user ID should be in PA0105, subtype 1.

Which country are you looking for? If you want the country of the employee's address, use PA0006, subtype 1 and find land1.

If you want the country where the employee works, use table T500P-LAND1. You can get to that record by joining T500P-PERSA = PA0001-WERKS, being sure to restrict PA0001-BEGDA and PA0001-ENDDA accordingly for the right validity period.

You can join PA0105 to PA0001 by PERNR.

Read only

Former Member
0 Likes
1,557

Hi,

you can get the user related detials from tables. Go to se11 and put user*. you will get all the details.

Also there is BAPI named: BAPI_USER_GET_DETAIL

Thanks.