SAP FM_ADJUST_NET_DAYS_FI Function Module for Set baseline date in FI invoices
FM_ADJUST_NET_DAYS_FI is a standard fm adjust net days fi SAP function module available within SAP R/3 or S/4 Hana systems, depending on your version and release level. It is used for Set baseline date in FI invoices processing and below is the pattern details for this FM, showing its interface including any import and export parameters, exceptions etc. there is also a full "cut and paste" ABAP pattern code example, along with implementation ABAP coding, documentation and contribution comments specific to this or related objects.
See here to view full function module documentation and code listing for fm adjust net days fi FM, simply by entering the name FM_ADJUST_NET_DAYS_FI into the relevant SAP transaction such as SE37 or SE38.
Function Group: FMPY_E
Program Name: SAPLFMPY_E
Main Program: SAPLFMPY_E
Appliation area:
Release date: N/A
Mode(Normal, Remote etc): Normal Function Module
Update:

Function FM_ADJUST_NET_DAYS_FI pattern details
In-order to call this FM within your sap programs, simply using the below ABAP pattern details to trigger the function call...or see the full ABAP code listing at the end of this article. You can simply cut and paste this code into your ABAP progrom as it is, including variable declarations.CALL FUNCTION 'FM_ADJUST_NET_DAYS_FI'"Set baseline date in FI invoices.
EXPORTING
I_ZFBDT = "Baseline date for due date calculation
* I_GJAHR = "Fiscal Year
* I_AWTYP = "Reference Transaction
* I_PPA_EX_IND = "PPA Exclude Indicator
* I_OLD_ZTERM = "Terms of Payment Key
I_BLDAT = "Document date in document
* I_REINDAT = "Invoice receipt date
I_ZTERM = "Terms of payment key
* I_ZTAGG = "Day Limit
* I_LIFNR = "Account number of vendor or creditor
* I_BUKRS = "Company code
* I_ZLSCH = "Payment method
* I_BELNR = "Accounting Document Number
CHANGING
* C_ZBD1T = "Net Payment Terms Period
* C_ZBD2T = "Days from Baseline Date for Payment
* C_ZBD3T = "Days from Baseline Date for Payment
* C_ZBD1P = "Cash Discount Percentage Rate
* C_ZBD2P = "Cash Discount Percentage Rate
Customer Function user exits
Below is a list of CUSTOMER FUNCTION exit user exits that are available within this program and maybe relevant for this FM.EXIT_SAPLFMPY_E_001 Message type for PPA, if correct payment term in po is not used
EXIT_SAPLFMPY_E_002 Configurable message for payment terms in FI
IMPORTING Parameters details for FM_ADJUST_NET_DAYS_FI
I_ZFBDT - Baseline date for due date calculation
Data type: BSEG-ZFBDTOptional: No
Call by Reference: No ( called with pass by value option)
I_GJAHR - Fiscal Year
Data type: BKPF-GJAHROptional: Yes
Call by Reference: No ( called with pass by value option)
I_AWTYP - Reference Transaction
Data type: BKPF-AWTYPOptional: Yes
Call by Reference: No ( called with pass by value option)
I_PPA_EX_IND - PPA Exclude Indicator
Data type: BSEG-PPA_EX_INDOptional: Yes
Call by Reference: No ( called with pass by value option)
I_OLD_ZTERM - Terms of Payment Key
Data type: BSEG-ZTERMOptional: Yes
Call by Reference: No ( called with pass by value option)
I_BLDAT - Document date in document
Data type: BKPF-BLDATOptional: No
Call by Reference: No ( called with pass by value option)
I_REINDAT - Invoice receipt date
Data type: BKPF-REINDATOptional: Yes
Call by Reference: No ( called with pass by value option)
I_ZTERM - Terms of payment key
Data type: BSEG-ZTERMOptional: No
Call by Reference: No ( called with pass by value option)
I_ZTAGG - Day Limit
Data type: T052-ZTAGGOptional: Yes
Call by Reference: No ( called with pass by value option)
I_LIFNR - Account number of vendor or creditor
Data type: BSEG-LIFNROptional: Yes
Call by Reference: No ( called with pass by value option)
I_BUKRS - Company code
Data type: BSEG-BUKRSOptional: Yes
Call by Reference: No ( called with pass by value option)
I_ZLSCH - Payment method
Data type: T052-ZLSCHOptional: Yes
Call by Reference: No ( called with pass by value option)
I_BELNR - Accounting Document Number
Data type: BKPF-BELNROptional: Yes
Call by Reference: No ( called with pass by value option)
CHANGING Parameters details for FM_ADJUST_NET_DAYS_FI
C_ZBD1T - Net Payment Terms Period
Data type: T052-ZTAG1Optional: Yes
Call by Reference: No ( called with pass by value option)
C_ZBD2T - Days from Baseline Date for Payment
Data type: T052-ZTAG2Optional: Yes
Call by Reference: No ( called with pass by value option)
C_ZBD3T - Days from Baseline Date for Payment
Data type: T052-ZTAG3Optional: Yes
Call by Reference: No ( called with pass by value option)
C_ZBD1P - Cash Discount Percentage Rate
Data type: T052-ZPRZ1Optional: Yes
Call by Reference: Yes
C_ZBD2P - Cash Discount Percentage Rate
Data type: T052-ZPRZ2Optional: Yes
Call by Reference: Yes
Copy and paste ABAP code example for FM_ADJUST_NET_DAYS_FI Function Module
The ABAP code below is a full code listing to execute function module POPUP_TO_CONFIRM including all data declarations. The code uses the original data declarations rather than the latest in-line data DECLARATION SYNTAX but I have included an ABAP code snippet at the end to show how declarations would look using the newer method of declaring data variables on the fly. This will allow you to compare and fully understand the new inline method. Please note some of the newer syntax such as the @DATA is not available until a later 4.70 service pack (SP8), which i why i have stuck to the origianl for this example.| DATA: | ||||
| lv_c_zbd1t | TYPE T052-ZTAG1, " | |||
| lv_i_zfbdt | TYPE BSEG-ZFBDT, " | |||
| lv_i_gjahr | TYPE BKPF-GJAHR, " | |||
| lv_i_awtyp | TYPE BKPF-AWTYP, " | |||
| lv_i_ppa_ex_ind | TYPE BSEG-PPA_EX_IND, " | |||
| lv_i_old_zterm | TYPE BSEG-ZTERM, " | |||
| lv_c_zbd2t | TYPE T052-ZTAG2, " | |||
| lv_i_bldat | TYPE BKPF-BLDAT, " | |||
| lv_c_zbd3t | TYPE T052-ZTAG3, " | |||
| lv_i_reindat | TYPE BKPF-REINDAT, " | |||
| lv_c_zbd1p | TYPE T052-ZPRZ1, " | |||
| lv_i_zterm | TYPE BSEG-ZTERM, " | |||
| lv_c_zbd2p | TYPE T052-ZPRZ2, " | |||
| lv_i_ztagg | TYPE T052-ZTAGG, " | |||
| lv_i_lifnr | TYPE BSEG-LIFNR, " | |||
| lv_i_bukrs | TYPE BSEG-BUKRS, " | |||
| lv_i_zlsch | TYPE T052-ZLSCH, " | |||
| lv_i_belnr | TYPE BKPF-BELNR. " |
|   CALL FUNCTION 'FM_ADJUST_NET_DAYS_FI' "Set baseline date in FI invoices |
| EXPORTING | ||
| I_ZFBDT | = lv_i_zfbdt | |
| I_GJAHR | = lv_i_gjahr | |
| I_AWTYP | = lv_i_awtyp | |
| I_PPA_EX_IND | = lv_i_ppa_ex_ind | |
| I_OLD_ZTERM | = lv_i_old_zterm | |
| I_BLDAT | = lv_i_bldat | |
| I_REINDAT | = lv_i_reindat | |
| I_ZTERM | = lv_i_zterm | |
| I_ZTAGG | = lv_i_ztagg | |
| I_LIFNR | = lv_i_lifnr | |
| I_BUKRS | = lv_i_bukrs | |
| I_ZLSCH | = lv_i_zlsch | |
| I_BELNR | = lv_i_belnr | |
| CHANGING | ||
| C_ZBD1T | = lv_c_zbd1t | |
| C_ZBD2T | = lv_c_zbd2t | |
| C_ZBD3T | = lv_c_zbd3t | |
| C_ZBD1P | = lv_c_zbd1p | |
| C_ZBD2P | = lv_c_zbd2p | |
| . " FM_ADJUST_NET_DAYS_FI | ||
ABAP code using 7.40 inline data declarations to call FM FM_ADJUST_NET_DAYS_FI
The below ABAP code uses the newer in-line data declarations. This allows you to see the coding differences/benefits of the later inline syntax. Please note some of the newer syntax below, such as the @DATA is not available until 4.70 EHP 8.| "SELECT single ZTAG1 FROM T052 INTO @DATA(ld_c_zbd1t). | ||||
| "SELECT single ZFBDT FROM BSEG INTO @DATA(ld_i_zfbdt). | ||||
| "SELECT single GJAHR FROM BKPF INTO @DATA(ld_i_gjahr). | ||||
| "SELECT single AWTYP FROM BKPF INTO @DATA(ld_i_awtyp). | ||||
| "SELECT single PPA_EX_IND FROM BSEG INTO @DATA(ld_i_ppa_ex_ind). | ||||
| "SELECT single ZTERM FROM BSEG INTO @DATA(ld_i_old_zterm). | ||||
| "SELECT single ZTAG2 FROM T052 INTO @DATA(ld_c_zbd2t). | ||||
| "SELECT single BLDAT FROM BKPF INTO @DATA(ld_i_bldat). | ||||
| "SELECT single ZTAG3 FROM T052 INTO @DATA(ld_c_zbd3t). | ||||
| "SELECT single REINDAT FROM BKPF INTO @DATA(ld_i_reindat). | ||||
| "SELECT single ZPRZ1 FROM T052 INTO @DATA(ld_c_zbd1p). | ||||
| "SELECT single ZTERM FROM BSEG INTO @DATA(ld_i_zterm). | ||||
| "SELECT single ZPRZ2 FROM T052 INTO @DATA(ld_c_zbd2p). | ||||
| "SELECT single ZTAGG FROM T052 INTO @DATA(ld_i_ztagg). | ||||
| "SELECT single LIFNR FROM BSEG INTO @DATA(ld_i_lifnr). | ||||
| "SELECT single BUKRS FROM BSEG INTO @DATA(ld_i_bukrs). | ||||
| "SELECT single ZLSCH FROM T052 INTO @DATA(ld_i_zlsch). | ||||
| "SELECT single BELNR FROM BKPF INTO @DATA(ld_i_belnr). | ||||
Search for further information about these or an SAP related objects