Display Sales Invoice Due Date on SAP Smartform Output using NET_DUE_DATE_GET Function Module
On a SAP Smarform document for SAP Sales output, I had to display due date information.
When I checked sample Smartform documents I see that using ABAP function module FI_FIND_PAYMENT_CONDITIONS and NET_DUE_DATE_GET, ABAP developers can get due date information on to the SAP Smartform invoice output easily.
FI_FIND_PAYMENT_CONDITIONS is used to determine cash discount using ZTERM and document, posting, CPU, base date
The required input parameters are terms of payment key, document date, posting date.
Optional parameters are system date, base date, function class from transaction control, etc.
Export parameters of the ABAP function module fi_find_payment_conditions is payment terms work area, calculated base date and cash discount.
As seen in below ABAP debug screenshot during Smartform execution, the ZTAG1 cash discount days returns 15 days.
NET_DUE_DATE_GET ABAP function module calculates the due date based on the relevant sales invoice information.
Possible account types used in SAP are listed below under KOART data type:
KOART Account type
A Assets
D Customers
K Vendors
M Material
S G/L accounts
And the sample NET_DUE_DATE_GET ABAP function module call resulted with the due date variable lv_FAEDT as follows :
lv_FAEDT = 20080801