# Automatic Vendor Reminder Email for Overdue Purchase Orders

> A custom program that runs every morning in the background, collects overdue open purchase order lines per vendor and sends each vendor one email with its own overdue lines and days late. The purchasing group receives the email in copy; vendors that could not be emailed are listed in the log.

- Type: Program, Custom development, Background program
- Module: MM
- Estimated effort: M (3–5 working days)
- Last updated: 2026-11-17
- URL: https://nekuhub.com/en/programs/automatic-vendor-reminder-email-overdue-purchase-orders/


## Why is the standard not enough?

ME9F (and ME91F) produce reminder messages per order according to the reminder levels in the output setup. They do not combine all overdue lines of a vendor with days late into one email, and they do not work at all in companies without order output setup. Buyers write these reminders by hand from an Excel list every week.

### Closest standard alternatives

- ME9F: Sends order messages (including reminders) per order according to the output setup; does not create one summary email per vendor.
- ME2N: Lists open orders; does not send anything to vendors automatically.

## Tables used

| Table | Role | Access | Join | System |
|---|---|---|---|---|
| EKKO | Vendor, purchasing organization and group | Read | - | ECC + S/4 |
| EKPO | Open items: material, short text, unit | Read | EKPO-EBELN = EKKO-EBELN | ECC + S/4 |
| EKET | Delivery date and open quantity | Read | EKET-EBELN = EKPO-EBELN AND EKET-EBELP = EKPO-EBELP | ECC + S/4 |
| LFA1 | Vendor name, address number and correspondence language | Read | LFA1-LIFNR = EKKO-LIFNR | ECC + S/4 |
| ADR6 | Vendor email address | Read | ADR6-ADDRNUMBER = LFA1-ADRNR | ECC + S/4 |
| T024 | Purchasing group email address (copy recipient) | Read | T024-EKGRP = EKKO-EKGRP | ECC + S/4 |

## BAPIs and functions used

- SO_NEW_DOCUMENT_ATT_SEND_API1: Sends the email with HTML body and Excel attachment to the vendor

## Selection screen parameters

| Parameter | Description | Type | Reference field | Required |
|---|---|---|---|---|
| S_EKORG | Purchasing organization | Range / multiple | EKKO-EKORG | Yes |
| S_EKGRP | Purchasing group | Range / multiple | EKKO-EKGRP | No |
| S_LIFNR | Vendor (including exclusions) | Range / multiple | EKKO-LIFNR | No |
| S_WERKS | Plant | Range / multiple | EKPO-WERKS | No |
| P_DAYS | Tolerance (days) | Single value | - | No |
| P_CCBUY | Copy the purchasing group | Checkbox | - | No |
| P_TEST | Test mode (do not send email) | Checkbox | - | No |
| P_KEYDT | Key date (default: today) | Single value | SY-DATUM | Yes |

## Result list columns

| Column | Source |
|---|---|
| Vendor | LFA1-LIFNR |
| Vendor name | LFA1-NAME1 |
| Email | ADR6-SMTP_ADDR |
| Overdue lines | Calculated: Number of overdue schedule lines of the vendor |
| Total open value | Calculated: Σ (EKET-MENGE − EKET-WEMNG) × EKPO-NETPR ÷ EKPO-PEINH |
| Max days late | Calculated: Key date − oldest EKET-EINDT |
| Status | Calculated: Sent, no email address, excluded or test |
| Message | Calculated: Return message of the send function |

## How does the program work?

1. The job is scheduled every morning. Lines that are not deleted, not delivery completed, whose delivery date (EINDT) is before the key date minus the tolerance days and whose open quantity (MENGE − WEMNG) is above zero are read from EKKO/EKPO/EKET.
2. Lines are grouped by vendor. The vendor's email address is taken from ADR6 (default address) through LFA1-ADRNR; the correspondence language is LFA1-SPRAS.
3. For each vendor an HTML table body in its language (TR or EN) and an Excel attachment with the same lines are prepared: order, item, material, open quantity, delivery date, days late.
4. The email is sent with SO_NEW_DOCUMENT_ATT_SEND_API1; the purchasing group's T024-SMTP_ADDR address is added as a copy recipient. Sending can be tracked in SOST.
5. The log records the result per vendor: sent, no email address or excluded. In test mode no email is sent; only the list is produced.

## Authorization objects

- M_BEST_EKO: Purchase order display authorization by purchasing organization
- M_BEST_EKG: Purchase order display authorization by purchasing group

## Frequently asked questions

### How are lines with vendor confirmations handled?

The base version uses the EKET delivery date. If vendor confirmations (EKES) are used, the rule can be extended to use the confirmed date.

### Can specific vendors be excluded?

Yes. Exclusions can be used in the vendor selection, or a parameter table of excluded vendors is defined during installation.

### Can this program be used on S/4HANA?

Yes. The tables read are the same. In S/4HANA the vendor email comes from the business partner address and is read the same way through LFA1-ADRNR.

---
Let us build this program for your system: https://nekuhub.com/en/request-a-quote/?report=mm-overdue-po-vendor-reminder-email
