SAP FM_INV_PAY_DECISION Function Module for Decision on payment of PPA invoices
FM_INV_PAY_DECISION is a standard fm inv pay decision SAP function module available within SAP R/3 or S/4 Hana systems, depending on your version and release level. It is used for Decision on payment of PPA 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 inv pay decision FM, simply by entering the name FM_INV_PAY_DECISION 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_INV_PAY_DECISION 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_INV_PAY_DECISION'"Decision on payment of PPA invoices.
EXPORTING
I_CD_DAYS = "Selected cash discount days
I_DOC_NUMBER = "Accounting document number
I_FISCAL_YEAR = "Fiscal year
* I_TRACE_FLG = "Checkbox
I_LIFNR = "Account number of vendor or creditor
* I_DOC_DATE = "Document Date in Document
* I_PAY_TERMS = "Terms of Payment Key
I_FST_DAYS = "Cash discount days 1
I_SND_DAYS = "Cash discount days 2
I_NET_DAYS = "Net Payment Terms Period
I_CD_PER = "Selected cash discount percentage rate
I_CUR_PMNT_DATE = "Date on which the program is to be run
I_INV_DATE = "Document date in document
I_BASELINE_DATE = "Baseline date for due date calculation
I_COMP_CODE = "Company code
CHANGING
E_TAKE_DISCOUNT = "Checkbox
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_INV_PAY_DECISION
I_CD_DAYS - Selected cash discount days
Data type: REGUP-ZBDXTOptional: No
Call by Reference: No ( called with pass by value option)
I_DOC_NUMBER - Accounting document number
Data type: BKPF-BELNROptional: No
Call by Reference: No ( called with pass by value option)
I_FISCAL_YEAR - Fiscal year
Data type: REGUP-GJAHROptional: No
Call by Reference: No ( called with pass by value option)
I_TRACE_FLG - Checkbox
Data type: FMDY-XFELDOptional: Yes
Call by Reference: No ( called with pass by value option)
I_LIFNR - Account number of vendor or creditor
Data type: LFB1-LIFNROptional: No
Call by Reference: No ( called with pass by value option)
I_DOC_DATE - Document Date in Document
Data type: BKPF-BLDATOptional: Yes
Call by Reference: No ( called with pass by value option)
I_PAY_TERMS - Terms of Payment Key
Data type: REGUP-ZTERMOptional: Yes
Call by Reference: No ( called with pass by value option)
I_FST_DAYS - Cash discount days 1
Data type: REGUP-ZBD1TOptional: No
Call by Reference: No ( called with pass by value option)
I_SND_DAYS - Cash discount days 2
Data type: REGUP-ZBD2TOptional: No
Call by Reference: No ( called with pass by value option)
I_NET_DAYS - Net Payment Terms Period
Data type: BSEG-ZBD3TOptional: No
Call by Reference: No ( called with pass by value option)
I_CD_PER - Selected cash discount percentage rate
Data type: REGUP-ZBDXPOptional: No
Call by Reference: No ( called with pass by value option)
I_CUR_PMNT_DATE - Date on which the program is to be run
Data type: REGUP-LAUFDOptional: No
Call by Reference: No ( called with pass by value option)
I_INV_DATE - Document date in document
Data type: BKPF-BLDATOptional: No
Call by Reference: No ( called with pass by value option)
I_BASELINE_DATE - Baseline date for due date calculation
Data type: BSEG-ZFBDTOptional: No
Call by Reference: No ( called with pass by value option)
I_COMP_CODE - Company code
Data type: BKPF-BUKRSOptional: No
Call by Reference: No ( called with pass by value option)
CHANGING Parameters details for FM_INV_PAY_DECISION
E_TAKE_DISCOUNT - Checkbox
Data type: FMDY-XFELDOptional: No
Call by Reference: No ( called with pass by value option)
Copy and paste ABAP code example for FM_INV_PAY_DECISION 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_i_cd_days | TYPE REGUP-ZBDXT, " | |||
| lv_e_take_discount | TYPE FMDY-XFELD, " | |||
| lv_i_doc_number | TYPE BKPF-BELNR, " | |||
| lv_i_fiscal_year | TYPE REGUP-GJAHR, " | |||
| lv_i_trace_flg | TYPE FMDY-XFELD, " | |||
| lv_i_lifnr | TYPE LFB1-LIFNR, " | |||
| lv_i_doc_date | TYPE BKPF-BLDAT, " | |||
| lv_i_pay_terms | TYPE REGUP-ZTERM, " | |||
| lv_i_fst_days | TYPE REGUP-ZBD1T, " | |||
| lv_i_snd_days | TYPE REGUP-ZBD2T, " | |||
| lv_i_net_days | TYPE BSEG-ZBD3T, " | |||
| lv_i_cd_per | TYPE REGUP-ZBDXP, " | |||
| lv_i_cur_pmnt_date | TYPE REGUP-LAUFD, " | |||
| lv_i_inv_date | TYPE BKPF-BLDAT, " | |||
| lv_i_baseline_date | TYPE BSEG-ZFBDT, " | |||
| lv_i_comp_code | TYPE BKPF-BUKRS. " |
|   CALL FUNCTION 'FM_INV_PAY_DECISION' "Decision on payment of PPA invoices |
| EXPORTING | ||
| I_CD_DAYS | = lv_i_cd_days | |
| I_DOC_NUMBER | = lv_i_doc_number | |
| I_FISCAL_YEAR | = lv_i_fiscal_year | |
| I_TRACE_FLG | = lv_i_trace_flg | |
| I_LIFNR | = lv_i_lifnr | |
| I_DOC_DATE | = lv_i_doc_date | |
| I_PAY_TERMS | = lv_i_pay_terms | |
| I_FST_DAYS | = lv_i_fst_days | |
| I_SND_DAYS | = lv_i_snd_days | |
| I_NET_DAYS | = lv_i_net_days | |
| I_CD_PER | = lv_i_cd_per | |
| I_CUR_PMNT_DATE | = lv_i_cur_pmnt_date | |
| I_INV_DATE | = lv_i_inv_date | |
| I_BASELINE_DATE | = lv_i_baseline_date | |
| I_COMP_CODE | = lv_i_comp_code | |
| CHANGING | ||
| E_TAKE_DISCOUNT | = lv_e_take_discount | |
| . " FM_INV_PAY_DECISION | ||
ABAP code using 7.40 inline data declarations to call FM FM_INV_PAY_DECISION
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 ZBDXT FROM REGUP INTO @DATA(ld_i_cd_days). | ||||
| "SELECT single XFELD FROM FMDY INTO @DATA(ld_e_take_discount). | ||||
| "SELECT single BELNR FROM BKPF INTO @DATA(ld_i_doc_number). | ||||
| "SELECT single GJAHR FROM REGUP INTO @DATA(ld_i_fiscal_year). | ||||
| "SELECT single XFELD FROM FMDY INTO @DATA(ld_i_trace_flg). | ||||
| "SELECT single LIFNR FROM LFB1 INTO @DATA(ld_i_lifnr). | ||||
| "SELECT single BLDAT FROM BKPF INTO @DATA(ld_i_doc_date). | ||||
| "SELECT single ZTERM FROM REGUP INTO @DATA(ld_i_pay_terms). | ||||
| "SELECT single ZBD1T FROM REGUP INTO @DATA(ld_i_fst_days). | ||||
| "SELECT single ZBD2T FROM REGUP INTO @DATA(ld_i_snd_days). | ||||
| "SELECT single ZBD3T FROM BSEG INTO @DATA(ld_i_net_days). | ||||
| "SELECT single ZBDXP FROM REGUP INTO @DATA(ld_i_cd_per). | ||||
| "SELECT single LAUFD FROM REGUP INTO @DATA(ld_i_cur_pmnt_date). | ||||
| "SELECT single BLDAT FROM BKPF INTO @DATA(ld_i_inv_date). | ||||
| "SELECT single ZFBDT FROM BSEG INTO @DATA(ld_i_baseline_date). | ||||
| "SELECT single BUKRS FROM BKPF INTO @DATA(ld_i_comp_code). | ||||
Search for further information about these or an SAP related objects