SAP CALCULATE_TAX_FROM_NET_AMOUNT Function Module for









CALCULATE_TAX_FROM_NET_AMOUNT is a standard calculate tax from net amount 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 calculate tax from net amount FM, simply by entering the name CALCULATE_TAX_FROM_NET_AMOUNT into the relevant SAP transaction such as SE37 or SE38.

Function Group: TAX1
Program Name: SAPLTAX1
Main Program: SAPLTAX1
Appliation area: F
Release date: N/A
Mode(Normal, Remote etc): Normal Function Module
Update:



Function CALCULATE_TAX_FROM_NET_AMOUNT 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 'CALCULATE_TAX_FROM_NET_AMOUNT'"
EXPORTING
I_BUKRS = "Company code
* I_ACCNT_EXT = "
* I_ACCDATA = "Accounting Document Segment
I_MWSKZ = "Tax code
* I_TXJCD = ' ' "Tax jurisdiction code
I_WAERS = "Currency key
I_WRBTR = "Net amount
* I_ZBD1P = 0 "Cash discount percentage rate
* I_PRSDT = "
* I_PROTOKOLL = "
* I_TAXPS = "

IMPORTING
E_FWNAV = "Non-deductible tax calculated (total)
E_FWNVV = "Non-deductible tax calculated which is allocated
E_FWSTE = "Tax calculated (total)
E_FWAST = "Calculated deductible tax

TABLES
T_MWDAT = "Table of tax values and percentage rates

EXCEPTIONS
BUKRS_NOT_FOUND = 1 UNKNOWN_ERROR = 10 ACCOUNT_NOT_FOUND = 11 TXJCD_NOT_VALID = 12 COUNTRY_NOT_FOUND = 2 MWSKZ_NOT_DEFINED = 3 MWSKZ_NOT_VALID = 4 KTOSL_NOT_FOUND = 5 KALSM_NOT_FOUND = 6 PARAMETER_ERROR = 7 KNUMH_NOT_FOUND = 8 KSCHL_NOT_FOUND = 9
.



IMPORTING Parameters details for CALCULATE_TAX_FROM_NET_AMOUNT

I_BUKRS - Company code

Data type: BKPF-BUKRS
Optional: No
Call by Reference: No ( called with pass by value option)

I_ACCNT_EXT -

Data type: COM_TAX-ACCNT_NO
Optional: Yes
Call by Reference: No ( called with pass by value option)

I_ACCDATA - Accounting Document Segment

Data type: BSEG
Optional: Yes
Call by Reference: No ( called with pass by value option)

I_MWSKZ - Tax code

Data type: BSEG-MWSKZ
Optional: No
Call by Reference: No ( called with pass by value option)

I_TXJCD - Tax jurisdiction code

Data type: BSEG-TXJCD
Default: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)

I_WAERS - Currency key

Data type: BKPF-WAERS
Optional: No
Call by Reference: No ( called with pass by value option)

I_WRBTR - Net amount

Data type: BSEG-WRBTR
Optional: No
Call by Reference: No ( called with pass by value option)

I_ZBD1P - Cash discount percentage rate

Data type: BSEG-ZBD1P
Optional: Yes
Call by Reference: No ( called with pass by value option)

I_PRSDT -

Data type: KOMK-PRSDT
Optional: Yes
Call by Reference: No ( called with pass by value option)

I_PROTOKOLL -

Data type: C
Optional: Yes
Call by Reference: No ( called with pass by value option)

I_TAXPS -

Data type: TAX_POSNR
Optional: Yes
Call by Reference: No ( called with pass by value option)

EXPORTING Parameters details for CALCULATE_TAX_FROM_NET_AMOUNT

E_FWNAV - Non-deductible tax calculated (total)

Data type: BSET-FWSTE
Optional: No
Call by Reference: No ( called with pass by value option)

E_FWNVV - Non-deductible tax calculated which is allocated

Data type: BSET-FWSTE
Optional: No
Call by Reference: No ( called with pass by value option)

E_FWSTE - Tax calculated (total)

Data type: BSET-FWSTE
Optional: No
Call by Reference: No ( called with pass by value option)

E_FWAST - Calculated deductible tax

Data type: BSET-FWSTE
Optional: No
Call by Reference: No ( called with pass by value option)

TABLES Parameters details for CALCULATE_TAX_FROM_NET_AMOUNT

T_MWDAT - Table of tax values and percentage rates

Data type: RTAX1U15
Optional: No
Call by Reference: No ( called with pass by value option)

EXCEPTIONS details

BUKRS_NOT_FOUND - Company code specified does not exist

Data type:
Optional: No
Call by Reference: No ( called with pass by value option)

UNKNOWN_ERROR - Unknown error

Data type:
Optional: No
Call by Reference: No ( called with pass by value option)

ACCOUNT_NOT_FOUND - Error in Account Determination

Data type:
Optional: No
Call by Reference: Yes

TXJCD_NOT_VALID -

Data type:
Optional: No
Call by Reference: Yes

COUNTRY_NOT_FOUND - The country specified in T001 does not exist

Data type:
Optional: No
Call by Reference: No ( called with pass by value option)

MWSKZ_NOT_DEFINED - Tax code not defined in calculation procedure

Data type:
Optional: No
Call by Reference: No ( called with pass by value option)

MWSKZ_NOT_VALID - Tax code not allowed in the calculation procedure

Data type:
Optional: No
Call by Reference: No ( called with pass by value option)

KTOSL_NOT_FOUND -

Data type:
Optional: No
Call by Reference: No ( called with pass by value option)

