User name => E-mail address

Development (ABAP Development WorkBench, ABAP/4 programming)

Moderators: Snowy, thx4allthefish, YuriT, Gothmog

Post Reply
Coke Light

User name => E-mail address

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


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!



Post by Guest » Fri Jul 02, 2004 5:26 am

Is it ADR06 or ADR6... If its ADR6 there is a link between it and USR21 based on Address number and Person number


Posts: 488
Joined: Fri Jan 23, 2004 10:39 am

Re: User name => E-mail address

Post by sapmanie » Tue Dec 20, 2016 11:20 am

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.

Post Reply