SAP COLLECT_AND_CALCULATE_TAX_DATA Function Module for Collect tax input data and immediately calculate taxes
COLLECT_AND_CALCULATE_TAX_DATA is a standard collect and calculate tax data SAP function module available within SAP R/3 or S/4 Hana systems, depending on your version and release level. It is used for Collect tax input data and immediately calculate taxes 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 collect and calculate tax data FM, simply by entering the name COLLECT_AND_CALCULATE_TAX_DATA into the relevant SAP transaction such as SE37 or SE38.
Function Group: FYTX_TAXM
Program Name: SAPLFYTX_TAXM
Main Program: SAPLFYTX_TAXM
Appliation area: F
Release date: N/A
Mode(Normal, Remote etc): Normal Function Module
Update:

Function COLLECT_AND_CALCULATE_TAX_DATA 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 'COLLECT_AND_CALCULATE_TAX_DATA'"Collect tax input data and immediately calculate taxes.
EXPORTING
I_KOMP = "
I_KOMK = "
I_XKOMV = "
I_TAX_PROCEDURE = "
I_COMP_CODE = "
I_PREISFINDUNGSART = "Single-character flag
CHANGING
O_PRICING_OK = "
O_KINAK = "
O_FXMSG = "
TABLES
T_XKOMV = "
IMPORTING Parameters details for COLLECT_AND_CALCULATE_TAX_DATA
I_KOMP -
Data type: KOMPOptional: No
Call by Reference: Yes
I_KOMK -
Data type: KOMKOptional: No
Call by Reference: Yes
I_XKOMV -
Data type: KOMV_INDEXOptional: No
Call by Reference: Yes
I_TAX_PROCEDURE -
Data type: T005-KALSMOptional: No
Call by Reference: Yes
I_COMP_CODE -
Data type: T001-BUKRSOptional: No
Call by Reference: Yes
I_PREISFINDUNGSART - Single-character flag
Data type: CHAR1Optional: No
Call by Reference: No ( called with pass by value option)
CHANGING Parameters details for COLLECT_AND_CALCULATE_TAX_DATA
O_PRICING_OK -
Data type: KOMP-PRSOKOptional: No
Call by Reference: Yes
O_KINAK -
Data type: KOMV-KINAKOptional: No
Call by Reference: Yes
O_FXMSG -
Data type: KOMV-FXMSGOptional: No
Call by Reference: Yes
TABLES Parameters details for COLLECT_AND_CALCULATE_TAX_DATA
T_XKOMV -
Data type: KOMV_INDEXOptional: No
Call by Reference: No ( called with pass by value option)
Copy and paste ABAP code example for COLLECT_AND_CALCULATE_TAX_DATA 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_komp | TYPE KOMP, " | |||
| lt_t_xkomv | TYPE STANDARD TABLE OF KOMV_INDEX, " | |||
| lv_o_pricing_ok | TYPE KOMP-PRSOK, " | |||
| lv_i_komk | TYPE KOMK, " | |||
| lv_o_kinak | TYPE KOMV-KINAK, " | |||
| lv_i_xkomv | TYPE KOMV_INDEX, " | |||
| lv_o_fxmsg | TYPE KOMV-FXMSG, " | |||
| lv_i_tax_procedure | TYPE T005-KALSM, " | |||
| lv_i_comp_code | TYPE T001-BUKRS, " | |||
| lv_i_preisfindungsart | TYPE CHAR1. " |
|   CALL FUNCTION 'COLLECT_AND_CALCULATE_TAX_DATA' "Collect tax input data and immediately calculate taxes |
| EXPORTING | ||
| I_KOMP | = lv_i_komp | |
| I_KOMK | = lv_i_komk | |
| I_XKOMV | = lv_i_xkomv | |
| I_TAX_PROCEDURE | = lv_i_tax_procedure | |
| I_COMP_CODE | = lv_i_comp_code | |
| I_PREISFINDUNGSART | = lv_i_preisfindungsart | |
| CHANGING | ||
| O_PRICING_OK | = lv_o_pricing_ok | |
| O_KINAK | = lv_o_kinak | |
| O_FXMSG | = lv_o_fxmsg | |
| TABLES | ||
| T_XKOMV | = lt_t_xkomv | |
| . " COLLECT_AND_CALCULATE_TAX_DATA | ||
ABAP code using 7.40 inline data declarations to call FM COLLECT_AND_CALCULATE_TAX_DATA
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 PRSOK FROM KOMP INTO @DATA(ld_o_pricing_ok). | ||||
| "SELECT single KINAK FROM KOMV INTO @DATA(ld_o_kinak). | ||||
| "SELECT single FXMSG FROM KOMV INTO @DATA(ld_o_fxmsg). | ||||
| "SELECT single KALSM FROM T005 INTO @DATA(ld_i_tax_procedure). | ||||
| "SELECT single BUKRS FROM T001 INTO @DATA(ld_i_comp_code). | ||||
Search for further information about these or an SAP related objects