‎2008 Nov 26 7:11 AM
Hello Experts,
In which table I will get both user id & Country to which he/she belongs.
Regards,
Sangeeta
‎2008 Nov 26 8:03 AM
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.
‎2008 Nov 26 8:39 AM
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.
‎2008 Nov 26 10:49 AM
‎2008 Nov 26 11:01 AM
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
‎2008 Nov 27 9:45 AM
person ID can be found in infotype 0709.
table p0709,
structure pa709
‎2008 Dec 02 1:29 PM
‎2008 Dec 03 10:52 AM
Hi sangeeta,
In user03 you have the user id and country.
User ID: Bname.
Coutry:land1.
Thanks,
Swapna.
‎2008 Dec 03 12:51 PM
Hi Sangeeta
Userid you can get from PA0105 and Country from PA0006.
‎2008 Dec 05 10:55 AM
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
‎2008 Dec 08 2:14 PM
‎2008 Dec 05 4:56 PM
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.
‎2008 Dec 08 8:06 AM
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.