SAP MR_CALCULATE_TAX_DOCUMENT Function Module for NOTRANSL: Steuern auf Belegebene rechnen
MR_CALCULATE_TAX_DOCUMENT is a standard mr calculate tax document SAP function module available within SAP R/3 or S/4 Hana systems, depending on your version and release level. It is used for NOTRANSL: Steuern auf Belegebene rechnen 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 mr calculate tax document FM, simply by entering the name MR_CALCULATE_TAX_DOCUMENT into the relevant SAP transaction such as SE37 or SE38.
Function Group: KONT
Program Name: SAPLKONT
Main Program: SAPLKONT
Appliation area: M
Release date: N/A
Mode(Normal, Remote etc): Normal Function Module
Update:

Function MR_CALCULATE_TAX_DOCUMENT 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 'MR_CALCULATE_TAX_DOCUMENT'"NOTRANSL: Steuern auf Belegebene rechnen.
EXPORTING
I_BUKRS = "Company code
I_ZBD1P = "
I_WSKTO = "
I_RMWWR = "
I_XRECH = "
* I_TXKRS = "Exchange Rate for Taxes
* I_WRBTR_BNK = "
* I_MWSKZ_BNK = "
* I_TXJCD_BNK = "
* I_T169P_BNK = "
* I_LIFNR = "
I_HSWAE = "Local currency
* I_WRBTR_DIF = "Document Balance
* I_MWSKZ_DIF = "Tax Code
* I_TXJCD_DIF = "Tax Jurisdiction Code
* I_WWERT = "
* I_VATDATE = "Tax Reporting Date
* I_BLART = "
* I_KURSX = "
I_WAERS = "Doc. currency
I_XMWST = "'Calculate tax' indicator
* I_XSNET = 'X' "'Net' indicator
I_GLVOR = "G/L event
I_BUDAT = "
I_KURSF = "
I_BLDAT = "
IMPORTING
E_XFWSTE = "Total tax
E_PRSDT = "Tax Date
E_SKFBT = "
E_NAVFW_BNK = "
E_VATDATE = "Tax Reporting Date
TABLES
T_DRSEG = "
T_BSET = "
EXCEPTIONS
USER_EXIT = 1
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_SAPLKONT_001 User Exit Before MR_CHECK_TOLERANCE
EXIT_SAPLKONT_002 Customer Exit: Change Tolerance Check - Conventional Invoice Verification
EXIT_SAPLKONT_011 Account Grouping for GR/IR Account Determination
EXIT_SAPLKONT_412 Brazil: User Exit to determination Acct Modif.for 3rd NF for F. Del.
IMPORTING Parameters details for MR_CALCULATE_TAX_DOCUMENT
I_BUKRS - Company code
Data type: RBKP-BUKRSOptional: No
Call by Reference: No ( called with pass by value option)
I_ZBD1P -
Data type: RBKP-ZBD1POptional: No
Call by Reference: No ( called with pass by value option)
I_WSKTO -
Data type: RBKP-WSKTOOptional: No
Call by Reference: No ( called with pass by value option)
I_RMWWR -
Data type: RBKP-RMWWROptional: No
Call by Reference: No ( called with pass by value option)
I_XRECH -
Data type: RBKP-XRECHOptional: No
Call by Reference: No ( called with pass by value option)
I_TXKRS - Exchange Rate for Taxes
Data type: RBKPB-TXKRSOptional: Yes
Call by Reference: No ( called with pass by value option)
I_WRBTR_BNK -
Data type: RBKP-BEZNKOptional: Yes
Call by Reference: No ( called with pass by value option)
I_MWSKZ_BNK -
Data type: RBKP-MWSKZ_BNKOptional: Yes
Call by Reference: No ( called with pass by value option)
I_TXJCD_BNK -
Data type: RBKP-TXJCD_BNKOptional: Yes
Call by Reference: No ( called with pass by value option)
I_T169P_BNK -
Data type: T169P-BNKOptional: Yes
Call by Reference: No ( called with pass by value option)
I_LIFNR -
Data type:Optional: Yes
Call by Reference: No ( called with pass by value option)
I_HSWAE - Local currency
Data type: T001-WAERSOptional: No
Call by Reference: No ( called with pass by value option)
I_WRBTR_DIF - Document Balance
Data type: RBKPB-DIFFNOptional: Yes
Call by Reference: Yes
I_MWSKZ_DIF - Tax Code
Data type: DRSEG-MWSKZOptional: Yes
Call by Reference: Yes
I_TXJCD_DIF - Tax Jurisdiction Code
Data type: DRSEG-TXJCDOptional: Yes
Call by Reference: Yes
I_WWERT -
Data type: ACCIT-WWERTOptional: Yes
Call by Reference: No ( called with pass by value option)
I_VATDATE - Tax Reporting Date
Data type: VATDATEOptional: Yes
Call by Reference: No ( called with pass by value option)
I_BLART -
Data type: RBKP-BLARTOptional: Yes
Call by Reference: No ( called with pass by value option)
I_KURSX -
Data type: RBKP-KURSXOptional: Yes
Call by Reference: No ( called with pass by value option)
I_WAERS - Doc. currency
Data type: RBKP-WAERSOptional: No
Call by Reference: No ( called with pass by value option)
I_XMWST - 'Calculate tax' indicator
Data type: RBKP-XMWSTOptional: No
Call by Reference: No ( called with pass by value option)
I_XSNET - 'Net' indicator
Data type:Default: 'X'
Optional: Yes
Call by Reference: No ( called with pass by value option)
I_GLVOR - G/L event
Data type: T169-ACTI1Optional: No
Call by Reference: No ( called with pass by value option)
I_BUDAT -
Data type: RBKP-BUDATOptional: No
Call by Reference: No ( called with pass by value option)
I_KURSF -
Data type: RBKP-KURSFOptional: No
Call by Reference: No ( called with pass by value option)
I_BLDAT -
Data type: RBKP-BLDATOptional: No
Call by Reference: No ( called with pass by value option)
EXPORTING Parameters details for MR_CALCULATE_TAX_DOCUMENT
E_XFWSTE - Total tax
Data type: ITXDAT-FWSTEOptional: No
Call by Reference: No ( called with pass by value option)
E_PRSDT - Tax Date
Data type: BKPF-BUDATOptional: No
Call by Reference: No ( called with pass by value option)
E_SKFBT -
Data type: DBSEG-SKFBTOptional: No
Call by Reference: No ( called with pass by value option)
E_NAVFW_BNK -
Data type: DRSEG-NAV_FWOptional: No
Call by Reference: No ( called with pass by value option)
E_VATDATE - Tax Reporting Date
Data type: BKPF-VATDATEOptional: No
Call by Reference: No ( called with pass by value option)
TABLES Parameters details for MR_CALCULATE_TAX_DOCUMENT
T_DRSEG -
Data type: MMCR_TDRSEGOptional: No
Call by Reference: No ( called with pass by value option)
T_BSET -
Data type: BSETOptional: No
Call by Reference: No ( called with pass by value option)
EXCEPTIONS details
USER_EXIT -
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
Copy and paste ABAP code example for MR_CALCULATE_TAX_DOCUMENT 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_bukrs | TYPE RBKP-BUKRS, " | |||
| lt_t_drseg | TYPE STANDARD TABLE OF MMCR_TDRSEG, " | |||
| lv_e_xfwste | TYPE ITXDAT-FWSTE, " | |||
| lv_user_exit | TYPE ITXDAT, " | |||
| lv_i_zbd1p | TYPE RBKP-ZBD1P, " | |||
| lv_i_wskto | TYPE RBKP-WSKTO, " | |||
| lv_i_rmwwr | TYPE RBKP-RMWWR, " | |||
| lv_i_xrech | TYPE RBKP-XRECH, " | |||
| lv_i_txkrs | TYPE RBKPB-TXKRS, " | |||
| lv_i_wrbtr_bnk | TYPE RBKP-BEZNK, " | |||
| lv_i_mwskz_bnk | TYPE RBKP-MWSKZ_BNK, " | |||
| lv_i_txjcd_bnk | TYPE RBKP-TXJCD_BNK, " | |||
| lv_i_t169p_bnk | TYPE T169P-BNK, " | |||
| lv_i_lifnr | TYPE T169P, " | |||
| lt_t_bset | TYPE STANDARD TABLE OF BSET, " | |||
| lv_e_prsdt | TYPE BKPF-BUDAT, " | |||
| lv_i_hswae | TYPE T001-WAERS, " | |||
| lv_i_wrbtr_dif | TYPE RBKPB-DIFFN, " | |||
| lv_i_mwskz_dif | TYPE DRSEG-MWSKZ, " | |||
| lv_i_txjcd_dif | TYPE DRSEG-TXJCD, " | |||
| lv_i_wwert | TYPE ACCIT-WWERT, " | |||
| lv_i_vatdate | TYPE VATDATE, " | |||
| lv_i_blart | TYPE RBKP-BLART, " | |||
| lv_i_kursx | TYPE RBKP-KURSX, " | |||
| lv_e_skfbt | TYPE DBSEG-SKFBT, " | |||
| lv_i_waers | TYPE RBKP-WAERS, " | |||
| lv_i_xmwst | TYPE RBKP-XMWST, " | |||
| lv_e_navfw_bnk | TYPE DRSEG-NAV_FW, " | |||
| lv_i_xsnet | TYPE DRSEG, " 'X' | |||
| lv_e_vatdate | TYPE BKPF-VATDATE, " | |||
| lv_i_glvor | TYPE T169-ACTI1, " | |||
| lv_i_budat | TYPE RBKP-BUDAT, " | |||
| lv_i_kursf | TYPE RBKP-KURSF, " | |||
| lv_i_bldat | TYPE RBKP-BLDAT. " |
|   CALL FUNCTION 'MR_CALCULATE_TAX_DOCUMENT' "NOTRANSL: Steuern auf Belegebene rechnen |
| EXPORTING | ||
| I_BUKRS | = lv_i_bukrs | |
| I_ZBD1P | = lv_i_zbd1p | |
| I_WSKTO | = lv_i_wskto | |
| I_RMWWR | = lv_i_rmwwr | |
| I_XRECH | = lv_i_xrech | |
| I_TXKRS | = lv_i_txkrs | |
| I_WRBTR_BNK | = lv_i_wrbtr_bnk | |
| I_MWSKZ_BNK | = lv_i_mwskz_bnk | |
| I_TXJCD_BNK | = lv_i_txjcd_bnk | |
| I_T169P_BNK | = lv_i_t169p_bnk | |
| I_LIFNR | = lv_i_lifnr | |
| I_HSWAE | = lv_i_hswae | |
| I_WRBTR_DIF | = lv_i_wrbtr_dif | |
| I_MWSKZ_DIF | = lv_i_mwskz_dif | |
| I_TXJCD_DIF | = lv_i_txjcd_dif | |
| I_WWERT | = lv_i_wwert | |
| I_VATDATE | = lv_i_vatdate | |
| I_BLART | = lv_i_blart | |
| I_KURSX | = lv_i_kursx | |
| I_WAERS | = lv_i_waers | |
| I_XMWST | = lv_i_xmwst | |
| I_XSNET | = lv_i_xsnet | |
| I_GLVOR | = lv_i_glvor | |
| I_BUDAT | = lv_i_budat | |
| I_KURSF | = lv_i_kursf | |
| I_BLDAT | = lv_i_bldat | |
| IMPORTING | ||
| E_XFWSTE | = lv_e_xfwste | |
| E_PRSDT | = lv_e_prsdt | |
| E_SKFBT | = lv_e_skfbt | |
| E_NAVFW_BNK | = lv_e_navfw_bnk | |
| E_VATDATE | = lv_e_vatdate | |
| TABLES | ||
| T_DRSEG | = lt_t_drseg | |
| T_BSET | = lt_t_bset | |
| EXCEPTIONS | ||
| USER_EXIT = 1 | ||
| . " MR_CALCULATE_TAX_DOCUMENT | ||
ABAP code using 7.40 inline data declarations to call FM MR_CALCULATE_TAX_DOCUMENT
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 BUKRS FROM RBKP INTO @DATA(ld_i_bukrs). | ||||
| "SELECT single FWSTE FROM ITXDAT INTO @DATA(ld_e_xfwste). | ||||
| "SELECT single ZBD1P FROM RBKP INTO @DATA(ld_i_zbd1p). | ||||
| "SELECT single WSKTO FROM RBKP INTO @DATA(ld_i_wskto). | ||||
| "SELECT single RMWWR FROM RBKP INTO @DATA(ld_i_rmwwr). | ||||
| "SELECT single XRECH FROM RBKP INTO @DATA(ld_i_xrech). | ||||
| "SELECT single TXKRS FROM RBKPB INTO @DATA(ld_i_txkrs). | ||||
| "SELECT single BEZNK FROM RBKP INTO @DATA(ld_i_wrbtr_bnk). | ||||
| "SELECT single MWSKZ_BNK FROM RBKP INTO @DATA(ld_i_mwskz_bnk). | ||||
| "SELECT single TXJCD_BNK FROM RBKP INTO @DATA(ld_i_txjcd_bnk). | ||||
| "SELECT single BNK FROM T169P INTO @DATA(ld_i_t169p_bnk). | ||||
| "SELECT single BUDAT FROM BKPF INTO @DATA(ld_e_prsdt). | ||||
| "SELECT single WAERS FROM T001 INTO @DATA(ld_i_hswae). | ||||
| "SELECT single DIFFN FROM RBKPB INTO @DATA(ld_i_wrbtr_dif). | ||||
| "SELECT single MWSKZ FROM DRSEG INTO @DATA(ld_i_mwskz_dif). | ||||
| "SELECT single TXJCD FROM DRSEG INTO @DATA(ld_i_txjcd_dif). | ||||
| "SELECT single WWERT FROM ACCIT INTO @DATA(ld_i_wwert). | ||||
| "SELECT single BLART FROM RBKP INTO @DATA(ld_i_blart). | ||||
| "SELECT single KURSX FROM RBKP INTO @DATA(ld_i_kursx). | ||||
| "SELECT single SKFBT FROM DBSEG INTO @DATA(ld_e_skfbt). | ||||
| "SELECT single WAERS FROM RBKP INTO @DATA(ld_i_waers). | ||||
| "SELECT single XMWST FROM RBKP INTO @DATA(ld_i_xmwst). | ||||
| "SELECT single NAV_FW FROM DRSEG INTO @DATA(ld_e_navfw_bnk). | ||||
| DATA(ld_i_xsnet) | = 'X'. | |||
| "SELECT single VATDATE FROM BKPF INTO @DATA(ld_e_vatdate). | ||||
| "SELECT single ACTI1 FROM T169 INTO @DATA(ld_i_glvor). | ||||
| "SELECT single BUDAT FROM RBKP INTO @DATA(ld_i_budat). | ||||
| "SELECT single KURSF FROM RBKP INTO @DATA(ld_i_kursf). | ||||
| "SELECT single BLDAT FROM RBKP INTO @DATA(ld_i_bldat). | ||||
Search for further information about these or an SAP related objects