FI Program Custom development Background program

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

  • FBL5N Customer Line Items. Shows due date and delay per item; no average due date or adat calculation.
  • FD10N Customer Balance Display. Shows the customer balance by period; no due date weighting.

Tables used

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

TableRoleAccessSystem
BSIDCustomer Open ItemsCustomer open items: amount, baseline date and payment termsReadECC + S/4
BSADCustomer Cleared ItemsItems cleared in the period and their clearing dateReadECC + S/4
KNA1Customer Master (General Section)Customer name and address (for the statement)ReadECC + S/4
KNB1Customer Master (Company Code)Company code customer data: reconciliation account and interest indicatorReadECC + S/4
T052Terms of PaymentPayment term days: net due date calculationReadECC + S/4
BKPFAccounting Document HeaderLate payment interest invoice document createdWriteECC + 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

ParameterDescriptionTypeReference fieldRequiredExample
P_BUKRSCompany codeSingle valueBSID-BUKRSYes1000
S_KUNNRCustomerRange / multipleBSID-KUNNRNo300000-399999
P_KEYDTCalculation dateSingle value—Yes30.11.2026
S_AUGDTClearing date rangeRange / multipleBSAD-AUGDTNo01.11.2026-30.11.2026
P_RATEAnnual interest rate (%) (if no customer setting)Single value—NoSözleşmeye göre
P_MINMinimum interest amount to invoiceSingle value—No100
P_POSTCreate interest invoice documentCheckbox—No—

Result list columns

#ColumnSource
1CustomerBSID-KUNNR
2NameKNA1-NAME1
3Total amountCalculated Total amount of the items included
4Average due dateCalculated Σ(amount × due day) / Σ amount
5Average days overdueCalculated Σ adat / Σ amount
6AdatCalculated Σ(amount × days overdue)
7Annual rate (%)Calculated Customer setting or the rate on the selection screen
8Interest amountCalculated Adat × rate / (100 × 365)
9Invoice documentBKPF-BELNR
10StatusCalculated Calculated, below minimum, invoiced or error

Sample result list

CustomerNameTotal amountAverage due dateAverage days overdueAdatAnnual rate (%)Interest amountInvoice documentStatus
300145Örnek Tekstil A.Ş.1,840,00010/21/20262444,160,0003643,555.071800001204Invoiced
300218Demo Retail Ltd.412,50011/12/202693,712,500363,661.64Calculated
300377Mavi Ev Ürünleri Ltd.26,80011/25/2026253,6003652.87Below minimum
A view built with fictional sample data; not real system data.

How does the program work?

  1. 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).
  2. Average due date = Σ(amount × due date as day number) / Σ amount; debit and credit items can be shown separately and net.
  3. 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.
  4. 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.
  5. 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.
  6. 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

FI Report Custom ALV report

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 …

BSAD · BKPF · BSID · KNA1

FI Report Custom ALV report

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. …

BSID · BSAD · KNA1 · KNB1

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: Average Due Date and Late Payment Interest (Adat) Calculation Program