Reading SAP e-mail addresses

SAP Email Addresses Accounts Receivable – Short process instead of long search.

You can use this ABAP code to access tables KNA1 and ADR6 in a targeted manner. The program reads the e-mail addresses of your customers and prepares them together with the customer number and name for output. This gives you an ideal basis for your own evaluations – simply store the desired customer number in the coding. Updated 2026 – now including business partners and S/4HANA.

ECC or S/4HANA – where are the email addresses stored?

In short: in both cases in ADR6. This is because ADR6 is one of the Business Address Services. That’s why it’s the same in the classical world and in S/4HANA. Although the way to get there is different, the destination is not.

In ECC, the path first leads via KNA1 (customer) or LFA1 (vendor) to the address number. In S/4HANA, the business partner (BUT000) is also added as an entry. Nevertheless, the old way via KNA1/LFA1 continues. This is because customer-vendor integration (CVI) keeps the classic tables in sync. This means that your existing report remains running.

SAP Email Addresses Customer Database Tables

  • Table KNA1 – Customer base (general part)
  • Table ADR6 – Address Data (Business Address Services)

Important in practice: There can be several e-mails for one address (CONSNUMBER 001, 002 …). That’s why a SELECT SINGLE picks out any, not necessarily the default address. It is better to fetch the standard mail via FLGDEFAULT = ‘X’. Otherwise, there is a risk of the most common stumbling block when reading out.

REPORT z_read_customer_email.

PARAMETERS p_kunnr TYPE kna1-kunnr OBLIGATORY.

DATA lv_adrnr TYPE kna1-adrnr.
DATA lv_email TYPE adr6-smtp_addr.

SELECT SINGLE adrnr INTO lv_adrnr
  FROM kna1 WHERE kunnr = p_kunnr.

IF sy-subrc <> 0.
  WRITE: / 'Kunde nicht gefunden'.
  RETURN.
ENDIF.

" ADR6 kann mehrere E-Mails je Adresse haben -> Standardadresse zuerst
SELECT smtp_addr INTO lv_email UP TO 1 ROWS
  FROM adr6
  WHERE addrnumber = lv_adrnr
  ORDER BY flgdefault DESCENDING consnumber ASCENDING.
ENDSELECT.

IF sy-subrc = 0.
  WRITE: / 'Kunde:', p_kunnr, / 'E-Mail:', lv_email.
ELSE.
  WRITE: / 'Keine E-Mail hinterlegt'.
ENDIF.

Note: If your company uses several sales organizations, you can also extend the ABAP program to include the KNVV (Customer Master Sales Data) via a JOIN . This allows you to make additional selections via the sales organization. In Purchasing, you also determine the affiliation to the purchasing organizations via LFM1.

Contact
Do you have questions about this area?
We are happy to advise you personally
Contact

SAP Mail MailCenter

References MailCenter – Excerpt

Excerpt from the list of MailCenter customers MailCenter .

SAP function module Read e-mail address

BAPI_ADDRESSORG_GETDETAIL

Determine data via BAPI – Alternatively, it is possible to determine the data via a program with the BAPI_ADDRESSORG_GETDETAIL .

For example, pass the following parameters to the function module.

OBJ_TYPE ->KNA1
OBJ_ID -> 0000000002

Further possibilities via function blocks:

UBC_USER_GET_BY_EMAIL – Determine user from EMAIL address

/ISDFPS/FIND_EMAIL_ADDRESS – Returns e-mail address for user ID

BUA_GET_ADDRESS_FROM_EMAIL – Address data of types 1,2,3 for an e-mail address are read

EFG_GEN_GET_USER_EMAIL – Print Workbench: Returns the email address of the user master

SAP E-mail Addresses Supplier

The email addresses of suppliers can be located in different tables depending on the configuration. Therefore, here we show the steps to read the address data of suppliers:

  1. How do I call tables in SAP? Open transaction SE16 (or SE16N) in the SAP Easy Access screen.
  2. Next, enter “LFA1” in the “Table” field and confirm. This opens the table “LFA1”, in which general supplier master data is stored.
  3. After that, find the appropriate supplier records for which you need the email addresses.
  4. Also, make a note of the address number (ADRNR) of the desired supplier.
  5. Finally, open the “ADR6” table and enter the supplier number in the “ADDRNUMBER” field to search for the address data. This means that you will find the desired SAP e-mail address of the supplier in the SMTP_ADDR field.

E-mail Address Supplier Tables

  • LFA1 – Vendor master (general part)
  • ADR6 Address Data (Business Address Services)

Reading SAP e-mail addresses at the business partner (S/4HANA)

In S/4HANA, the business partner (BP) is the leading object. Debtor and vendor are only roles behind it. However, the email is still in ADR6. That’s why you just need a different way to start.

