FI Function module Used the same way in S/4HANA

CALCULATE_TAX_FROM_NET_AMOUNT Calculate Tax from Net Amount

Calculates the tax amounts (total, deductible and non-deductible input tax) for a net amount with a given company code, tax code and currency, according to the company's tax calculation procedure. Developers use it in invoice uploads, in reports that calculate prices or quotations and in interfaces that send gross amounts to other systems. Details per tax condition come back in T_MWDAT; always handle exceptions such as MWSKZ_NOT_DEFINED.

Function group
TAX1
Remote-enabled (RFC)
No
Type
Function module

Importing parameters

ParameterTypeDescriptionRequired
I_BUKRSBKPF-BUKRSCompany codeYes
I_MWSKZBSEG-MWSKZTax codeYes
I_WAERSBKPF-WAERSCurrency keyYes
I_WRBTRBSEG-WRBTRNet amountYes
I_TXJCDBSEG-TXJCDTax jurisdiction code—
I_ZBD1PBSEG-ZBD1PCash discount percentage—
I_PRSDTKOMK-PRSDTPricing date—
I_ACCDATABSEGAccounting document segment—

Exporting parameters

ParameterTypeDescription
E_FWSTEBSET-FWSTETax calculated (total)
E_FWASTBSET-FWSTECalculated deductible tax
E_FWNAVBSET-FWSTENon-deductible tax calculated (total)
E_FWNVVBSET-FWSTENon-deductible tax allocated

Tables parameters

ParameterTypeDescriptionRequired
T_MWDATRTAX1U15Tax amounts and percentage ratesYes

Exceptions

  • BUKRS_NOT_FOUND — Company code not found
  • COUNTRY_NOT_FOUND — Country of company code not found
  • MWSKZ_NOT_DEFINED — Tax code not defined in calculation procedure
  • MWSKZ_NOT_VALID — Tax code not allowed in calculation procedure
  • ACCOUNT_NOT_FOUND — Error in account determination
  • KALSM_NOT_FOUND — Calculation procedure not found
  • KNUMH_NOT_FOUND — Condition record not found
  • KSCHL_NOT_FOUND — Condition type not found
  • KTOSL_NOT_FOUND — Transaction key not found
  • PARAMETER_ERROR — Parameter error
  • TXJCD_NOT_VALID — Tax jurisdiction code not valid
  • UNKNOWN_ERROR — Unknown error

Call template (ABAP)

A skeleton generated from the interface. It lists mandatory importing parameters, exporting parameters and tables; declare the variables with suitable types in your own program.

CALL FUNCTION 'CALCULATE_TAX_FROM_NET_AMOUNT'
  EXPORTING
    i_bukrs = lv_i_bukrs
    i_mwskz = lv_i_mwskz
    i_waers = lv_i_waers
    i_wrbtr = lv_i_wrbtr
  IMPORTING
    e_fwste = lv_e_fwste
    e_fwast = lv_e_fwast
    e_fwnav = lv_e_fwnav
    e_fwnvv = lv_e_fwnvv
  TABLES
    t_mwdat = lt_t_mwdat
  EXCEPTIONS
    bukrs_not_found = 1
    country_not_found = 2
    mwskz_not_defined = 3
    mwskz_not_valid = 4
    account_not_found = 5
    kalsm_not_found = 6
    knumh_not_found = 7
    kschl_not_found = 8
    OTHERS = 9.

Related tables

Solutions using this function

Can't find the report you need?

We also build anything that is not in the catalog. Describe it briefly and we will suggest the right solution.

Request a custom report