KALSM_NOT_FOUND -

Data type:
Optional: No
Call by Reference: No ( called with pass by value option)

PARAMETER_ERROR -

Data type:
Optional: No
Call by Reference: No ( called with pass by value option)

KNUMH_NOT_FOUND -

Data type:
Optional: No
Call by Reference: No ( called with pass by value option)

KSCHL_NOT_FOUND - Condition Type Not Found

Data type:
Optional: No
Call by Reference: No ( called with pass by value option)

Copy and paste ABAP code example for CALCULATE_TAX_FROM_NET_AMOUNT 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_e_fwnav  TYPE BSET-FWSTE, "   
lv_i_bukrs  TYPE BKPF-BUKRS, "   
lt_t_mwdat  TYPE STANDARD TABLE OF RTAX1U15, "   
lv_bukrs_not_found  TYPE RTAX1U15, "   
lv_i_accnt_ext  TYPE COM_TAX-ACCNT_NO, "   
lv_unknown_error  TYPE COM_TAX, "   
lv_i_accdata  TYPE BSEG, "   
lv_account_not_found  TYPE BSEG, "   
lv_txjcd_not_valid  TYPE BSEG, "   
lv_e_fwnvv  TYPE BSET-FWSTE, "   
lv_i_mwskz  TYPE BSEG-MWSKZ, "   
lv_country_not_found  TYPE BSEG, "   
lv_e_fwste  TYPE BSET-FWSTE, "   
lv_i_txjcd  TYPE BSEG-TXJCD, "   SPACE
lv_mwskz_not_defined  TYPE BSEG, "   
lv_e_fwast  TYPE BSET-FWSTE, "   
lv_i_waers  TYPE BKPF-WAERS, "   
lv_mwskz_not_valid  TYPE BKPF, "   
lv_i_wrbtr  TYPE BSEG-WRBTR, "   
lv_ktosl_not_found  TYPE BSEG, "   
lv_i_zbd1p  TYPE BSEG-ZBD1P, "   0
lv_kalsm_not_found  TYPE BSEG, "   
lv_i_prsdt  TYPE KOMK-PRSDT, "   
lv_parameter_error  TYPE KOMK, "   
lv_i_protokoll  TYPE C, "   
lv_knumh_not_found  TYPE C, "   
lv_i_taxps  TYPE TAX_POSNR, "   
lv_kschl_not_found  TYPE TAX_POSNR. "   

  CALL FUNCTION 'CALCULATE_TAX_FROM_NET_AMOUNT'  "
    EXPORTING
         I_BUKRS = lv_i_bukrs
         I_ACCNT_EXT = lv_i_accnt_ext
         I_ACCDATA = lv_i_accdata
         I_MWSKZ = lv_i_mwskz
         I_TXJCD = lv_i_txjcd
         I_WAERS = lv_i_waers
         I_WRBTR = lv_i_wrbtr
         I_ZBD1P = lv_i_zbd1p
         I_PRSDT = lv_i_prsdt
         I_PROTOKOLL = lv_i_protokoll
         I_TAXPS = lv_i_taxps
    IMPORTING
         E_FWNAV = lv_e_fwnav
         E_FWNVV = lv_e_fwnvv
         E_FWSTE = lv_e_fwste
         E_FWAST = lv_e_fwast
    TABLES
         T_MWDAT = lt_t_mwdat
    EXCEPTIONS
        BUKRS_NOT_FOUND = 1
        UNKNOWN_ERROR = 10
        ACCOUNT_NOT_FOUND = 11
        TXJCD_NOT_VALID = 12
        COUNTRY_NOT_FOUND = 2
        MWSKZ_NOT_DEFINED = 3
        MWSKZ_NOT_VALID = 4
        KTOSL_NOT_FOUND = 5
        KALSM_NOT_FOUND = 6
        PARAMETER_ERROR = 7
        KNUMH_NOT_FOUND = 8
        KSCHL_NOT_FOUND = 9
. " CALCULATE_TAX_FROM_NET_AMOUNT




ABAP code using 7.40 inline data declarations to call FM CALCULATE_TAX_FROM_NET_AMOUNT

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 FWSTE FROM BSET INTO @DATA(ld_e_fwnav).
 
"SELECT single BUKRS FROM BKPF INTO @DATA(ld_i_bukrs).
 
 
 
"SELECT single ACCNT_NO FROM COM_TAX INTO @DATA(ld_i_accnt_ext).
 
 
 
 
 
"SELECT single FWSTE FROM BSET INTO @DATA(ld_e_fwnvv).
 
"SELECT single MWSKZ FROM BSEG INTO @DATA(ld_i_mwskz).
 
 
"SELECT single FWSTE FROM BSET INTO @DATA(ld_e_fwste).
 
"SELECT single TXJCD FROM BSEG INTO @DATA(ld_i_txjcd).
DATA(ld_i_txjcd) = ' '.
 
 
"SELECT single FWSTE FROM BSET INTO @DATA(ld_e_fwast).
 
"SELECT single WAERS FROM BKPF INTO @DATA(ld_i_waers).
 
 
"SELECT single WRBTR FROM BSEG INTO @DATA(ld_i_wrbtr).
 
 
"SELECT single ZBD1P FROM BSEG INTO @DATA(ld_i_zbd1p).
 
 
"SELECT single PRSDT FROM KOMK INTO @DATA(ld_i_prsdt).
 
 
 
 
 
 


Search for further information about these or an SAP related objects



Comments on this SAP object

What made you want to lookup this SAP object? Please tell us what you were looking for and anything you would like to be included on this page!