12-13-2006 3:04 PM
Hi,
Is there a function module which will give me the username (SYUNAME) for a user based on the email id of the user?
Thanks in advance!!
Saurabh
12-13-2006 3:38 PM
Hi
Why dont you write the select
With email Id goto - <b>ADR6</b> get the addressnumber(ADDRNUMBER) and person number (PERSNUMBER).
then goto <b>USR21</b> and give the address number (ADDRNUMBER) and person number (PERSNUMBER) to get the User Name - (BNAME)
12-13-2006 3:18 PM
12-13-2006 3:24 PM
Hi Sridhar,
I am looking for a FM which will give me the USERNAME for a particular user based on his/her email ID and not the other way round.
Thanks & Regards,
Saurabh
12-13-2006 3:24 PM
Chk this BUA_GET_ADDRESS_FROM_EMAIL
it will return 3 tables
from those tables u can get address number , from that u can get SY-UNAME
Message was edited by:
chandrasekhar jagarlamudi
12-13-2006 3:25 PM
Select ADDRNUMBER PERSNUMBER from ADR6 where smtp_addr = <emailid>.
Now, using the values goto either SADR or ADRP and get the relevant details.
or else use BAPI_USER_GETDETAIL to get details..
Message was edited by:
Ramesh Babu Chirumamilla
12-13-2006 3:27 PM
Hi,
function FTR_CORR_CHECK_EMAIL_SAP_USER does precisely the opposite you want. Check the code how it works and you´ll find easily how to do it. You´ll need to read tables ADCP, ADRP, PA0105, PB0105, etc.
Much luck
12-13-2006 3:38 PM
Hi
Why dont you write the select
With email Id goto - <b>ADR6</b> get the addressnumber(ADDRNUMBER) and person number (PERSNUMBER).
then goto <b>USR21</b> and give the address number (ADDRNUMBER) and person number (PERSNUMBER) to get the User Name - (BNAME)
12-13-2006 3:38 PM
Hi All,
None of the FMs or Tables specified in the various replies give me the USERNAME based on the email address. Please check.
Thanks & Regards,
Saurabh
12-13-2006 3:52 PM
try thsi if it works
REPORT YCHATEST LINE-SIZE 350.
DATA : IT_ADDRESS TYPE TABLE OF ADDR2_VAL WITH HEADER LINE,
V_NAME LIKE SY-UNAME.
CALL FUNCTION 'BUA_GET_ADDRESS_FROM_EMAIL'
EXPORTING
IV_EMAIL = 'srinivasreddys@intelligroup.com'
TABLES
ET_PERSONS = IT_ADDRESS.
LOOP AT IT_ADDRESS.
SELECT SINGLE BNAME FROM USR21 INTO V_NAME WHERE PERSNUMBER = IT_ADDRESS-PERSNUMBER AND
ADDRNUMBER = IT_ADDRESS-ADDRNUMBER.
ENDLOOP.
WRITE : V_NAME.