SAP FMCA_SAMPLE_P311 Function Module for
FMCA_SAMPLE_P311 is a standard fmca sample p311 SAP function module available within SAP R/3 or S/4 Hana systems, depending on your version and release level. It is used to perform a specific ABAP function and below is the pattern details, 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 fmca sample p311 FM, simply by entering the name FMCA_SAMPLE_P311 into the relevant SAP transaction such as SE37 or SE38.
Function Group: FMCA_EVENTS
Program Name: SAPLFMCA_EVENTS
Main Program: SAPLFMCA_EVENTS
Appliation area:
Release date: N/A
Mode(Normal, Remote etc): Normal Function Module
Update:

Function FMCA_SAMPLE_P311 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 'FMCA_SAMPLE_P311'".
EXPORTING
I_FMCA_CONTEXT_KEYS = "BRF: Key of BRF Context
I_DPSOB = "Contract Object in Collection and Disbursement
I_DPSOB_BP_ACC = "Data for Contract Object for Each Partner & Cont. Acct Cat.
I_FKKVK = "Contract Account Header
I_FKKVKP = "Contract Account Partner-Specific
IT_DFKKOP = "
IT_DFACTS = "
* I_TRC = "Checkbox
IMPORTING
ET_FKKINVBILL_I = "Standard Table for Structure FKKINVBILL_I
ET_FKKINVBILL_A = "Standard Table for Structure FKKINVBILL_A
ET_FMCA_BRF_MSG = "Tax Calculation and Validation: Table Error Messages
ET_FMCA_INV_TXT_PAR = "Table Category for FMCA_INV_TXT_PAR
ET_DFKKLOCKS = "Table Type for DFKKLOCKS
ET_DFKKCOHI = "Table: Correspondence - Correspondence History
E_TRC = "Checkbox
CHANGING
CT_FKKINVBILL_H = "Standard Table for Type FKKINVBILL_H
CT_EXCEPTION = "FI-CA: Standard Table for Structure BAPIRET2
IMPORTING Parameters details for FMCA_SAMPLE_P311
I_FMCA_CONTEXT_KEYS - BRF: Key of BRF Context
Data type: FMCA_CONTEXT_KEYSOptional: No
Call by Reference: Yes
I_DPSOB - Contract Object in Collection and Disbursement
Data type: DPSOBOptional: No
Call by Reference: Yes
I_DPSOB_BP_ACC - Data for Contract Object for Each Partner & Cont. Acct Cat.
Data type: DPSOB_BP_ACCOptional: No
Call by Reference: Yes
I_FKKVK - Contract Account Header
Data type: FKKVKOptional: No
Call by Reference: Yes
I_FKKVKP - Contract Account Partner-Specific
Data type: FKKVKPOptional: No
Call by Reference: Yes
IT_DFKKOP -
Data type: FKK_T_DFKKOPOptional: No
Call by Reference: Yes
IT_DFACTS -
Data type: DFACTS_T_TYPEOptional: No
Call by Reference: Yes
I_TRC - Checkbox
Data type: XFELDOptional: Yes
Call by Reference: Yes
EXPORTING Parameters details for FMCA_SAMPLE_P311
ET_FKKINVBILL_I - Standard Table for Structure FKKINVBILL_I
Data type: FKKINVBILL_I_TABOptional: No
Call by Reference: Yes
ET_FKKINVBILL_A - Standard Table for Structure FKKINVBILL_A
Data type: FKKINVBILL_A_TABOptional: No
Call by Reference: Yes
ET_FMCA_BRF_MSG - Tax Calculation and Validation: Table Error Messages
Data type: FMCA_BRF_MSG_TOptional: No
Call by Reference: Yes
ET_FMCA_INV_TXT_PAR - Table Category for FMCA_INV_TXT_PAR
Data type: FMCA_INV_TXT_PAR_TABOptional: No
Call by Reference: Yes
ET_DFKKLOCKS - Table Type for DFKKLOCKS
Data type: DFKKLOCKS_TOptional: No
Call by Reference: Yes
ET_DFKKCOHI - Table: Correspondence - Correspondence History
Data type: FKK_TAB_DFKKCOHIOptional: No
Call by Reference: Yes
E_TRC - Checkbox
Data type: XFELDOptional: No
Call by Reference: Yes
CHANGING Parameters details for FMCA_SAMPLE_P311
CT_FKKINVBILL_H - Standard Table for Type FKKINVBILL_H
Data type: FKKINVBILL_H_TABOptional: No
Call by Reference: Yes
CT_EXCEPTION - FI-CA: Standard Table for Structure BAPIRET2
Data type: BAPIRET2_TAB_KKOptional: No
Call by Reference: Yes
Copy and paste ABAP code example for FMCA_SAMPLE_P311 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_ct_fkkinvbill_h | TYPE FKKINVBILL_H_TAB, " | |||
| lv_et_fkkinvbill_i | TYPE FKKINVBILL_I_TAB, " | |||
| lv_i_fmca_context_keys | TYPE FMCA_CONTEXT_KEYS, " | |||
| lv_i_dpsob | TYPE DPSOB, " | |||
| lv_ct_exception | TYPE BAPIRET2_TAB_KK, " | |||
| lv_et_fkkinvbill_a | TYPE FKKINVBILL_A_TAB, " | |||
| lv_i_dpsob_bp_acc | TYPE DPSOB_BP_ACC, " | |||
| lv_et_fmca_brf_msg | TYPE FMCA_BRF_MSG_T, " | |||
| lv_i_fkkvk | TYPE FKKVK, " | |||
| lv_et_fmca_inv_txt_par | TYPE FMCA_INV_TXT_PAR_TAB, " | |||
| lv_i_fkkvkp | TYPE FKKVKP, " | |||
| lv_et_dfkklocks | TYPE DFKKLOCKS_T, " | |||
| lv_it_dfkkop | TYPE FKK_T_DFKKOP, " | |||
| lv_et_dfkkcohi | TYPE FKK_TAB_DFKKCOHI, " | |||
| lv_e_trc | TYPE XFELD, " | |||
| lv_it_dfacts | TYPE DFACTS_T_TYPE, " | |||
| lv_i_trc | TYPE XFELD. " |
|   CALL FUNCTION 'FMCA_SAMPLE_P311' " |
| EXPORTING | ||
| I_FMCA_CONTEXT_KEYS | = lv_i_fmca_context_keys | |
| I_DPSOB | = lv_i_dpsob | |
| I_DPSOB_BP_ACC | = lv_i_dpsob_bp_acc | |
| I_FKKVK | = lv_i_fkkvk | |
| I_FKKVKP | = lv_i_fkkvkp | |
| IT_DFKKOP | = lv_it_dfkkop | |
| IT_DFACTS | = lv_it_dfacts | |
| I_TRC | = lv_i_trc | |
| IMPORTING | ||
| ET_FKKINVBILL_I | = lv_et_fkkinvbill_i | |
| ET_FKKINVBILL_A | = lv_et_fkkinvbill_a | |
| ET_FMCA_BRF_MSG | = lv_et_fmca_brf_msg | |
| ET_FMCA_INV_TXT_PAR | = lv_et_fmca_inv_txt_par | |
| ET_DFKKLOCKS | = lv_et_dfkklocks | |
| ET_DFKKCOHI | = lv_et_dfkkcohi | |
| E_TRC | = lv_e_trc | |
| CHANGING | ||
| CT_FKKINVBILL_H | = lv_ct_fkkinvbill_h | |
| CT_EXCEPTION | = lv_ct_exception | |
| . " FMCA_SAMPLE_P311 | ||
ABAP code using 7.40 inline data declarations to call FM FMCA_SAMPLE_P311
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.Search for further information about these or an SAP related objects