The trunk is initially in the BUT000 (key PARTNER). The addresses are also attached to the BUT020, which refers to an ADDRNUMBER per partner. This means that you will end up in ADR6 as usual with this address number.

The bridge to the classic world is formed by two link tables. This is how CVI_CUST_LINK connects partner and debtor (KUNNR). Likewise, CVI_VEND_LINK partner and vendor (LIFNR) connects. In S/4HANA, contact persons also run via the BP relationship in the BUT050 instead of only via the KNVK.

Link path:

BUT000  (BP-Stamm, PARTNER)
   |__ BUT020  (BP-Adressen: PARTNER -> ADDRNUMBER)
          |__ ADR6  (ADDRNUMBER [+ PERSNUMBER] -> SMTP_ADDR)

BP <-> Debitor:   CVI_CUST_LINK  (PARTNER <-> KUNNR)
BP <-> Kreditor:  CVI_VEND_LINK  (PARTNER <-> LIFNR)
Ansprechpartner:  BP-Beziehung BUT050 -> BUT020 -> ADR6

ECC vs. S/4HANA

Object Classic (ECC) Business Partner (S/4HANA) E‑mail
Customer/Customer KNA1 -> ADRNR BUT000 -> BUT020 (ADDRNUMBER), Link CVI_CUST_LINK ADR6
Vendor/Supplier LFA1 -> ADRNR BUT000 -> BUT020, Link CVI_VEND_LINK ADR6
Contact person KNVK -> PRSNR BP Relationship BUT050 -> BUT020 ADR6 (via PERSNUMBER)
SAP Users USR21 -> ADDRNUMBER/PERSNUMBER unchanged ADR6

SAP user e-mail address

The e-mail addresses of the users are stored in the “USR21” table in the SAP system. Therefore, here we show the steps to read the data of the users:

  1. Open transaction SE16 (or SE16N) in the SAP Easy Access screen.
  2. Then enter “USR21” in the “Table” field and confirm.
  3. This will open the “USR21” table, where the user information is stored.
  4. Then find the corresponding user records in the list for which you need the email addresses. Use the BNAME field (user name in the user master) for the search.
  5. Also, make a note of the “PERSNUMBER” of the desired user. Small help: You can choose between the field name and the field identifier via the Settings -> User Parameters -> Data Browser -> Keyword menu.
  6. Finally, open the “ADR6” table and enter the personnel number in the “PERSNUMBER” field to search for the address data. Thus, in the SMTP_ADDR field, you will find the desired SAP e-mail address of the user.

E-mail Address User Tables

  • USR21 – Mapping Username Address Key
  • ADR6 Address Data (Business Address Services)

By subscribing, you will receive newsletters from munich enterprise software. More at Privacy Policy

SAP contact person E-mail address

In this example, we will first use the KNVK for the contact data and also the ADR6 for the e-mail addresses. We access the appropriate information via the prsnr and smtp_addr fields.

REPORT z_read_customer_contacts.

PARAMETERS p_kunnr TYPE kna1-kunnr OBLIGATORY.

DATA: BEGIN OF ls_out,
        namev     TYPE knvk-namev,
        name1     TYPE knvk-name1,
        smtp_addr TYPE adr6-smtp_addr,
      END OF ls_out.
DATA lt_out LIKE TABLE OF ls_out.

" Ein JOIN statt SELECT im LOOP -> deutlich performanter
SELECT k~namev k~name1 a~smtp_addr
  INTO TABLE lt_out
  FROM knvk AS k
  INNER JOIN adr6 AS a ON a~persnumber = k~prsnr
  WHERE k~kunnr = p_kunnr.

IF lt_out IS INITIAL.
  WRITE: / 'Keine Ansprechpartner mit E-Mail gefunden'.
  RETURN.
ENDIF.

LOOP AT lt_out INTO ls_out.
  WRITE: / ls_out-namev, ls_out-name1, ls_out-smtp_addr.
ENDLOOP.

E-mail address Contact person Tables

  • KNVK – Customer base Contact data
  • ADR6 Address Data (Business Address Services)

You are interested in further contributions or have questions on this topic. You are also welcome to subscribe to our free newsletter . Would you like to learn more about our products, solutions, services and support? Just get in touch with us. We look forward to hearing from you.

Frequently Asked Questions (FAQ)

In which SAP table are e-mail addresses?
In the ADR6 (field SMTP_ADDR).

How is KNA1 related to ADR6?
Via the address number ADRNR from the KNA1.

Where is the e-mail with the business partner?
About BUT000 -> BUT020 -> ADR6.

Does the KNA1 path still work in S/4HANA?
Yes. Thanks to CVI, the classic tables remain filled.

Related: Addresses are in the ADRC, telephone numbers in the ADR2, fax numbers in the ADR3.

Thilo Kiefer

Thilo Kiefer

CEO and Product Manager SAP Add-Ons

For me, real innovation arises where technology serves people and not the other way around.