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!
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' exporting username = lv_sap_user tables return = lt_return addsmtp = lt_smtp. read table lt_smtp into ls_smtp index 1. write:/ ls_smtp-e_mail.