Application Development 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: 

FM for getting username from email address

0 Kudos

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

1 ACCEPTED SOLUTION

Former Member
0 Kudos

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)

8 REPLIES 8

sridhar_k1
Active Contributor
0 Kudos

Try RMPS_FORM_DATA_USER

REgards

Sridhar

0 Kudos

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

Former Member
0 Kudos

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

Former Member
0 Kudos

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

Former Member
0 Kudos

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

Former Member
0 Kudos

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)

0 Kudos

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

0 Kudos
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.