05-03-2006 11:29 AM
Hi,
Is there any way by which you can get the user id from the country code?
I tried in SU01 but was unsuccessful.
Please provide a method by which I could get the user id for a specific country code?
Regards,
Gayathri
05-03-2006 11:36 AM
05-03-2006 11:37 AM
Hi
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
05-03-2006 11:39 AM
05-03-2006 11:42 AM
One country can have multiple user id's, how can you choose only one user id.
regards,
Ravi