Page 1 of 1

User name => E-mail address

Posted: Fri Jul 02, 2004 3:25 am
by Coke Light

in USR21, I can find the username, addrnumber and persnumber.
in ADR06, I can find the E-mail address, addrnumber and persnumber.

But the addrnumber and persnumber between the 2 tables do not match.
What is the link between them, or are there other tables to use?

Thanks in advance!


Posted: Fri Jul 02, 2004 5:26 am
by Guest
Is it ADR06 or ADR6... If its ADR6 there is a link between it and USR21 based on Address number and Person number


Re: User name => E-mail address

Posted: Tue Dec 20, 2016 11:20 am
by sapmanie
You can use function BAPI_USER_GET_DETAIL to get the email address from user id.

Code: Select all

data: lv_sap_user               type sy-uname,
         lt_return                   type table of bapiret2,
         lt_smtp                     type table of bapiadsmtp,
         ls_smtp                     type bapiadsmtp.

  lv_sap_user = sy-uname.
  call function 'BAPI_USER_GET_DETAIL'
      username = lv_sap_user
      return   = lt_return
      addsmtp  = lt_smtp.

    read table lt_smtp into ls_smtp index 1.
    write:/ ls_smtp-e_mail.