Average Due Date and Late Payment Interest (Adat) Calculation Program
Short answer: A custom program that calculates the amount-weighted average due date, days overdue and the adat total (amount × days) from open and cleared items on customer accounts, works out late payment interest at the contractual annual rate, and creates the interest invoice as an accounting document for the amounts approved.
- Estimated effort
- M · 7–10 working days
- System
- ECC and S/4HANA
- Tables
- 6
- Scope
- Global
- Built by
- NeKuDos Teknoloji
- Last updated
Why is the standard not enough?
FBL5N shows the due date and days overdue per item, but it does not calculate the amount-weighted average due date of the account or the adat total. The standard item interest calculation (FINT) needs an interest indicator and separate configuration, and it does not give an account-level adat statement that covers partial payments and items cleared in the period. So average due date and late payment interest are usually worked out in a spreadsheet and invoiced by hand.
Who uses it? Accounts receivable and collections teams, sales operations and finance teams who invoice late payment interest.
Closest standard alternatives
Tables used
The tables the program reads and updates. ECC and S/4HANA differences are marked separately.
| Table | Role | Access | System |
|---|---|---|---|
| BSIDCustomer Open Items | Customer open items: amount, baseline date and payment terms | Read | ECC + S/4 |
| BSADCustomer Cleared Items | Items cleared in the period and their clearing date | Read | ECC + S/4 |
| KNA1Customer Master (General Section) | Customer name and address (for the statement) | Read | ECC + S/4 |
| KNB1Customer Master (Company Code) | Company code customer data: reconciliation account and interest indicator | Read | ECC + S/4 |
| T052Terms of Payment | Payment term days: net due date calculation | Read | ECC + S/4 |
| BKPFAccounting Document Header | Late payment interest invoice document created | Write | ECC + S/4 |
S/4HANA notes
- BSID → I_OperationalAcctgDocItem: In S/4HANA BSID is no longer filled as a separate index table; reads work through a compatibility view of the same name. For new developments the I_OperationalAcctgDocItem CDS view is recommended.
- BSAD → I_OperationalAcctgDocItem: In S/4HANA BSAD is not filled as a separate table; it is read through a compatibility view of the same name. For new developments the I_OperationalAcctgDocItem CDS view is recommended.
BAPIs and functions used
- BAPI_ACC_DOCUMENT_POSTAccounting: Post Document. Posts the interest invoice as an accounting document
- BAPI_TRANSACTION_COMMITCommit a BAPI transaction. Commits after each customer document
- CALCULATE_TAX_FROM_NET_AMOUNTCalculate Tax from Net Amount. Calculates the tax on the interest amount
Selection screen parameters
| Parameter | Description | Type | Reference field | Required | Example |
|---|---|---|---|---|---|
| P_BUKRS | Company code | Single value | BSID-BUKRS | Yes | 1000 |
| S_KUNNR | Customer | Range / multiple | BSID-KUNNR | No | 300000-399999 |
| P_KEYDT | Calculation date | Single value | — | Yes | 30.11.2026 |
| S_AUGDT | Clearing date range | Range / multiple | BSAD-AUGDT | No | 01.11.2026-30.11.2026 |
| P_RATE | Annual interest rate (%) (if no customer setting) | Single value | — | No | Sözleşmeye göre |
| P_MIN | Minimum interest amount to invoice | Single value | — | No | 100 |
| P_POST | Create interest invoice document | Checkbox | — | No | — |
Result list columns
| # | Column | Source |
|---|---|---|
| 1 | Customer | BSID-KUNNR |
| 2 | Name | KNA1-NAME1 |
| 3 | Total amount | Calculated Total amount of the items included |
| 4 | Average due date | Calculated Σ(amount × due day) / Σ amount |
| 5 | Average days overdue | Calculated Σ adat / Σ amount |
| 6 | Adat | Calculated Σ(amount × days overdue) |
| 7 | Annual rate (%) | Calculated Customer setting or the rate on the selection screen |
| 8 | Interest amount | Calculated Adat × rate / (100 × 365) |
| 9 | Invoice document | BKPF-BELNR |
| 10 | Status | Calculated Calculated, below minimum, invoiced or error |
Sample result list
| Customer | Name | Total amount | Average due date | Average days overdue | Adat | Annual rate (%) | Interest amount | Invoice document | Status |
|---|---|---|---|---|---|---|---|---|---|
| 300145 | Örnek Tekstil A.Ş. | 1,840,000 | 10/21/2026 | 24 | 44,160,000 | 36 | 43,555.07 | 1800001204 | Invoiced |
| 300218 | Demo Retail Ltd. | 412,500 | 11/12/2026 | 9 | 3,712,500 | 36 | 3,661.64 | Calculated | |
| 300377 | Mavi Ev Ürünleri Ltd. | 26,800 | 11/25/2026 | 2 | 53,600 | 36 | 52.87 | Below minimum |
How does the program work?
- For the selected customers, open items are read from BSID and items cleared in the period from BSAD; the net due date is calculated from the baseline date and payment terms (T052).
- Average due date = Σ(amount × due date as day number) / Σ amount; debit and credit items can be shown separately and net.
- Days overdue are found for each item: key date − due date for open items, clearing date − due date for cleared items. Adat = amount × days overdue; for partial payments the remaining amount is calculated as its own slice.
- Interest = Σ adat × annual rate / (100 × 365); the rate comes from the selection screen or a customer-level settings table. Interest below the minimum amount is listed but not invoiced.
- Once the list is approved, a document is created with BAPI_ACC_DOCUMENT_POST that debits the customer and credits late payment interest income; the tax code comes from the settings table and the tax amount is calculated.
- An adat statement with the item breakdown can be sent to the customer as a PDF.
Performance notes
The BSAD read is limited by clearing date range. With many customers the program runs in the background and the result list is saved for approval.
Features
- ALV list (sort, filter, subtotals)
- Test mode (check without posting)
- Double-click drill-down to the document A row drills down to the item-level adat breakdown.
- Send the result by email The adat statement can be sent to the customer as a PDF.
- Runs as a background job
Authorization objects
- F_KNA1_BUKAuthorization to display customer accounts in the company code
- F_BKPF_BUKPosting authorization for the interest invoice
Frequently asked questions
Can it be calculated for vendor accounts too?
Yes. The same calculation can be applied to vendor accounts through BSIK and BSAK; on the vendor side the result is listed for information or used to check incoming interest invoices.
How do credit items (returns, down payments) affect the average?
Depending on the selection, credit items are either left out of the average or included as negative amounts. With the net method a customer's early payments offset its delays; the method is chosen according to the customer contract.
How is tax determined on the interest invoice?
The interest income account and tax code are defined per company code in the settings table. The tax amount is calculated with that tax code when the document is created; the tax treatment is checked against current regulation at installation.
Related reports
Customer Payment Behavior and Days-to-Pay Report
A custom ALV report that uses customer invoices cleared in the selected period to calculate each customer's average days to pay, amount-weighted days …
Customer Receivables Aging Report
A custom ALV report that ages customer open items by net due date and shows down payments received and other special G/L items in the same list. …
Customer Account Statement and Balance Confirmation Email Program
A custom program that prepares a customer account statement as PDF, with opening balance, period movements, open items and closing balance, and sends …
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.