Published by John on

Calculate Due Date1 e1452811957210

Calculate Due Date in ABAP is main requirement when dealing with invoices and payment of this invoice.

It helps you also to handle dunning by calculating the Due date and current date and set the dunning level.

First let’s define the different Account Type, then we will detail the SAP BAPI to use when retrieving Due Date.

Calculate Due Date

In order to determine the Due Date for an invoice, you can use the standard bapi ‘DETERMINE_DUE_DATE’. As input, it will take i_faede.

The output is e_faede and the duedate field is FAEDE-NETDT.

You way want to check also Step by Step Guide To Create Sap Down Payment with VIM

Prepare Calculate Due Date Structure

Before calculating the DueDate in SAP FI, the following Structure types as FAEDE should be filled.

The structure for Due Date input (FAEDE) is:

SHKZGDebit/Credit Indicator
KOARTAccount Type
ZFBDTBaseline Date for Due Date Calculation
ZBD1TCash discount days 1
ZBD2TCash discount days 2
ZBD3TNet Payment Terms Period
REBZGNumber of the Invoice the Transaction Belongs to
REBZTFollow-On Document Type
BLDATDocument Date in Document
NETDTDueDate for Net Payment
SK1DTDueDate for Cash Discount 1
SK2DTDueDate for Cash Discount 2

For more information about Finance module in SAP, check :

The second step is to set the Account Type. Check the first section for different type of Account in SAP Invoice.

To go deep into ABAP development for SAP FI, check the following book ABAP Development for Financial Accounting: Custom Enhancements.

Account Type in SAP FI

The Account Type in SAP FI defines the type of SAP Account
The field in SAP Table is BSIS-KOART for Acct type in SAP.

In SAP FI, Account Type can have the following possible Values:

  • A : Assets
  • D : Customers
  • K :Vendors
  • M :Material
  • S :G/L accounts

Check also SAP Invoice IDoc INVOIC2


Let’s give a sample ABAP Code with DETERMINE_DUE_DATE function call.

You can set FAEDE input from an entrie from BSIS. The result for the Due Date can found in FAEDE-NETDT.

Other BAPI for Payment Dates Calculation

The following SAP BAPI can help retrieve more data for Payment information of a SAP Account in SAP FI

  • SD_PRINT_TERMS_OF_PAYMENT used to retrieve single payment term
  • SD_PRINT_TERMS_OF_PAYMENT_SPLI can be used to retrieve multiple payment terms at once


This function SD_PRINT_TERMS_OF_PAYMENT_SPLI (Preparation of Terms of Payment According to Table 052) is in the function group VPRI SD Print Functions.

The signature of SD_PRINT_TERMS_OF_PAYMENT_SPLI is :


The standard Function module SD_PRINT_TERMS_OF_PAYMENT is for “Format Terms of Payment According to Table 052”.

Here the signature of this function:


Hi. I have been working as SAP Technical and functional for a decade. Through this blog, I am trying to share with you my experience. Hopefull, it makes your ways easier path ... Sab

You may also like: