{"audience":"Accounts receivable and collections teams, sales operations and finance teams who invoice late payment interest.","authorization_objects":[{"note":"Authorization to display customer accounts in the company code","object":"F_KNA1_BUK"},{"note":"Posting authorization for the interest invoice","object":"F_BKPF_BUK"}],"components":[],"countries":[],"effort_days_max":10,"effort_days_min":7,"effort_size":"M","faq":[{"a":"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.","q":"Can it be calculated for vendor accounts too?"},{"a":"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.","q":"How do credit items (returns, down payments) affect the average?"},{"a":"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.","q":"How is tax determined on the interest invoice?"}],"features":[{"code":"alv","label":"ALV list (sort, filter, subtotals)","note":""},{"code":"test_run","label":"Test mode (check without posting)","note":""},{"code":"drilldown","label":"Double-click drill-down to the document","note":"A row drills down to the item-level adat breakdown."},{"code":"email","label":"Send the result by email","note":"The adat statement can be sent to the customer as a PDF."},{"code":"background","label":"Runs as a background job","note":""}],"functions":[{"name":"BAPI_ACC_DOCUMENT_POST","role":"Posts the interest invoice as an accounting document"},{"name":"BAPI_TRANSACTION_COMMIT","role":"Commits after each customer document"},{"name":"CALCULATE_TAX_FROM_NET_AMOUNT","role":"Calculates the tax on the interest amount"}],"gap":"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.","id":"fi-average-due-date-interest","industries":[],"input_columns":[],"kind":"program","language":"en","lastmod":"2026-11-17","logic":"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).\n2. Average due date = Σ(amount × due date as day number) / Σ amount; debit and credit items can be shown separately and net.\n3. 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.\n4. 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.\n5. 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.\n6. An adat statement with the item breakdown can be sent to the customer as a PDF.","module":"FI","object_type":"batch_job","output_columns":[{"calculated":false,"formula":"","label":"Customer","source_field":"KUNNR","source_table":"BSID"},{"calculated":false,"formula":"","label":"Name","source_field":"NAME1","source_table":"KNA1"},{"calculated":true,"formula":"Total amount of the items included","label":"Total amount","source_field":null,"source_table":null},{"calculated":true,"formula":"Σ(amount × due day) / Σ amount","label":"Average due date","source_field":null,"source_table":null},{"calculated":true,"formula":"Σ adat / Σ amount","label":"Average days overdue","source_field":null,"source_table":null},{"calculated":true,"formula":"Σ(amount × days overdue)","label":"Adat","source_field":null,"source_table":null},{"calculated":true,"formula":"Customer setting or the rate on the selection screen","label":"Annual rate (%)","source_field":null,"source_table":null},{"calculated":true,"formula":"Adat × rate / (100 × 365)","label":"Interest amount","source_field":null,"source_table":null},{"calculated":false,"formula":"","label":"Invoice document","source_field":"BELNR","source_table":"BKPF"},{"calculated":true,"formula":"Calculated, below minimum, invoiced or error","label":"Status","source_field":null,"source_table":null}],"parameters":[{"example":"1000","kind":"parameter","label":"Company code","name":"P_BUKRS","ref_field":"BSID-BUKRS","required":true},{"example":"300000-399999","kind":"select_option","label":"Customer","name":"S_KUNNR","ref_field":"BSID-KUNNR","required":false},{"example":"30.11.2026","kind":"parameter","label":"Calculation date","name":"P_KEYDT","ref_field":"","required":true},{"example":"01.11.2026-30.11.2026","kind":"select_option","label":"Clearing date range","name":"S_AUGDT","ref_field":"BSAD-AUGDT","required":false},{"example":"Sözleşmeye göre","kind":"parameter","label":"Annual interest rate (%) (if no customer setting)","name":"P_RATE","ref_field":"","required":false},{"example":"100","kind":"parameter","label":"Minimum interest amount to invoice","name":"P_MIN","ref_field":"","required":false},{"example":"","kind":"checkbox","label":"Create interest invoice document","name":"P_POST","ref_field":"","required":false}],"part_of":[],"performance":"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.","process":"O2C","quote_url":"https://nekuhub.com/en/request-a-quote/?report=fi-average-due-date-interest","related":["fi-customer-payment-behavior","fi-customer-receivables-aging","fi-customer-statement-email"],"releases":[],"source":"custom","standard_alternatives":[{"note":"Shows due date and delay per item; no average due date or adat calculation.","tcode":"FBL5N"},{"note":"Shows the customer balance by period; no due date weighting.","tcode":"FD10N"}],"summary":"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.","tables":[{"access":"read","join_on":"","role":"Customer open items: amount, baseline date and payment terms","table":"BSID","variant":"both"},{"access":"read","join_on":"","role":"Items cleared in the period and their clearing date","table":"BSAD","variant":"both"},{"access":"read","join_on":"KNA1-KUNNR = BSID-KUNNR","role":"Customer name and address (for the statement)","table":"KNA1","variant":"both"},{"access":"read","join_on":"KNB1-KUNNR = BSID-KUNNR AND KNB1-BUKRS = BSID-BUKRS","role":"Company code customer data: reconciliation account and interest indicator","table":"KNB1","variant":"both"},{"access":"read","join_on":"","role":"Payment term days: net due date calculation","table":"T052","variant":"both"},{"access":"write","join_on":"","role":"Late payment interest invoice document created","table":"BKPF","variant":"both"}],"title":"Average Due Date and Late Payment Interest (Adat) Calculation Program","url":"https://nekuhub.com/en/programs/average-due-date-and-late-payment-interest-calculation/","vendor_id":"nekudos"}