MM Program Custom development Background program

Automatic Vendor Reminder Email for Overdue Purchase Orders

Short answer: 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.

Estimated effort
M · 3–5 working days
System
ECC and S/4HANA
Tables
6
Scope
Global
Built by
NeKuDos Teknoloji
Last updated

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.

Who uses it? Buyers and purchasing managers; indirectly the vendors.

Closest standard alternatives

  • ME9F Message Output: Purchase Orders. Sends order messages (including reminders) per order according to the output setup; does not create one summary email per vendor.
  • ME2N Purchasing Documents per Document Number. Lists open orders; does not send anything to vendors automatically.

Tables used

The tables the program reads and updates. ECC and S/4HANA differences are marked separately.

TableRoleAccessSystem
EKKOPurchasing Document HeaderVendor, purchasing organization and groupReadECC + S/4
EKPOPurchasing Document ItemOpen items: material, short text, unitReadECC + S/4
EKETPurchasing Schedule LinesDelivery date and open quantityReadECC + S/4
LFA1Vendor Master (General Section)Vendor name, address number and correspondence languageReadECC + S/4
ADR6E-Mail Addresses (Business Address Services)Vendor email addressReadECC + S/4
T024Purchasing GroupsPurchasing group email address (copy recipient)ReadECC + S/4

BAPIs and functions used

  • SO_NEW_DOCUMENT_ATT_SEND_API1SAPoffice: Send New Document with Attachments. Sends the email with HTML body and Excel attachment to the vendor

Selection screen parameters

ParameterDescriptionTypeReference fieldRequiredExample
S_EKORGPurchasing organizationRange / multipleEKKO-EKORGYes1000
S_EKGRPPurchasing groupRange / multipleEKKO-EKGRPNo001
S_LIFNRVendor (including exclusions)Range / multipleEKKO-LIFNRNo100245
S_WERKSPlantRange / multipleEKPO-WERKSNo1000
P_DAYSTolerance (days)Single value—No2
P_CCBUYCopy the purchasing groupCheckbox—NoX
P_TESTTest mode (do not send email)Checkbox—No—
P_KEYDTKey date (default: today)Single valueSY-DATUMYes17.11.2026

Result list columns

#ColumnSource
1VendorLFA1-LIFNR
2Vendor nameLFA1-NAME1
3EmailADR6-SMTP_ADDR
4Overdue linesCalculated Number of overdue schedule lines of the vendor
5Total open valueCalculated Σ (EKET-MENGE − EKET-WEMNG) × EKPO-NETPR ÷ EKPO-PEINH
6Max days lateCalculated Key date − oldest EKET-EINDT
7StatusCalculated Sent, no email address, excluded or test
8MessageCalculated Return message of the send function

Sample result list

VendorVendor nameEmailOverdue linesTotal open valueMax days lateStatusMessage
100245Atlas Ambalaj[email protected]354,70027SentEmail queued for sending
100387Delta Metal[email protected]148,9609SentEmail queued for sending
100512Ege Kimya225,56045No email addressNo default email address in the vendor master
A view built with fictional sample data; not real system data.

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.

Performance notes

The selection is the same as an open order report and runs at night or early morning. Because one email is sent per vendor, the volume is low. SMTP must be set up through SAPconnect (SCOT) for sending.

Features

  • Runs as a background job Runs every morning as a scheduled job.
  • Send the result by email
  • Test mode (check without posting)
  • Line-by-line result and error log

Authorization objects

  • M_BEST_EKOPurchase order display authorization by purchasing organization
  • M_BEST_EKGPurchase 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.

Related reports

MM Report Custom ALV report

Open Purchase Orders by Vendor Report

A custom ALV report that shows, per vendor, the quantity not yet received, the open order value and the days of delay since the delivery date in a …

EKKO · EKPO · EKET · LFA1

Let us build this program for your system

Briefly describe your system and expectations. We will clarify the scope and come back with an effort and price quote.

Related report: Automatic Vendor Reminder Email for Overdue Purchase Orders