You are on page 1of 63

Condition-based tax

calculation in R/3
for Brazil
Rel ease 4. 70
SAP Online Help 10/12/2011
Copyright
Copyright 2002 SAP AG. All rights reserved.
No part of this publication may be reproduced or transmitted in any form or for any purpose
without
the express permission of SAP AG. The information contained herein may be changed without
prior notice.
Some software products marketed by SAP AG and its distributors contain proprietary software
components of other software vendors.
Microsoft, WINDOWS, NT, EXCEL, Word, PowerPoint and SQL Server are
registered trademarks of Microsoft Corporation.
IBM, DB2, DB2 Universal Database, OS/2, Parallel Sysplex, MVS/ESA, AIX, S/390,
AS/400, OS/390, OS/400, iSeries, pSeries, xSeries, zSeries, z/OS, AFP, Intelligent Miner,
WebSphere, Netfinity, Tivoli, Informix and Informix Dynamic ServerTM are trademarks of
IBM Corporation in USA and/or other countries.
ORACLE is a registered trademark of ORACLE Corporation.
UNIX, X/Open, OSF/1, and Motif are registered trademarks of the Open Group.
Citrix, the Citrix logo, ICA, Program Neighborhood, MetaFrame, WinFrame,
VideoFrame, MultiWin and other Citrix product names referenced herein are trademarks of
Citrix Systems, Inc.
HTML, DHTML, XML, XHTML are trademarks or registered trademarks of W3C, World Wide
Web Consortium, Massachusetts Institute of Technology.
JAVA is a registered trademark of Sun Microsystems, Inc.
JAVASCRIPT is a registered trademark of Sun Microsystems, Inc., used under license for
technology invented and implemented by Netscape.
SAP, SAP Logo, R/2, RIVA, R/3, SAP ArchiveLink, SAP Business Workflow, WebFlow,
SAP EarlyWatch, BAPI, SAPPHIRE, Management Cockpit, mySAP, mySAP.com, and other
SAP products and services mentioned herein as well as their respective logos are
trademarks or registered trademarks of SAP AG in Germany and in several other countries
all over the world. MarketSet and Enterprise Buyer are jointly owned trademarks of
SAP Markets and Commerce One. All other product and service names mentioned are the
trademarks of their respective owners.
Condition-based tax calculation in R/3 for Brazil 2
SAP Online Help 10/12/2011
Content
1 Glossary And Typographic Conventions ...................................................... 7
2 Overview of the Changes ................................................................................ 8
2.1 Previous Tax Calculation Method ............................................................................. 8
2.2 New Tax Calculation Method ................................................................................... 8
3 Customizing the Brazilian Tax Calculation ................................................. 10
3.1 Activation of New Tax Calculation Method ............................................................. 10
3.2 Tax Managers Workplace ...................................................................................... 10
3.2.1 Entities ................................................................................................................ 11
3.2.1.1 Tax Regions ..................................................................................................... 11
3.2.1.2 NCM Codes ...................................................................................................... 11
3.2.1.3 Sub.Trib. Groups .............................................................................................. 11
3.2.1.4 CFOP CFOP Codes ...................................................................................... 12
3.2.1.5 CFOP CFOP Determination MM ................................................................... 12
3.2.1.6 CFOP CFOP Determination SD .................................................................... 12
3.2.1.7 CFOP Length of CFOP Codes ...................................................................... 12
3.2.1.8 CFOP CFOP Exceptions MM ........................................................................ 12
3.2.1.9 CFOP CFOP Exceptions SD ......................................................................... 12
3.2.1.10 Tax Laws IPI .................................................................................................. 12
3.2.1.11 Tax Laws ICMS .............................................................................................. 12
3.2.2 Tax Calculation ................................................................................................... 13
3.2.2.1 Maintain Tax Rates .......................................................................................... 13
3.2.2.2 Maintain Tax Groups ........................................................................................ 13
3.2.2.3 Tax Codes MM ................................................................................................. 13
3.2.2.4 Tax Codes SD .................................................................................................. 13
3.2.2.5 Alternative Calc. Procedure .............................................................................. 13
3.2.2.6 Tax Code Determination SD ............................................................................ 14
3.2.2.7 Tax Law Determination SD .............................................................................. 14
3.2.2.8 Other Country ................................................................................................... 14
3.2.3 Condition Setup ................................................................................................... 14
3.2.3.1 Migration Tax Tables to Conditions ............................................................... 14
3.2.3.2 Migration Tax Groups in Access Sequences ................................................. 14
3.2.3.3 Nota-Fiscal Mapping Tax Values MM ............................................................ 14
3.2.3.4 Nota-Fiscal Mapping Tax Values SD ............................................................. 14
3.2.3.5 Nota-Fiscal Mapping Tax Laws MM .............................................................. 15
3.2.3.6 Condition Mapping Internal Codes ................................................................ 15
3.2.3.7 Condition Mapping Assign Conditions ........................................................... 15
3.2.3.8 Condition Mapping Tax Rate Tables ............................................................. 15
Condition-based tax calculation in R/3 for Brazil 3
SAP Online Help 10/12/2011
3.2.3.9 Access Sequences Access Sequences MM .................................................. 15
3.2.3.10 Access Sequences Access Sequences SD ................................................. 15
3.2.3.11 Condition Types Condition Types MM ......................................................... 15
3.2.3.12 Condition Types Condition Types SD .......................................................... 16
3.2.3.13 Calc. Procedures Calc. Procedures MM ...................................................... 16
3.2.3.14 Calc. Procedures Calc. Procedures SD ....................................................... 16
3.2.3.15 Tax Types ...................................................................................................... 16
3.3 Maintenance of Tax Tables .................................................................................... 16
3.4 Tax Groups of Dynamic Exceptions ....................................................................... 16
3.5 Access Sequences ................................................................................................. 20
3.5.1 Tax Groups in Access Sequences ...................................................................... 20
3.5.2 Automatic Adjustment of Access Sequences ...................................................... 21
3.6 Condition Types ..................................................................................................... 22
3.7 Tax Calculation Procedure ..................................................................................... 22
3.8 Alternative Calculation Procedure .......................................................................... 23
3.9 Internal Condition Codes ........................................................................................ 23
3.10 Assignment of Condition Types to Internal Codes ................................................ 23
3.11 Assignment of Condition Tables to Tax Tables .................................................... 23
3.12 Definition of Tax Types ......................................................................................... 23
3.13 Customizing FI/MM Tax Codes ............................................................................ 24
3.13.1 One Single Tax Code Maintenance Tool ........................................................... 24
3.13.2 Maintenance of Tax Code Conditions ............................................................... 26
3.13.3 Hints on Customizing Tax Code Conditions ...................................................... 27
3.14 Mapping of Tax Values to the Nota Fiscal ............................................................ 27
3.15 Mapping of Tax Laws to the Nota Fiscal .............................................................. 28
3.16 Migration of Tax Data to Condition Records ......................................................... 28
3.16.1 Check Conditions .............................................................................................. 28
3.16.2 Convert Tax Data to Condition Records ............................................................ 29
3.17 Sequence for SD Tax Code Determination .......................................................... 29
3.18 Sequence for SD Tax Law Determination ............................................................ 30
4 Detailed Design .............................................................................................. 31
4.1 New DDIC Elements .............................................................................................. 31
4.1.1 Tables ................................................................................................................. 31
4.1.2 Views .................................................................................................................. 34
4.1.3 Search Helps ....................................................................................................... 35
4.1.4 Data Elements ..................................................................................................... 35
4.1.5 Domains .............................................................................................................. 36
4.2 Changes of Existing DDIC Elements ...................................................................... 37
4.2.1 Tables ................................................................................................................. 37
4.2.2 Views .................................................................................................................. 37
4.2.3 Data Elements ..................................................................................................... 37
4.2.4 Domains .............................................................................................................. 37
4.3 New Formulas ........................................................................................................ 37
Condition-based tax calculation in R/3 for Brazil 4
SAP Online Help 10/12/2011
4.3.1 Condition Value Formulas ................................................................................... 38
4.3.1.1 Formula 177 ..................................................................................................... 38
4.3.1.2 Formula 163 ..................................................................................................... 38
4.3.1.3 Formula 175 ..................................................................................................... 39
4.3.1.4 Formula 164 ..................................................................................................... 40
4.3.1.5 Formula 162 ..................................................................................................... 40
4.3.1.6 Formula 171 ..................................................................................................... 40
4.3.1.7 Formula 165 ..................................................................................................... 41
4.3.1.8 Formula 167 ..................................................................................................... 41
4.3.1.9 Formula 169 ..................................................................................................... 42
4.3.1.10 Formula 172 ................................................................................................... 42
4.3.1.11 Formula 170 ................................................................................................... 43
4.3.1.12 Formula 173 ................................................................................................... 43
4.3.1.13 Formula 176 ................................................................................................... 43
4.3.1.14 Formula 178 ................................................................................................... 44
4.3.2 Condition Base Value Formulas .......................................................................... 44
4.3.2.1 Formula 160 ..................................................................................................... 44
4.3.2.2 Formula 161 ..................................................................................................... 44
4.3.2.3 Formula 162 ..................................................................................................... 45
4.3.2.4 Formula 163 ..................................................................................................... 45
4.3.2.5 Formula 164 ..................................................................................................... 45
4.3.3 Pricing Requirement Formulas ............................................................................ 45
4.3.3.1 Formula 160 ..................................................................................................... 45
4.3.3.2 Formula 161 ..................................................................................................... 46
4.4 DDIC Class: CL_TAX_CONDITION ....................................................................... 46
4.5 DDIC Class: CL_DATE_DETERMINE ................................................................... 47
4.6 DDIC Class: CL_KEYFINDER ............................................................................... 47
4.7 Business Add-In: TAX_CONDITIONS .................................................................... 47
4.7.1 Method FILL_KOMK_KOMP ............................................................................... 47
4.7.2 Method PROCESS_TKOMV ............................................................................... 48
4.8 Automatic Generation of Condition Records in the View Maintenance ................... 48
4.8.1 Classes ............................................................................................................... 49
4.8.2 Event 01 .............................................................................................................. 49
4.8.3 Function Module J_1B_TRANSFER_TAX_CONDITION ..................................... 49
5 Standard Customizing ................................................................................... 50
5.1 Access Sequences MM .......................................................................................... 50
5.2 Condition Types MM .............................................................................................. 50
5.3 Calculation Procedure in MM (FI): TAXBRC .......................................................... 50
5.3.1 Step 100 .............................................................................................................. 50
5.3.2 Step 110 .............................................................................................................. 50
Condition-based tax calculation in R/3 for Brazil 5
SAP Online Help 10/12/2011
5.4 Internal Condition Codes ........................................................................................ 50
5.5 Assignment of Condition Types to Internal Codes .................................................. 51
5.6 Assignment of Tax Rate Tables to Condition Tables .............................................. 52
5.7 Definition of Tax Types .......................................................................................... 52
5.8 Standard Tax Codes .............................................................................................. 53
5.8.1 Tax codes for non taxable transactions ............................................................... 54
5.8.2 Tax codes for incoming movements - Industrialization ........................................ 54
5.8.3 Tax codes for incoming movements - Consumption ............................................ 56
5.8.4 Tax codes for incoming movements - ICMS Sub.Trib. on freight ......................... 58
5.8.5 Tax codes for incoming movements - Future delivery purchasing / Consignment
....................................................................................................................... 58
5.8.6 Tax codes for incoming movements - Services - ISS and INSS .......................... 60
5.8.7 Tax codes for outgoing movements - Ind.+Cons. posted in SD ........................... 61
5.8.8 Tax codes for transfer postings - outgoing movements - Ind.+Cons. ................... 62
5.9 Reserved Tax Groups of Dynamic Exceptions ....................................................... 63
Condition-based tax calculation in R/3 for Brazil 6
SAP Online Help 10/12/2011
1 Glossary And Typographic Conventions
Condition record Data record with condition rate, possibly units, text, and other data
Condition table Table that stores the numbers of condition records
Condition-based tax calculation (CBT) Contrary to external tax calculation, in the CBT all
calculation and tax rate determination is done by standard condition technique (pricing)
Tax Managers Workplace (TMW) A transaction that provides a workplace from which most of
the Brazilian tax Customizing can be reached directly
Pricing procedure results table The table that is accessible internally after a calculation
procedure was processed. In other words, the table with the pricing results.
In this document, sections that are only valid for specific application areas are marked at the
side of the text:
Sections that are only relevant for condition based tax calculation are marked with a grey line
and the text CBT.
Sections that are only relevant for Materials Management are marked with a grey line and the
text MM.
Sections that are only relevant for Sales and Distribution are marked with a grey line and the
text SD.
Condition-based tax calculation in R/3 for Brazil 7
CBT
MM
SD
SAP Online Help 10/12/2011
2 Overview of the Changes
2.1 Previous Tax Calculation Method
The previous way of calculating Brazilian taxes made use of the external tax interface. The task
of tax calculation is being executed by a dedicated function module rather than by direct
processing of the tax calculation procedure assigned to the country, using the tax rates
customized in transaction FTXP. The previous standard calculation procedure assigned to
Brazil, TAXBRJ, does not actually make use of the calculation functionality provided by the
pricing modules, but only calls the function module J_1BCALCULATE_TAXES in formula 320.
All the tax calculation logic is contained in this function module.
The tax code serves to indicate which taxes are due, activating specific lines in the calculation
procedure by setting the respective rate to 100%. Lines (taxes) which are not to be taken into
account for the respective tax code have to be deactivated (N.B.: not only set to be 0%).
However, a significant amount of logic that deals with specific special cases of the complicated
Brazilian tax system is hidden in the function module, thus preventing a flexible and transparent
adaption of the tax calculation logic to new legal requirements or special customer needs.
Moreover, the tax rates are being read from the database in function J_1BCALCULATE_TAXES
and not detemined by the standard condition technique that is meant to get the rates based on
the actual entries in the communication structures KOMP and KOMK.
The values of the various taxes are being fetched by base formulas 301 308 and value
formulas 521 528 which only serve to get the values stored in the global variables of function
group J1BR by the module J_1BCALCULATE_TAXES.
2.2 New Tax Calculation Method
The new approach of the Brazilian tax calculation that is decribed in this design document
makes use of the standard condition technique to calculate the taxes. During the tax calculation,
by calls to the function module PRICING a calculation procedure is processed. The rates are
stored as condition records and determined during the pricing procedure based on the actual
values of the fields of the communication structures KOMP and KOMK. The whole calculation
logic is contained in the calculation procedure itself without calling an external function module.
Formulas are only used to do special calculations that are not provided by the standard pricing
functionality. These formulas typically consist of only a few lines of code, processing at most
four parameters that are stored in the work fields XWORKD and XWORKE, the base value
XKAWRT of the respective line in the calculation procedure, and the condition rate XKOMV-
KBETR.
The tax rates, tax laws, and special indicators considering the appearance of the tax line item in
the nota fiscal are maintained in Brazil-specific views J_1BTX* (e.g. J_1BTXIP1 contains the IPI
rates). In the old method, the underlying tables are being read directly in the function module
J_1BCALCULATE_TAXES. In the new approach the data are not only stored in the J_1BTX*
tables, but are additionally present as condition records on the database. These records can be
directly read by the pricing logic so that no extra database selections have to be performed in
formulas being processed in the calculation procedure. Furthermore, the condition records can
easily be transferred to other systems (e.g. CRM systems).
The generation of the condition records takes place during the view mainenance of the J_1BTX*
tables. By making use of the event technique provided in the extended table maintenance
(transaction SE54), condition records are automatically written, updated, or deleted when data
are maintained in the views and saved to the database. Which conditions are to be generated is
being customized in mapping tables that are described in section 3.
The generation of the nota fiscal used to be partly performed in J_1BCALCULATE_TAXES in
the old method. In the new method, all logic which values are written in which fields in the nota
fiscal line items and which tax lines are generated is customized in another mapping table and
by the customizing of the tax code. Basically, the system is being told which lines and values of
Condition-based tax calculation in R/3 for Brazil 8
SAP Online Help 10/12/2011
the table of the calculation procedure contain which tax items. Thus, the whole nota-fiscal-
mapping logic is a matter of customizing and no longer to a great extent hard-coded, hidden in
the function module J_1BCALCULATE_TAXES.
Condition-based tax calculation in R/3 for Brazil 9
SAP Online Help 10/12/2011
3 Customizing the Brazilian Tax Calculation
3.1 Activation of New Tax Calculation Method
In order to use the new condition-based tax calculation, it has to be activated by setting a flag
for the respective country (see the screenshot in Figure 1). A new Customizing step in the IMG
has been added: IMG Financial Accounting Financial Accounting Global Settings Tax
on Sales/Purchases Basic Settings Brazil Activate Condition-Based Tax Calculation. In
this customizing activity, the new table J_1BCONDTAXACT is maintained.
If the flag is set for Brazil, condition records are being generated in the background during the
maintenance of the Brazilian tax tables.
3.2 Tax Managers Workplace
The Tax Managers Workplace (TMW) is a general entry point to do almost all Customizing
relevant for the Brazilian tax calculation. It is called by the transaction J1BTAX and can also be
accessed from the IMG: IMG Financial Accounting Financial Accounting Global Settings
Tax on Sales/Purchases Calculation Settings for Tax Calculation in Brazil Access
Tax Managers Workplace. The underlying program is J_1B_MIGRATE_TAX_RATES.
On the entry screen a list of all Brazilian tax tables is shown. Figure 2 shows a screenshot of the
initial screen of the transaction. The term tax tables shall mean all tables that contain Brazilian
tax data being accessed during the tax calculation in order to find rates, tax laws, and special
flags like Convnio 100 or Other base. The Customizing of these tables can also be found in
the IMG under IMG Financial Accounting Financial Accounting Global Settings Tax on
Sales/Purchases Calculation Settings for Tax Calculation in Brazil Tax Rates.
This new transaction can be used in any case to do the Customizing of Brazilian taxes in R/3
Enterprise. It is not necessary to switch to the condition-based tax calculation (CBT) to use it. If
it is not active, some menu options regarding the CBT are not accessible, though.
In the following, an overview about all menu options is given. More detailed descriptions about
the necessary Customizing steps to implement the CBT can be found in sections 3.3 to 3.16.
Condition-based tax calculation in R/3 for Brazil 10
Figure 1. Activation of new tax calculation method.
CBT
SAP Online Help 10/12/2011
3.2.1 Entities
In this menu, Customizing steps are collected that define basic constants that are relevant for
the Brazilian tax calculation.
3.2.1.1 Tax Regions
Assignment of geographical regions to tax regions that are used in the ship-from and ship-to
fields during the tax calculation. If the Tax-Free Zone indicator is set and the condition-based
tax calculation is active (see section 3.1), a condition record with a rate of 100% is generated in
the background whose type was assigned to the internal code TAXFREEREGION. This
condition can be used in the tax calculation procedure to perform special handling of tax-free
regions.
The IMG activity that corresponds to this menu item can be found in IMG Financial
Accounting Financial Accounting Global Settings Tax on Sales/Purchases Basic
Settings Brazil Tax Regions. The corresponding maintenance view is J_1BTREGV.
3.2.1.2 NCM Codes
Definition of NCM codes. The IMG activity that corresponds to this menu item can be found in
IMG Cross Application Components General Application Functions Nota Fiscal
NCM Codes Define NCM Codes. The corresponding maintenance view is J_1BT604FV.
3.2.1.3 Sub.Trib. Groups
Definition of possible Substituio Tributria groups in the vendor and customer master. The
IMG activity that corresponds to this menu item can be found in IMG Financial Accounting
Financial Accounting Global Settings Tax on Sales/Purchases Basic Settings Brazil
Condition-based tax calculation in R/3 for Brazil 11
Figure 2. Initial screen of the Tax Managers Workplace.
SAP Online Help 10/12/2011
Define Customer Groups for Substituio Tributria Calculation. The corresponding
maintenance view is J_1BTXSTGV.
3.2.1.4 CFOP CFOP Codes
Definition of CFOP codes. The IMG activity that corresponds to this menu item can be found in
IMG Cross Application Components General Application Functions Nota Fiscal
CFOP CFOP. The corresponding maintenance view is J_1BAGV.
3.2.1.5 CFOP CFOP Determination MM
Rules for the determination of the CFOP codes in MM applications. The IMG activity that
corresponds to this menu item can be found in IMG Cross Application Components
General Application Functions Nota Fiscal CFOP CFOP Determination for Goods
Receipts and Returns. The corresponding maintenance view is J_1BAOV.
3.2.1.6 CFOP CFOP Determination SD
Rules for the determination of the CFOP codes in SD applications. The IMG activity that
corresponds to this menu item can be found in IMG Cross Application Components
General Application Functions Nota Fiscal CFOP CFOP Determination for Goods
Issues and Returns. The corresponding maintenance view is J_1BAPV.
3.2.1.7 CFOP Length of CFOP Codes
Definition of the length of CFOP extensions that are used in certain Brazilian states. The IMG
activity that corresponds to this menu item can be found in IMG Cross Application
Components General Application Functions Nota Fiscal CFOP Define Length of
CFOP Extensions. The corresponding maintenance view is J_1BCFOP_XREGV.
3.2.1.8 CFOP CFOP Exceptions MM
Rules for the determination of special CFOP codes in MM applications. These CFOP codes are
used in certain Brazilian states that require a different CFOP code format. The IMG activity that
corresponds to this menu item can be found in IMG Cross Application Components
General Application Functions Nota Fiscal CFOP Exceptions for Incoming Goods
Movements and Returns. The corresponding maintenance view is J_1BAOXV.
3.2.1.9 CFOP CFOP Exceptions SD
Rules for the determination of special CFOP codes in SD applications. The IMG activity that
corresponds to this menu item can be found in IMG Cross Application Components
General Application Functions Nota Fiscal CFOP Exceptions for Outgoing Goods
Movements and Returns. The corresponding maintenance view is J_1BAPXV.
3.2.1.10 Tax Laws IPI
Definition of IPI tax laws. The IMG activity that corresponds to this menu item can be found in
IMG Financial Accounting Financial Accounting Global Settings Tax on
Sales/Purchases Basic Settings Brazil Define IPI Tax Laws. The corresponding
maintenance view is J_1BATL2V.
3.2.1.11 Tax Laws ICMS
Definition of ICMS tax laws. The IMG activity that corresponds to this menu item can be found in
IMG Financial Accounting Financial Accounting Global Settings Tax on
Sales/Purchases Basic Settings Brazil Define ICMS Tax Laws. The corresponding
maintenance view is J_1BATL1V.
Condition-based tax calculation in R/3 for Brazil 12
MM
SD
MM
SD
SAP Online Help 10/12/2011
3.2.2 Tax Calculation
In this menu, Customizing steps are collected that control the rates, flags, and texts that are
used in the tax calculation.
3.2.2.1 Maintain Tax Rates
Selecting this menu item starts the maintenance of the tax rates of the selected line in the table
of the overview screen. It can also be accessed by pressing the button in the application
toolbar or by double-clicking the line in the table. If the condition-based tax calculation is active,
condition records are being generated, modified, or deleted automatically in the background
when the data are saved.
The IMG activities that correspond to this menu item can be found in IMG Financial
Accounting Financial Accounting Global Settings Tax on Sales/Purchases Calculation
Settings for Tax Calculation in Brazil Tax Rates.
3.2.2.2 Maintain Tax Groups
Here you define tax groups used in the dynamic tax exceptions. The activity can also be
accessed by pressing the button in the application toolbar. Groups in the range from 10 to 89
can be defined. The numbers between 0 and 9 as well as between 90 and 99 are reserved for
SAP. These groups must not be deleted.
To use newly defined tax groups requires additional Customizing activities when the condition-
based tax calculation is used. See section 3.4 for further information.
The IMG activitity that corresponds to this menu item can be found in IMG Financial
Accounting Financial Accounting Global Settings Tax on Sales/Purchases Calculation
Settings for Tax Calculation in Brazil Tax Rates Maintain Tax Groups for Dynamic
Exceptions. The corresponding table is J_1BTXGRUOP.
3.2.2.3 Tax Codes MM
Definition of FI tax codes that are used in MM applications. The activity can also be accessed by
pressing the MM button in the application toolbar. Details for this Customizing step can be
found in section 3.13.
The IMG activitity that corresponds to this menu item can be found in IMG Financial
Accounting Financial Accounting Global Settings Tax on Sales/Purchases Calculation
Settings for Tax Calculation in Brazil Define MM Tax Codes. The corresponding
maintenance view is J_1BTAXCODEV.
3.2.2.4 Tax Codes SD
Definition of tax codes that are used in SD applications. The activity can also be accessed by
pressing the SD button in the application toolbar. The IMG activitity that corresponds to this
menu item can be found in IMG Financial Accounting Financial Accounting Global
Settings Tax on Sales/Purchases Calculation Settings for Tax Calculation in Brazil
Define SD Tax Codes. The corresponding maintenance view is J_1BTAXCODEV.
3.2.2.5 Alternative Calc. Procedure
Assignment of tax codes defined for a tax calculation procedure to a different combination of tax
code/calculation procedure. Details can be found in section 3.8.
The IMG activitity that corresponds to this menu item can be found in IMG Financial
Accounting Financial Accounting Global Settings Tax on Sales/Purchases Basic
Settings Brazil Define Alternative Calculation Procedure. The corresponding maintenance
view is J_1BMWSKZKALSMV.
Condition-based tax calculation in R/3 for Brazil 13
MM
SD
MM
SAP Online Help 10/12/2011
3.2.2.6 Tax Code Determination SD
Definition of the sequence of the determination logic of the SD tax codes. Details can be found
in section 3.17. The IMG activitity that corresponds to this menu item can be found in IMG
Financial Accounting Financial Accounting Global Settings Tax on Sales/Purchases
Calculation Settings for Tax Calculation in Brazil Define Sequence for SD Tax Code
Determination. The corresponding table is J_1BTXCODESEQ.
3.2.2.7 Tax Law Determination SD
Definition of the sequence of the determination logic of the SD tax laws. The IMG activitity that
corresponds to this menu item can be found in IMG Financial Accounting Financial
Accounting Global Settings Tax on Sales/Purchases Basic Settings Brazil Define
Sequence for SD Tax Law Determination. The corresponding table is J_1BTXLAWSEQ.
3.2.2.8 Other Country
Here a different country can be selected. At the start of the Tax Managers Workplace the
country is determined from the set/get parameter LND. If this parameter has no value the user is
prompted for a country that is stored in this parameter afterwards. This can also be executed by
choosing this menu point. The calculation procedure assigned to the selected country (in table
T005) is then taken as the default value.
3.2.3 Condition Setup
In this menu, all Customizing steps are collected that are related to the condition technique in
the tax calculation.
3.2.3.1 Migration Tax Tables to Conditions
Choosing this menu point, the generation of condition records out of the entries in the Brazilian
tax tables can be triggered initially, and the correct conversion can be monitored. Details can be
found in section 3.16. There is no entry in the IMG to start this activity. The TMW always has to
be used for this.
3.2.3.2 Migration Tax Groups in Access Sequences
You use this activity to automatically update access sequences after you have created or
changed tax groups for dynamic exceptions. Details can be found in section 3.5.2.
You need to have authorization for cross-client Customizing if you want to modify the access
sequences. It is important that you ensure that tax groups are not customized differently in
different clients because with each conversion to access sequences, the previous Customizing
settings will be overwritten.
3.2.3.3 Nota-Fiscal Mapping Tax Values MM
Here it is customized which fields of the table of the tax calculation procedure used in MM
contain the values of the nota fiscal. Details can be found in section 3.14. The IMG activitity that
corresponds to this menu item can be found in IMG Financial Accounting Financial
Accounting Global Settings Tax on Sales/Purchases Basic Settings Brazil
Condition-Based Tax Calculation Map MM Tax Values to Nota Fiscal Fields. The
corresponding maintenance view is J_1BNFTXCONDMMV.
3.2.3.4 Nota-Fiscal Mapping Tax Values SD
Here it is customized which fields of the table of the calculation procedure used in SD contain
the values of the nota fiscal. Details can be found in section 3.14. The IMG activitity that
corresponds to this menu item can be found in IMG Financial Accounting Financial
Accounting Global Settings Tax on Sales/Purchases Basic Settings Brazil
Condition-based tax calculation in R/3 for Brazil 14
CBT
CBT
MM
SD
CBT
SD
CBT
SD
SAP Online Help 10/12/2011
Condition-Based Tax Calculation Map SD Tax Values to Nota Fiscal Fields.The
corresponding maintenance view is J_1BNFTXCONDV.
3.2.3.5 Nota-Fiscal Mapping Tax Laws MM
Here it is customized which fields of the table of the tax calculation procedure used in MM
contain the tax law texts of the nota fiscal. Details can be found in section 3.15. The IMG
activitity that corresponds to this menu item can be found in IMG Financial Accounting
Financial Accounting Global Settings Tax on Sales/Purchases Basic Settings Brazil
Condition-Based Tax Calculation Map MM Tax Laws to Nota Fiscal Fields. The
corresponding maintenance view is J_1BNFLWCONDMMV.
3.2.3.6 Condition Mapping Internal Codes
Definition of internal codes used in the condition-based tax calculation. Details can be found in
section 3.8. The IMG activitity that corresponds to this menu item can be found in IMG
Financial Accounting Financial Accounting Global Settings Tax on Sales/Purchases
Basic Settings Brazil Condition-Based Tax Calculation Define Internal Codes for Tax
Conditions. The corresponding maintenance view is J_1BCONDMAPV.
3.2.3.7 Condition Mapping Assign Conditions
Assignment of condition types to the internal codes. Details can be found in section 3.10. The
IMG activitity that corresponds to this menu item can be found in IMG Financial Accounting
Financial Accounting Global Settings Tax on Sales/Purchases Basic Settings Brazil
Condition-Based Tax Calculation Assign Internal Codes for Tax Conditions to Condtion
Types. The corresponding table is J_1BTXCOND.
3.2.3.8 Condition Mapping Tax Rate Tables
Assignment of tax rate tables to the condition tables. Details can be found in section 3.11. The
IMG activitity that corresponds to this menu item can be found in IMG Financial Accounting
Financial Accounting Global Settings Tax on Sales/Purchases Basic Settings Brazil
Condition-Based Tax Calculation Assign Tax Rate Tables to Condition Tables. The
corresponding table is J_1BVIEWMAP.
3.2.3.9 Access Sequences Access Sequences MM
Definition of access sequences with application TX. These access sequences can be used in
the tax calculation that is called by the MM applications. The IMG activitity that corresponds to
this menu item can be found in IMG Financial Accounting Financial Accounting Global
Settings Tax on Sales/Purchases Basic Settings Check Calculation Procedure
Access Sequences. The corresponding view cluster is VVC_T682_TX.
3.2.3.10 Access Sequences Access Sequences SD
Definition of access sequences with application V. These access sequences can be used in the
SD pricing procedures. The IMG activitity that corresponds to this menu item can be found in
IMG Sales and Distribution Basic Functions Pricing Pricing Control Define
Access Sequences. The corresponding view cluster is V_T682.
3.2.3.11 Condition Types Condition Types MM
Definition of condition types with application TX. These condition types can be used in the tax
calculation that is called by the MM applications. The IMG activitity that corresponds to this
menu item can be found in IMG Financial Accounting Financial Accounting Global
Settings Tax on Sales/Purchases Basic Settings Check Calculation Procedure Define
Condition Types. The corresponding maintenance view is VV_T685A_V1.
Condition-based tax calculation in R/3 for Brazil 15
CBT
MM
CBT
MM
SD
MM
CBT
CBT
SAP Online Help 10/12/2011
3.2.3.12 Condition Types Condition Types SD
Definition of condition types with application V. These condition types can be used in the SD
pricing procedures. The IMG activitity that corresponds to this menu item can be found in IMG
Sales and Distribution Basic Functions Pricing Pricing Control Define Condition
Types. The corresponding maintenance view is V_T685A.
3.2.3.13 Calc. Procedures Calc. Procedures MM
Definition of tax calculation procedures. These calculation procedures can be used in the tax
calculation that is called by the MM applications. The IMG activitity that corresponds to this
menu item can be found in IMG Financial Accounting Financial Accounting Global
Settings Tax on Sales/Purchases Basic Settings Check Calculation Procedure Define
Procedures. The corresponding view cluster is VVC_T683_TX.
3.2.3.14 Calc. Procedures Calc. Procedures SD
Definition of pricing calculation procedures. These access sequences can be used in the SD
pricing procedures. The IMG activitity that corresponds to this menu item can be found in IMG
Sales and Distribution Basic Functions Pricing Pricing Control Define And Assign
Pricing Procedures. The corresponding view cluster is V_T683.
3.2.3.15 Tax Types
In this IMG activity, you define tax types for Brazil. Here it is customized which fields of the
pricing procedure results table contain the values of the Nota Fiscal. Details can be found in
section 3.14.
Furthermore, you can set the LPP (Last Purchase Price) indicator for each tax type in order to
activate the recording of the LPP. Further details can be found in the document Last purchase
price in R/3 for Brazil.
The IMG activitity that corresponds to this menu item can be found in IMG Financial
Accounting Financial Accounting Global Settings Tax on Sales/Purchases Basic
Settings Brazil Define Tax Types. The corresponding maintenance view is
J_1BNFTXCONDMMV.
3.3 Maintenance of Tax Tables
Selecting a line of the table on the overview screen of the TMW leads to the maintenance view
of the selected table. If a table with dynamic exceptions is selected the user is prompted for the
tax group prior to the table maintenance. The screenshot in Figure 3 shows an example, the
maintenance view J_1BTXIP3V.
If the condition-based tax calculation is active (see section 3.1), condition records are generated
and changed automatically when the data that are entered in these views are saved. These
conditions are accessed in the tax calculation. The Brazilian tables are no longer accessed
anywhere in the applications and only serve as a comfortable way of simultaneously maintaining
multiple conditions having the same key fields.
It is possible to display the automatically generated condition records in transaction FV13.
However, never may these condition records be changed or deleted with transaction FV12 or
new conditions be created with transaction FV11. This will lead to inconsistencies between the
data in the Brazilian tax tables and the condition records. In section 3.16, it is decribed how to
verify and reestablish the consistency of the data.
3.4 Tax Groups of Dynamic Exceptions
The screenshot in Figure 4 shows the maintenance of the table J_1BTXGRUOP in which the
groups of dynamic tax exceptions are defined. For each tax group, you can specify up to three
key fields that are to be used to determine the tax rates. You can choose from the following key
Condition-based tax calculation in R/3 for Brazil 16
SD
MM
SD
SAP Online Help 10/12/2011
fields: material, NCM code, material class/material group, tax code, vendor, customer, industry
sector, and city code. All of the fields are taken from the customer, vendor, and material master
records - with the exception of the tax code, which is taken from the item level in the
transactions.
Condition-based tax calculation in R/3 for Brazil 17
SAP Online Help 10/12/2011
Condition-based tax calculation in R/3 for Brazil 18
SAP Online Help 10/12/2011
The number of the tax group determines which rates are taken in case of more than one
matching record. For example, supposed tax group 50 has the key field NCM code and tax
group 51 has the key field material class. If in the tax calculation a record is found as well for tax
group 50 as for group 51, the record of group 50 will be taken since it has the lower number.
Furthermore, a tax group can be restricted to be used only for certain applications by choosing a
different value than General in the field Call. App. Using the CBT, two other applications can be
selected: Sales and Distribution (SD) and Materials Management (MM). The individual MM sub-
applications PO, IM, and IV, are no longer supported since it makes no sense to use, for
example, different tax rates in the invoice compared to the purchase order.
Also it can be restricted to be used only for certain tax types by only setting some tax type
indicators in the columns at the right side of the table. You can individually activate the
consideration of a tax group in the tax rate determination for the types ICMS, IPI, ISS, and
SubTrib (ST).
In the former tax calculation method, the described logic is programmed in the tax-calculating
function, J_1BCALCULATE_TAXES. When using the new tax calculation, this logic has to be
transferred to the customizing of the access sequences belonging to the conditions that store
the tax rates. See section 3.5.1 for a detailed description how this is realized.
Using CBT, in the standard setup delivered by SAP the tax data belonging to different tax
groups are stored in condition records that have the same condition table. In order to identify
which tax group an entry in the condition table belongs to, the condition table contains a key
field TAXGROUP. However, this condition table is not only used for dynamic tax exceptions, but
for other tax tables. For example, condition table 382 is used for all ICMS tax tables, i.e.
J_1BTXIC1, J_1BTXIC2, and J_1BTXIC3). Therefore, SAP defines standard tax groups that are
not to be used by customers. They are listed in section 5.9. In consequence, customers may
Condition-based tax calculation in R/3 for Brazil 19
Figure 3. Maintenance of the tax rate table J_1BTXIP3, tax group 6, in the view
J_1BTXIP3V. The dynamic key fields are material and vendor.
SAP Online Help 10/12/2011
only use tax group numbers in the range from 10 to 89. The other numbers are reserved for
SAP.
3.5 Access Sequences
In the TMW, the maintenance of access sequences is accessed by selecting the menu item
Condition Setup Access Sequences MM and Access Sequences SD. This calls the
maintenance of the view clusters VVC_T682_TX and V_T682, respectively. Access sequences
are cross-client data.
In section 5.1, the access sequences and the underlying condition tables and fields that are
used for the access are described. The new access sequences are shown in Table 5-3.
3.5.1 Tax Groups in Access Sequences
Whenever a new tax group was created or an existing group was changed, e.g. tax type
indicators were switched on and off, the application was changed, or even key fields were
changed, the access sequences have to be adjusted accordingly if the condition-based tax
calculation is used. A new step has to be included in all those access sequences that are used
by conditions that are used to calculate taxes of the type that is switched as active in the
customizing of the tax group. A program, J_1B_EXT_ACC_SEQ, is provided that can do this
automatically. This is described in section 3.5.2. If you change the access sequences manually,
the following example illustrates what you need to change.
Suppose you create tax group 50 with two key fields city code and NCM code, calling
application General, and marked as active for ICMS only. Then, you need to extend all MM and
SD access sequences that are used in the ICMS conditions by adding step 50. One example
from MM is BRIB. You can create step 50 by copying step 5, since they both use the same
condition table (the one corresponding to material-dependent exceptions). By copying step 5,
you take over the assignment of fields and constant values for the fields - except for the
dynamic ones. In the field assignment, you need to assign the city code to dynamic field 1, the
NCM code to field 2, and the constant 'X' to field 3. Lastly, assign the constant value '50' to the
field Tax group , so that the system can uniquely identify the record during rate determination.
Condition-based tax calculation in R/3 for Brazil 20
Figure 4. Maintenance of tax groups of dynamic exceptions. The displayed groups are an
example which is not deliverd as standard.
CBT
SAP Online Help 10/12/2011
If you do not use condition-based tax calculation, you do not need to adjust the corresponding
access sequences. In this case, the system searches through the defined order of key fields of
an active group as described above.
3.5.2 Automatic Adjustment of Access Sequences
With the report J_1B_EXT_ACC_SEQ you can automatically adjust all access sequences that
are used by condition types used for the condition-based tax calculation. Figure 5 shows the
initial selection screen.
You need to have authorization for cross-client Customizing if you want to modify the access
sequences. It is important that you ensure that tax groups are not customized differently in
different clients because with each conversion to access sequences, the previous Customizing
settings will be overwritten.
On the program selection screen, you enter the tax groups you want to include in the update.
You can simulate the results of the program by setting the Simulate Only indicator. This is
extremely important, since the program makes cross-client changes to your data. If you have no
authorization for cross-client customizing, this indicator is set by default and cannot be cleared.
Additionally, you need to specify what type of conversion is to take place:
Update access sequences - if you want to update existing steps in the access
sequences.
Insert into the access sequences - if you want to include new steps in the access
sequences after creating a new tax group .
Delete from access sequences - if you want to delete existing steps from the access
sequences.
Following the conversion or the simulation, the system displays a log that contains all messages
issued during processing.
In detail, the system behaves as follows based on the selected option:
A. Update access sequences
Condition-based tax calculation in R/3 for Brazil 21
Figure 5. Selection screen of the program that automatically adjusts access sequences
based on the Customizing of the tax groups of dynamic exceptions.
CBT
SAP Online Help 10/12/2011
If the system finds a step in the access sequence that has the same number of the tax
group, it overwrites the step's field assignment with the values customized for the tax
group.
If the system does not find a corresponding step in the access sequence, it inserts a new
step.
If the system finds a step in the access sequence that corresponds to the selected tax
group, but the Customizing settings indicate that this access sequence is not to have this
step, then the system deletes the step from the access sequence.
B. Insert into access sequences
Select this option if the tax groups you have specified have no corresponding steps and field
assignments in the access sequences yet (this would be when you have created a new tax
group). If the system does find a step with the number of the tax group in an access sequence,
it displays one of the following in the application log:
Warning message: if the existing field assignment is identical to the field assignment that
would be generated by the conversion
Error message: if the actual field assignment differs, in which case the system does not
change the access sequence
C. Delete from access sequences
Select this option if the tax groups you have specified are to be deleted from all access
sequences used in the CBT.
3.6 Condition Types
The condition types that have to be defined can be classified in four categories:
1. Conditions containing tax data. These condition records are maintained automatically
during the maintenance of the Brazilian tax rate tables. An internal code must be
assigned to each condition in table J_1BTXCOND (see sections 3.8 and 3.10).
2. Conditions that refer to other conditions. These are conditions that have a reference
condition containing the data. They are used to reuse a condition value in another line
of the calculation procedure.
3. Conditions that are only used to mark specific lines of the calculation procedure to use
them in the Nota Fiscal mapping tables. The access sequence BRB1 is a dummy that
always accesses the conditions with LAND1=BR in the condition table A391. For these
conditions, one single condition record has to be created manually with transaction
FV11. Specify 100% as condition value in order to simply take over the base value
(KAWRT) in the calculation procedure to the condition value (KWERT).
4. Conditions indicating that a certain tax type is due. These condition types have to be
entered also in the table J_1BAJ to classify them as tax type. The maintenance of the
tax types is accessed in the TMW under Condition Setup Tax Types. The records are
maintained by customizing the tax codes.
The newly created condition types are described in section 5.2.
3.7 Tax Calculation Procedure
The new standard tax calculation procedure for Brazil is TAXBRC. The customizing of
calculation procedures is done in the view cluster VVC_T683_TX and can be reached from the
TMW by choosing Condition Setup Calc. Procedure MM.
This tax calculation procedure has to be assigned to the country BR in table T005. The
corresponding IMG activity can be found in IMG Financial Accounting Financial
Accounting Global Settings Tax on Sales/Purchases Basic Settings Assign Country To
Calculation Procedure.
Condition-based tax calculation in R/3 for Brazil 22
CBT
CBT
MM
SAP Online Help 10/12/2011
A detailed description of the new standard calculation procedure TAXBRC can be found in
section 5.3.
3.8 Alternative Calculation Procedure
In R/3 Enterprise, an extension to the concept described in section 3.7 has been introduced. In
the table J_1BMWSKZKALSM, alternative calculation procedures can be specified that are to
be used for certain tax codes instead of the standard one. This is achieved by reading this table
in a BAdI before the call to the pricing procedure and modifying the communication fields that
contain the calculation procedure and the tax code.
Thus the user could e.g. use the external tax calculation for some tax codes (by specifying
TAXBRJ in the above mentioned table) or use several smaller calculation procedures, e.g. in
case of performance problems or new requirements.
3.9 Internal Condition Codes
An internal code has to be created for each condition type that is to be used in the automatic
generation of condition records during the maintenance of the Brazilian tax tables. Only the
internal codes are used in the program coding. By this mapping, the customers are free to use
their own condition types.
The internal codes are maintained in the TMW by choosing Condition Setup Condition
Mapping Internal Codes in the menu or maintaining the view J_1BCONDMAPV. The customer
usually is not expected to maintain this table because SAP delivers the internal codes required
for the standard Brazilian tax calculation. If customers need to define their own internal codes
for user-specific coding, they can define new codes beginning with Z. Table 5-4 shows all
standard internal condition codes delivered by SAP.
For the internal codes that represent condition types that contain data of a specific tax group
(ICMS, IPI, ISS, or SubTrib), the respective tax group has to be assigned to the codes. This is
necessary for the system to consider the access sequence of the condition type assigned to the
internal code in the automatic extension of access sequences after changing tax groups of
dynamic exceptions (see section 3.5.2).
3.10Assignment of Condition Types to Internal Codes
The condition types that are actually used in the tax calculation procedure have to be assigned
to the above described internal codes. For the standard Brazilian tax calculation, SAP delivers
all internal codes, conditions, and their assignments. Table 5-5 shows the standard mapping
delivered by SAP.
3.11Assignment of Condition Tables to Tax Tables
During the maintenance of the Brazilian tax tables, condition records are generated and
changed automatically. In the table J_1BVIEWMAP it has to be specified which condition tables
are to be used for a specific tax table. In the case of dynamic exceptions, you additionally
specify the condition table per tax group.
The default entries delivered by SAP are shown in Table 5-6.
3.12Definition of Tax Types
The condition types that indicate whether a specific tax is due or whether specific lines are to be
listed in the nota fiscal have to be specified in the table J_1BAJ. The condition types are
referred to as tax types in this table. They are customized in the view J_1BAJV that can be
accessed in the TMW by choosing Condition Setup Tax Types.
Condition-based tax calculation in R/3 for Brazil 23
CBT
CBT
CBT
MM
SAP Online Help 10/12/2011
Each tax type has to be assigned to a tax group. Tax groups are the different Brazilian taxes
(IPI, ICMS, Substituio Tributaria, ISS) and the information whether it is a complementary tax
or a tax on freight. For each group there is a separate line in the nota fiscal.
For each tax type an indicator LPP can be set, indicating that for this tax type the last
purchasing price is to be calculated and used in the tax rate determination. Details about this
functionality can be found in the document Last purchase price in R/3 for Brazil.
Table 5-7 shows the standard tax types delivered by SAP.
3.13Customizing FI/MM Tax Codes
3.13.1 One Single Tax Code Maintenance Tool
The Customizing of FI/MM tax codes is done in the TMW by choosing Tax Calculation Tax
Codes MM. This leads to the maintenance view J_1BTAXCODEV. It is no longer done with the
transaction FTXP.
Before the table with the tax codes is displayed, the user is prompted for the calculation
procedure. As default, the tax calculation procedure assigned to the country is displayed. This
can be overwritten if the feature of alternative calculation procedures (section 3.8) is used.
Until release 4.6C three customizing steps had to be executed to customize a tax code. First,
the conditions of the tax code had to be maintained in transaction FTXP. There it was also
specified whether the code belongs to input or output tax. The Brazil-specific fields in table
T007A, which contains the tax code data (except the condition records), had to be maintained
with the view J_1BTXMMCV. For the automatic determination of tax codes in stock transfer
processes, finally the table T007_IT had to be maintained to map SD tax codes (defined in table
J_1BTXSDC) against incoming and outgoing tax codes (defined in T007A).
Condition-based tax calculation in R/3 for Brazil 24
SAP Online Help 10/12/2011
Condition-based tax calculation in R/3 for Brazil 25
SAP Online Help 10/12/2011
The table T007_IT has been replaced by the new table J_1BT007 in release 4.7. The new view
J_1BTAXCODEV allows the maintenance of all fields mentioned in the three steps above at the
same time in one line. Figure 6 shows a screenshot of this view.
3.13.2 Maintenance of Tax Code Conditions
The conditions belonging to a tax code are maintained by selecting the line with the tax code
that is to be maintained and afterwards choosing Goto Maintain Conditions (Ctrl+F3) or
pressing the button on the application toolbar. In case the system does not find a unique
assignment of a tax calculation procedure to a country (in table T005), the user is asked to
select a country first.
The screenshot in Figure 7 shows an example of the screen where the tax code conditions are
maintained. In the table, all condition types are listed that are defined as tax types in the table
J_1BAJ (see the previous section) and that are present in the calculation procedure assigned to
the country. A tax type is active when the respective checkbox is checked; otherwise it is
inactive.
When the data are saved in the screen displayed in Figure 6, condition records are
automatically being generated. Checked tax types are transferred to condition records with a
value of 100%; for unchecked types the respective condition records are deleted so that the line
will not appear in the pricing-procedure results table after the execution of the pricing procedure
in the tax calculation.
The tax code conditions are stored in the condition table A003 which has as key fields the
country and the tax code. This is different to the table T007A in which the tax codes are defined
for a country and calculation procedure. In the standard tax calculation, only one tax calculation
procedure can be assigned to a country in table T005. However, if the new feature of alternative
calculation procedures is used (see section 3.8), a different calculation procedure can be used
for certain tax codes. For this reason, the tax codes defined for different calculation procedures
have to be given different names if their conditions are to be customized differently, in order its
Condition-based tax calculation in R/3 for Brazil 26
Figure 6. Overview of the tax code maintenance. Figure 7. Conditions that belong to the selected tax code.
SAP Online Help 10/12/2011
conditions do not overwrite the ones of tax codes with the same name assigned to a different
calculation procedure.
3.13.3 Hints on Customizing Tax Code Conditions
Compared with the former way of customizing Brazilian tax code conditions, some changes
were introduced in the condition-based tax calculation. The basic idea is the same: You activate
the lines of the calculation procedure that store the tax amounts which are to be taken for the
tax code. The other lines that contain tax code conditions (tax types) are deactivated. The table
displayed in Figure 7 is basically a special view on the tax calculation procedure in which only
those lines are displayed that contain conditions that are tax types (defined in table J_1BAJ, see
section 3.12).
What has changed is that no special internal nota-fiscal handling is performed in an external tax
calculation any longer. For example, in the old tax calculation method, always as well an ICMS
as an IPI line were generated in the nota fiscal, even if, according to the tax code, only one of
the two taxes is active (or even no tax, like in the standard tax codes I0 or C0). In the new
approach, however, all this logic is customizable in the nota-fiscal mapping table
J_1BNFTXCOND, which is explained in section 3.14.
In order to generate the IPI or ICMS lines in the nota fiscal that only store the calculation base in
the Other Base field in case the respective tax is not due (referred to as dummy line in the
following, the following conditions (lines in the table shown in Figure 7) have to be activated too:
ICMX Activate if ICMS is due
IPIX Activate if IPI is due
ICM0, IPI0 Activate if IPI and/or ICMS dummy line is to be generated in the nota
fiscal, material usage is consumption
ICMN, IPIN Activate if IPI and/or ICMS dummy line is to be generated in the nota
fiscal; usage is not consumption
These special additional conditions that have to be maintained are only relevant for ICMS and
IPI, not for ISS, SubTrib, or any other tax group.
In section 5.8, the Brazilian tax codes SAP delivers as standard are described. Refer to that
section for examples and further explanations.
3.14Mapping of Tax Values to the Nota Fiscal
By using the new condition-based tax calculation the pricing-procedure results table contains all
values that need to be listed in the nota fiscal. Which values of the table are transferred to which
nota fiscal fields is customized in the TMW by choosing Condition Setup Nota-Fiscal Mapping
Tax Values MM or SD, respectively. This leads to the maintenance of the views
J_1BNFTXCONDMMV (for MM) and J_1BNFTXCONDV (for SD) that define the mapping rules.
The screenshot in Figure 8 shows an example.
A tax line in the nota fiscal consists of the tax rate, the tax value, the normal base, the excluded
base, and the other base. An active tax type for a tax code leads to a corresponding line in the
nota fiscal. In this view it is specified from which fields in the pricing-procedure results table the
above mentioned nota fiscal fields are being filled.
For each nota fiscal field the condition type that identifies the line in the calculation procedure
has to be specified. If the condition is inactive, the respective line will not be found in the pricing-
procedure results table and the initial value will be transferred.
Furthermore, the field of the line of the pricing-procedure results table has to be specified in the
column Map. Field. There are three alternatives: the condition base value, KAWRT; the
condition rate or amount, KBETR; and the condition value, KWERT.
Condition-based tax calculation in R/3 for Brazil 27
CBT
SAP Online Help 10/12/2011
3.15Mapping of Tax Laws to the Nota Fiscal
The tax laws are also stored in condition records that are generated by the maintenance of the
tax code or the maintenance of certain tax rate tables (e.g. J_1BTXIP1 or J_1BTXIC2). From
which condition types the laws are taken is defined in the table J_1BNFLWCOND. It is
maintained in the TMW by choosing Condition Setup Nota-Fiscal Mapping Tax Laws. This
leads to the maintenance of the view J_1BNFLWCONDMMV that defines the mapping. The
screenshot in Figure 9 shows the standard mapping delivered by SAP.
3.16Migration of Tax Data to Condition Records
In the TMW, by choosing Condition Setup Migration (Shift+F5) a screen is displayed where
the initial conversion of the entries in the Brazilian tax tables to condition records can be started
and it can be checked whether all entries are successfully converted.
3.16.1 Check Conditions
The entries in the table of the selected line in the list of tax rate tables can be checked for
corresponding condition records by choosing Condition Records Check Conditions (F5) or
pressing the button in the application toolbar. For each entry in the respective table it is
checked (based on the customizing in the mapping tables J_1BVIEWMAP and J_1BTXCOND)
whether corresponding condition records exist. The selections made in the Application group
determine whether the conditions for the application TX (used in materials management) or V
(used in sales and distribution) are being checked.
The entries and the numbers of the corresponding conditions are displayed in the ALV list. By
double-clicking a condition record number a modeless popup window is displayed that contains
detailed information about the condition record from the corresponding entries in the DDIC
tables KONH and KONP. The screenshot in Figure 10 shows an example.
Condition-based tax calculation in R/3 for Brazil 28
Figure 8. Mapping of lines in the table of the calculation procedure to tax values in the
Nota-Fiscal. The MM view J_1BNFTXCONDMMV is shown.
CBT
MM
CBT
CBT
SAP Online Help 10/12/2011
The traffic lights icon in the leftmost column of the ALV list indicates whether for each field in the
table line that is to have a corresponding condition record exists a condition (green), that no
conditions exist so far (red), or that only some fields have corresponding conditions (yellow).
The icon in the leftmost column of the table control with all Brazilian tax tables gives a summary
of the check: The magnifying-glass indicates that the respective table has not been checked yet
since the transaction was started. Green traffic lights mean that every entry in the table has all
corresponding condition records; red means that at least one entry has no condition records so
far; yellow means that at least one line has only some converted fields.
3.16.2 Convert Tax Data to Condition Records
By choosing Condition Records Convert (F6) or pressing the button in the application
toolbar, the conversion of tax records to conditions is started. It is prerequisite that all
customizing of the mapping tables described in this section is already done; otherwise errors
are being issued. The selection made in the group Conversion Options determines the mode of
conversion. If the first option is chosen, every field is converted in any case, no matter if there
already exists a corresponding condition record. If the second option is chosen, the user is
asked in case of the previously described situation. If the third option is chosen, only the fields
are converted that do not have corresponding condition records so far.
3.17Sequence for SD Tax Code Determination
In Sales and Distribution there are two places to define the SD Tax Code which can be
automatically determined in a transaction (e.g. a sales order). It can be either derived from the
Item Category, or the Customer/Material Information Record.
By means of the table J_1BTXCODESEQ, a sequence can be defined by which these data
sources are accessed. Enter sequential integer numbers and assign the data sources from the
drop down menu to them. During the transaction, the system will look up the data sources in
ascending order of the sequence number until a tax code is found.
Table 3-1. Example of a sequence for tax code determination.
Sequence in Tax Code Determination
Source for Tax Code Determination
1 Item Category Table
2 Customer Material Information
An example is shown in Table 3-1. In this example the system would first look up the item
category table and if no tax code was found, the customer material information.
Condition-based tax calculation in R/3 for Brazil 29
Figure 9. Mapping of lines in the table of the calculation procedure to tax law texts in the
Nota-Fiscal.
CBT
CBT
SD
SAP Online Help 10/12/2011
3.18Sequence for SD Tax Law Determination
In Sales and Distribution there are several places to define Tax Laws for ICMS and IPI which
can be automatically determined in a transaction (e.g. a sales order). They can be either derived
from the Item Category, the Tax Rate Exception Tables or from the Customer Master Record.
By means of the table J_1BTXLAWSEQ, a sequence can be defined by which the various data
sources are accessed. Enter sequential integer numbers and assign the data sources from the
drop down menu to them. During the transaction, the system will look up the data sources in
ascending order of the sequence number until the tax laws are found.
Table 3-2. Example of a sequence for tax law determination.
Sequence in Tax Law Determination Source for Tax Law Determination
3 Tax Exception Tables
4 Item Category Table
5 Customer Master
An example is shown in Table 3-2. In this example the system would first look up the tax
exception tables, then the item category tables if no tax laws were found and finally the
customer master.
Condition-based tax calculation in R/3 for Brazil 30
Figure 10. The migration and check tool that controls the initial conversion and the
consistency of entries in Brazilian tax tables to condition records.
CBT
SD
SAP Online Help 10/12/2011
4 Detailed Design
4.1 New DDIC Elements
4.1.1 Tables
J_1BCONDMAP, J_1BCONDMAPT
The table J_1BCONDMAP contains all internal codes for condition records that are being
generated automatically during the maintenance of the Brazilian tax tables or during the initial
conversion with the program J_1B_MIGRATE_TAX_RATES. The table J_1BCONDMAPT is the
corresponding text table. Both tables are maintained with the view J_1BCONDMAPV.
J_1BTXCOND
In this table, the internal codes defined in J_1BCONDMAP are assigned to condition types
(defined in table T685). A combination (internal code, application) is mapped against a condition
type.
J_1BVIEWMAP
In this table, the Brazilian tax tables are mapped against condition tables. Each pair (table, tax
group) is assigned a condition table (named A*, e.g. A346). Specifying the tax group only
makes sense in the case of tables containing dynamic exceptions. For the other tables, this field
is initial.
J_1BNFTXCOND
This table serves to define the transfer of information from the KOMV-like table that is generated
during the calculation procedure processing to the Nota Fiscal.
Grouping key fields are the usage KVEWE of the condition table (TX or V), the application
KAPPL (A Pricing), and the calculation procedure KALSM (in the case of KVEWE=TX the
tax calculation procedure assigned to the country, i.e. TAXBRC in the standard Brazil case; in
the case of KVEWE=V the respective calculation procedure assigned to order types in pricing).
The key field TAXTYP is defined in table J_1BAJ. In the case of KAPPL=TX it has to be a
condition type that is used in the tax calculation procedure and activated or deactivated by
customizing the tax code.
The further fields of the table have to be regarded as pairs, i.e. RATE and RATE_MAP belong
together, VALUE and VALUE_MAP, etc. The first field of the pair contains a condition type that
has to be present in the calculation procedure. The second field specifies which number in the
KOMV-like line of the table of the calculation procedure is transferred: KWERT, KBETR, or
KAWRT. This number is going to be transferred in the respective field of the Nota Fiscal.
The table is being maintained with the view J_1BNFTXCONDMMV for the materials-
management applications (KAPPL=TX).
J_1BNFLWCOND
This table defines the transfer of the tax law texts to the Nota Fiscal from the KOMV-like table
that is generated during the calculation procedure processing.
The grouping key fields are the same as for the table J_1BNFTXCOND. A condition type
KSCHL is assigned to a tax group TAXGRP. The condition type has to be present in the
calculation procedure. The respective line of the KOMV-like table has to have the field
KNUMA_BO filled with the respective text (e.g. IPI or ICMS law).
The table is being maintained with the view J_1BNFLWCONDMMV for the materials-
management applications (KAPPL=TX).
Condition-based tax calculation in R/3 for Brazil 31
SAP Online Help 10/12/2011
J_1BT007
This table replaces the table T007_IT that was (mis)used up to release 4.6C to map tax codes
in two-step stock transfer processes. For a calculation procedure, three tax codes are mapped
against each other:
OUT_MWSKZ - Tax code used in the outgoing step
IN_MWSKZ - Tax code used in the incoming step
SD_MWSKZ - SD Tax code specified in deliveries in SD/MM transfer processes
A344
Condition table: BR: ICMS base reduction carrier
Component Comp. Type Short Text
MANDT MANDT Client
KAPPL KAPPL Application
KSCHL KSCHA Condition type
ALAND ALAND Departure country (country from which the goods are sent)
TAXBS TAXBS Tax Base in Percentage
DOCTYP J_1BDOCTYP Document type
DATBI KODATBI Validity end date of the condition record
DATAB KODATAB Validity start date of the condition record
KNUMH KNUMH Condition record number
A346
Condition table: BR: IPI rate determination
Component Comp. Type Short Text
MANDT MANDT Client
KAPPL KAPPL Application
KSCHL KSCHA Condition type
ALAND ALAND Departure country (country from which the goods are sent)
MATNR MATNR Material Number
STEUC STEUC Control code for consumption taxes in foreign trade
MATKL MATKL Material Group
MWSKZ MWSKZ Tax on sales/purchases code
LIFNR ELIFN Vendor's account number
KUNNR KUNNR_V Customer number
BRSCH BRSCH Industry key
CITYC CITYC City Code
DATBI KODATBI Validity end date of the condition record
DATAB KODATAB Validity start date of the condition record
KNUMH KNUMH Condition record number
A347
Condition table. BR: ICMS rate determination
Component Comp. Type Short Text
MANDT MANDT Client
KAPPL KAPPL Application
KSCHL KSCHA Condition type
ALAND ALAND Departure country (country from which the goods are sent)
TXREG_SF J_1BTXSHPF Ship from location (tax region)
TXREG_ST J_1BTXSHPT Ship to location (tax region)
MATNR MATNR Material Number
STEUC STEUC Control code for consumption taxes in foreign trade
MATKL MATKL Material Group
MWSKZ MWSKZ Tax on sales/purchases code
Condition-based tax calculation in R/3 for Brazil 32
SAP Online Help 10/12/2011
Component Comp. Type Short Text
LIFNR ELIFN Vendor's account number
KUNNR KUNNR_V Customer number
BRSCH BRSCH Industry key
CITYC CITYC City Code
DATBI KODATBI Validity end date of the condition record
DATAB KODATAB Validity start date of the condition record
KNUMH KNUMH Condition record number
A348
Condition table. BR: SubTrib rate determination
Component Comp. Type Short Text
MANDT MANDT Client
KAPPL KAPPL Application
KSCHL KSCHA Condition type
ALAND ALAND Departure country (country from which the goods are sent)
TXREG_SF J_1BTXSHPF Ship from location (tax region)
TXREG_ST J_1BTXSHPT Ship to location (tax region)
XSUBT J_1BTCST Customer group for Substituiao Tributria calculation
MATNR MATNR Material Number
STEUC STEUC Control code for consumption taxes in foreign trade
MATKL MATKL Material Group
MWSKZ MWSKZ Tax on sales/purchases code
LIFNR ELIFN Vendor's account number
KUNNR KUNNR_V Customer number
BRSCH BRSCH Industry key
CITYC CITYC City Code
DATBI KODATBI Validity end date of the condition record
DATAB KODATAB Validity start date of the condition record
KNUMH KNUMH Condition record number
A349
Condition table. BR: ICMS Complementar rate determination
Component Comp. Type Short Text
MANDT MANDT Client
KAPPL KAPPL Application
KSCHL KSCHA Condition type
ALAND ALAND Departure country (country from which the goods are sent)
TXREG_ST J_1BTXSHPT Ship to location (tax region)
MATNR MATNR Material Number
DATBI KODATBI Validity end date of the condition record
DATAB KODATAB Validity start date of the condition record
KNUMH KNUMH Condition record number
A382
Condition table. BR: ICMS rate
Component Comp. Type Short Text
MANDT MANDT Mandant
KAPPL KAPPL Applikation
KSCHL KSCHA Konditionsart
ALAND ALAND Lieferndes Land (Land aus dem die Ware versandt wird)
DOCTYP J_1BDOCTYP Belegart
TXREG_SF J_1BTXSHPF Sender (Steuerregion)
TXREG_ST J_1BTXSHPT Empfnger (Steuerregion)
Condition-based tax calculation in R/3 for Brazil 33
SAP Online Help 10/12/2011
Component Comp. Type Short Text
MATNR MATNR Materialnummer
STEUC STEUC Steuerungscode fr Verbrauchssteuern im Auenhandel
MATKL MATKL Warengruppe
MWSKZ MWSKZ Umsatzsteuerkennzeichen
LIFNR ELIFN Kontonummer des Lieferanten
KUNNR KUNNR_V Kundennummer
BRSCH BRSCH Branchenschlssel
CITYC CITYC City Code
DATBI KODATBI Gltigkeitsende des Konditionssatzes
DATAB KODATAB Gltigkeitsbeginn des Konditionssatzes
KNUMH KNUMH Nummer Konditionssatz
A392
Condition table. Country
Component Comp. Type Short Text
MANDT MANDT Mandant
KAPPL KAPPL Applikation
KSCHL KSCHA Konditionsart
ALAND ALAND Lieferndes Land (Land aus dem die Ware versandt wird)
DATBI KODATBI Gltigkeitsende des Konditionssatzes
DATAB KODATAB Gltigkeitsbeginn des Konditionssatzes
KNUMH KNUMH Nummer Konditionssatz
4.1.2 Views
J_1BCONDMAPV
This is the maintenance view of the table J_1BCONDMAP and its text table J_1BCONDMAPT.
See the description of the tables for details.
J_1BNFTXCONDMMV
This is the maintenance view of the table J_1BNFTXCOND for usage TX and application A.
See the description of the tables for details.
J_1BNFLWCONDMMV
This is the maintenance view of the table J_1BNFLWCOND for usage TX and application A.
See the description of the tables for details.
J_1BTAXCODEV
This is the maintenance view of the tax codes. It allows the simultaneous maintenance of tables
T007A and J_1BT007. See section 3.13 for further details.
J_1BTXIP3V, J_1BTXIC3V, J_1BTXIS3V, J_1BTXST3V
New maintenance views for the dynamic tax exceptions. Since release 4.7, dynamic exceptions
may have up to 3 dynamic key fields. The screens have been modified to provide the user with
an easy-to-understand user interface. The headers of the table control are modified
dynamically, based on the key fields of the respective tax group that are defined in
J_1BTXGRUOP.
The events 01 and 02 of the extended table maintenance (transaction SE54) trigger the
automatic generation of condition records when the data are saved. See section 4.8 for details.
Condition-based tax calculation in R/3 for Brazil 34
SAP Online Help 10/12/2011
J_1BCONDCALC
Help view used in the search help H_J_1B_T683S to display conditions used in a calculation
procedure.
4.1.3 Search Helps
H_J_1B_T683S
This search help is used in the tables J_1BNFTXCOND and J_1BNFLWCOND for the fields
containing condition types. Only those conditions are displayed in the search help list that are
used in the selected calculation procedure.
4.1.4 Data Elements
J_1BCONDREF
Reference type for the DDIC class CL_TAX_CONDITION. See section 4.4 for details about this
class.
J_1BCONDREF_TAB
Table type. Represents a standard table with lines of type J_1BCONDREF. Used in the
automatic generation of condition records during the view maintenance (see section 4.8).
J_1BKOMVMAP
Mapping of fields of the KOMV-like table of a calculation procedure to the Nota Fiscal. This data
element has as elementary type the domain J_1BKOMVMAP (see section 4.1.5). It is used in
the table J_1BNFTXCOND (see section 4.1.1).
J_1BTXCODE
Internal code of tax conditions; with elementary data type: domain J_1BTXCODE. Used in
tables J_1BCONDMAP, J_1BCONDMAPT, and J_1BTXCOND. See section 4.1.1 for details.
J_1BINMWSKZ
Tax code used in goods receipts. Elementary data type: domain MWSKZ. Used in table
J_1BT007.
J_1BOUTMWSKZ
Tax code used in goods issues. Elementary data type: domain MWSKZ. Used in table
J_1BT007.
J_1BSDMWSKZ
SD tax code used in the deliveries for a stock transport order. Elementary data type: domain
J_1BTXSDC. Used in table J_1BT007.
J_1B_TAXCOM
Structure with all Brazil-specific communication fields that have to be transferred between
materials management applications (purchase order, goods movements, invoice verification) to
the function group J1BCONDTAX in which the condition-based tax calculation is prepared
Component Comp. Type Short Text
STEUC STEUC Control code for consumption taxes in foreign trade
TXREG_SF J_1BTXSHPF Ship from location (tax region)
TXREG_ST J_1BTXSHPT Ship to location (tax region)
XXIPI J_1BTCIPI Customer is IPI-exempt
XICMS J_1BTCICMS Customer is ICMS-exempt
Condition-based tax calculation in R/3 for Brazil 35
SAP Online Help 10/12/2011
Component Comp. Type Short Text
XSUBT J_1BTCST Customer group for Substituiao Tributria calculation
TAXBS TAXBS Tax Base in Percentage
IPISP J_1BINDEQU Tax Split
DOCTYP J_1BDOCTYP Document type
MTORG J_1BMATORG Origin of the material
MTUSE J_1BMATUSE Usage of the material
OWNPR J_1BOWNPRO Produced in-house
MATKL MATKL Material Group
BRSCH BRSCH Industry key
CITYC CITYC City Code
LIFNR LIFNR Account Number of Vendor or Creditor
MGAME MENGE_D Quantity
VRKME VRKME Sales unit
KOMKBRAZIL
Include structure for Brazil-specific fields in the pricing communication structure KOMK.
Component Comp. Type Short Text
XSUBT J_1BTCST Customer group for Substituiao Tributria calculation
TAXBS TAXBS Tax Base in Percentage
IPISP J_1BINDEQU Tax Split
DOCTYP J_1BDOCTYP Document type
KOMPBRAZIL
Include structure for Brazil-specific fields in the pricing communication structure KOMP.
Component Comp. Type Short Text
TXREG_SF J_1BTXSHPF Ship from location (tax region)
TXREG_ST J_1BTXSHPT Ship to location (tax region)
MTUSE J_1BMATUSE Usage of the material
OWNPR J_1BOWNPRO Produced in-house
MTORG J_1BMATORG Origin of the material
4.1.5 Domains
J_1BKOMVMAP
Mapping of fields of the KOMV-like table of a calculation procedure to the Nota Fiscal. Data
type: NUMC 1. The domain has 3 fixed values:
Value Short text
0 Condition value
1 Condition rate/amount
2 Condition base
J_1BTXCODE
Internal codes of tax conditions. Data type: CHAR30. Allowed values are defined in table
J_1BCONDMAP (see section 4.1.1).
Condition-based tax calculation in R/3 for Brazil 36
SAP Online Help 10/12/2011
4.2 Changes of Existing DDIC Elements
4.2.1 Tables
J_1BTXIP3, J_1BTXIC3, J_1BTXIS3, J_1BTXST3
Since release 4.7, the dynamic exceptions may have up to 3 key fields. The primary keys of
these tax rate tables were extended correspondingly. The three dynamic key fields are VALUE,
VALUE2, and VALUE3.
J_1BTXGRUOP
The tax groups of dynamic exceptions can have 3 key fields. The primary key of this table was
extended correspondingly. The three key fields (of type J_1BTXFIELDS) are FIELD, FIELD2,
and FIELD3.
4.2.2 Views
J_1BTXIC1, J_1BTXIC2, J_1BTXIP1, J_1BTXIP2, J_1BTXCI1, J_1BTXIS1, J_1BTXST1,
J_1BTXST2, J_1BTXMMCV
The events 01 and 02 of the extended table maintenance (transaction SE54) now trigger the
automatic generation of condition records. See section 4.8 for details about the coding.
4.2.3 Data Elements
KOMG
This structure was extended to contain the Brazil-specific fields that are necessary to select
condition records during the tax calculation procedure. Since KOMG contains all fields of KOMP
and KOMK, see those elements for a description of the new fields.
KOMP
The Brazil-specific fields that are necessary to select condition records during the tax calculation
procedure are contained in the new include KOMPBRAZIL. See section 4.1.4 for details.
Furthermore, the field STEUC, used to store the NCM code, was included in the structure
J_1INKOMP that is new in KOMP as well.
KOMK
The Brazil-specific fields that are necessary to select condition records during the tax calculation
procedure are contained in the new include KOMKBRAZIL. See section 4.1.4 for details.
4.2.4 Domains
J_1BTXFIELDS
The field KONZS was removed from this domain, which contains the allowed key fields for
dynamic tax exceptions.
4.3 New Formulas
The following new formulas were created with transaction VOFM. They are used in the new tax
calculation procedure TAXBRC that is discussed in detail in section 5.3.
In the description of the essential mathematical formula that is behind the coding, the following
symbols are going to be used:
Condition-based tax calculation in R/3 for Brazil 37
SAP Online Help 10/12/2011
Symbol Variable in source code Description
a XKAWRT Condition base value
w XKWERT Condition value (result of calculation)
r XKOMV-KBETR Condition rate
D XWORKD Work field D
E XWORKE Work field E
The work fields have to be reset at the end of each formula because in the pricing logic the
values specified in the calculation procedure are added to the work fields instead of overwriting
the previous values.
4.3.1 Condition Value Formulas
4.3.1.1 Formula 177
Include: RV64A177
This formula is used to get the discount value that was previously stored in function group
J1BCONDTAX.
Source code
FORM FRM_KONDI_WERT_177.
CALL FUNCTION 'J_1B_GET_DISCOUNT'
exporting
i_index = komp-taxps
IMPORTING
E_KWERT = xkwert.
ENDFORM.
4.3.1.2 Formula 163
Include: FV64A163
This formula calculates a certain power of ten based on the condition base value. It is used to
achieve a higher precision in calculations to avoid rounding errors.
Mathematical formula:
n
w 10
Source code
FORM FRM_KONDI_WERT_163.
data: h1 type f,
n1 type i.
compute h1 = abs( xkawrt * 1000 ).
if h1 <> 0.
compute h1 = log10( h1 ).
else.
h1 = 3.
endif. .
compute h1 = trunc( h1 ).
n1 = h1 - 2.
if n1 < 3.
n1 = 3.
endif.
if n1 > 12.
n1 = 12.
endif.
h1 = 10 ** n1.
Condition-based tax calculation in R/3 for Brazil 38
SAP Online Help 10/12/2011
xkwert = h1 .
ENDFORM.
4.3.1.3 Formula 175
Include: RV64A175
This formula calculates the discount rate, a helping value that is used in the calculation of ICMS
consumption. It is scaled analog to formula 163 to a certain power of ten based on the condition
base value to avoid rounding errors. XWORKD contains the discount value, XKAWRT the net
base value.
Mathematical formula:
a D
D
w
n
+
10
Source code
FORM FRM_KONDI_WERT_175.
data: baseval type f,
discount type f,
dummy type f,
result type f.
data: h1 type f,
n1 type i.
* Determine scale factor to achieve necessary precision
compute h1 = abs( xkawrt * 1000 ).
if h1 <> 0.
compute h1 = log10( h1 ).
else.
h1 = 3.
endif. .
compute h1 = trunc( h1 ).
n1 = h1 - 2.
if n1 < 3.
n1 = 3.
endif.
if n1 > 12.
n1 = 12.
endif.
h1 = 10 ** n1.
* Rescale parameters
baseval = xkawrt / 100.
discount = xworkd / 100.
dummy = baseval + discount.
if dummy = 0.
exit.
endif.
result = discount / dummy .
* xkwert = 100000 * result.
xkwert = h1 * result.
clear xworkd.
ENDFORM. "FRM_KONDI_WERT_175
Condition-based tax calculation in R/3 for Brazil 39
SAP Online Help 10/12/2011
4.3.1.4 Formula 164
Include: FV64A164
This formula calculates the value inclusive ICMS. XKAWRT contains the net base value,
XWORKE the ICMS rate scaled with 10
n
, already reduced by the base rate (i.e. 10
n
*rate*base),
and XWORKD contains 10
n
.
Mathematical formula:
D
E
a
w

1
Source code
FORM FRM_KONDI_WERT_164.
data: baseval type f,
zehn_n type f,
redrate type f,
result type f,
chzero type f.
baseval = xkawrt.
zehn_n = xworkd.
redrate = xworke.
chzero = redrate / zehn_n.
if chzero = 1.
exit.
endif.
result = baseval / ( 1 - chzero ).
xkwert = result.
* Reset work fields
clear: xworkd,
xworke.
ENDFORM.
4.3.1.5 Formula 162
Include: FV64A162
This formula calculates the difference between XWORKD and XKAWRT. If the result is lower
than zero, it is set to zero.
Mathematical formula: ( ) a D w ; 0 max
Source code
FORM FRM_KONDI_WERT_162.
* Base value: XWAWRT
* Value + tax: XWORKD
xkwert = xworkd - xkawrt.
if xkwert < 0.
clear xkwert.
endif.
* Reset work field
clear xworkd.
ENDFORM.
4.3.1.6 Formula 171
Include: FV64A171
Condition-based tax calculation in R/3 for Brazil 40
SAP Online Help 10/12/2011
This formula returns XWORKD in case it is greater than zero. If not, XKAWRT is returned.
Mathematical formula:

'
>

else a
D if D
w
0
Source code
FORM FRM_KONDI_WERT_171.
if xworkd > 0.
xkwert = xworkd.
else.
xkwert = xkawrt.
endif.
clear xworkd.
ENDFORM.
4.3.1.7 Formula 165
Include: FV64A165
This formula is used in the calculation of ICMS consumption. XKAWRT, XWORKD, and
XWORKE are used.
Mathematical formula:
,
_


D
a
E w 1
Source code
FORM FRM_KONDI_WERT_165.
data: a type f,
d type f,
e type f,
result type f.
a = xkawrt.
d = xworkd.
e = xworke.
result = ( 1 - a / d ) * e.
xkwert = result.
clear: xworkd, xworke.
ENDFORM.
4.3.1.8 Formula 167
Include: FV64A167
This formula is used to take the value in XWORKA if the material usage, stored in KOMP-
MATUSE, is consumption. In case of industrialization, resale, or assets, the value in XWORKD
is taken.
Mathematical formula:

'

else
or if D
if a
w
0
3 , 1 , 0 MATUSE KOMP
2 MATUSE KOMP
Source code
FORM FRM_KONDI_WERT_167.
Condition-based tax calculation in R/3 for Brazil 41
SAP Online Help 10/12/2011
case komp-mtuse.
*--- resale, industralization, assets
when 0 or 1 or 3.
xkwert = xworkd.
*--- consumption
when 2.
xkwert = xkawrt.
when others.
xkwert = 0.
endcase.
clear xworkd.
ENDFORM.
4.3.1.9 Formula 169
Include: FV64A169
This formula is used in the calculation of Substituio Tributria to apply base reductions.
XKAWRT and XKOMV-KBETR are used.
Mathematical formula: ( ) r a w 1
Source code
FORM FRM_KONDI_WERT_169.
* Calculate "value * ( 1 - rate )" instead of "value * rate".
data: fbetr type f,
fawrt type f,
fwert type f.
if komp-mtuse = '2'.
xkwert = xkawrt.
else.
fbetr = xkomv-kbetr / 100000.
fawrt = xkawrt / 100.
fwert = fawrt * ( 1 - fbetr ).
xkwert = fwert * 100.
endif.
ENDFORM.
4.3.1.10 Formula 172
Include: FV64A172
This formula is used in the calculation of Substituio Tributria to return the minimum price if
the surcharge type has the value 3 (minprice or invoice value).
Mathematical formula:

'

else
r if a
w
0
3
Source code
FORM FRM_KONDI_WERT_172.
data: f type f.
f = xkomv-kbetr.
if f = 3000.
Condition-based tax calculation in R/3 for Brazil 42
SAP Online Help 10/12/2011
xkwert = xkawrt.
else.
xkwert = 0.
endif.
ENDFORM.
4.3.1.11 Formula 170
Include: FV64A170
This formula returns the greater value of XKAWRT and XWORKD.
Mathematical formula: ( ) D a w ; max
Source code
FORM FRM_KONDI_WERT_170.
if xworkd > xkawrt.
xkwert = xworkd.
else.
xkwert = xkawrt.
endif.
clear xworkd.
ENDFORM.
4.3.1.12 Formula 173
Include: FV64A173
This formula returns zero if XKOMV-KBETR is zero, and otherwise the base value.
Mathematical formula:

'

0 : 0
0 :
f
f a
w
Source code
FORM FRM_KONDI_WERT_173.
data: f type f.
f = xkomv-kbetr.
if f = 0.
xkwert = 0.
else.
xkwert = xkawrt.
endif.
ENDFORM.
4.3.1.13 Formula 176
Include: RV64A176
This formula is used in the calculation of ICMS complementar. XKOMV-KBETR contains an
exempt-flag. If XKOMV-KBETR is not zero, the formula returns zero. Otherwise, the product of
XWORKD and XKAWRT is returned, where XWORKD contains a tax rate.
Mathematical formula:

'

0 :
0 : 0
f D a
f
w
Condition-based tax calculation in R/3 for Brazil 43
SAP Online Help 10/12/2011
Source code
FORM FRM_KONDI_WERT_176.
data: f type f,
f_kwert type f,
f_kawrt type f,
f_xworkd type f.
f = xkomv-kbetr.
if f is initial .
f_kawrt = xkawrt .
f_xworkd = xworkd.
f_kwert = f_kawrt * f_xworkd / 100000.
else.
f_kwert = 0.
endif.
xkwert = f_kwert * 100.
clear xworkd.
ENDFORM. "FRM_KONDI_WERT_176
4.3.1.14 Formula 178
Include: RV64A178
This formula is used to get the freight value that was previously stored in function group
J1BCONDTAX.
Source code
FORM FRM_KONDI_WERT_178.
CALL FUNCTION 'J_1B_GET_FREIGHT'
exporting
i_index = komp-taxps
IMPORTING
E_KWERT = xkwert.
ENDFORM.
4.3.2 Condition Base Value Formulas
4.3.2.1 Formula 160
Include: FV63A160
This formula returns 1. It is used to store rates in the calculation procedure that can referred to
later.
Mathematical formula: 1 w
Source code
FORM FRM_KOND_BASIS_160.
xkwert = 1000. "1,000
ENDFORM.
4.3.2.2 Formula 161
Include: FV63A161
This formula is used to determine the IPI base. If the IPI-split-vendor flag KOMK-IPISP is set
and the condition with the internal code IPISPLIT is active, the base has to be reduced by 50%.
The IPISPLIT condition has to be stored in XWORKD previously.
Condition-based tax calculation in R/3 for Brazil 44
SAP Online Help 10/12/2011
Mathematical formula:

'

else a
D a
w
0 IPISP KOMK 0 : 2
Source code
FORM FRM_KOND_BASIS_161.
if xworkd <> 0 and komk-ipisp = 'X'.
xkwert = xkawrt / 2.
else.
xkwert = xkawrt.
endif.
* xkwert = xkwert / 100000.
ENDFORM.
4.3.2.3 Formula 162
Include: FV63A162
This formula scales the base value with 100 to display the correct amount of a rate in the Nota
Fiscal.
Mathematical formula: 100 a w
Source code
FORM FRM_KOND_BASIS_162.
xkwert = xkawrt * 100.
ENDFORM. "FRM_KOND_BASIS_162
4.3.2.4 Formula 163
Include: FV63A163
This formula clears the base value.
Mathematical formula: 0 w
Source code
FORM FRM_KOND_BASIS_163.
clear xkwert.
ENDFORM. "FRM_KOND_BASIS_163
4.3.2.5 Formula 164
Include: FV63A164
This formula multiplies the base value with -1. It is used in offset postings.
Mathematical formula: a w
Source code
FORM FRM_KOND_BASIS_164.
xkwert = 0 - xkomv-kawrt.
ENDFORM. "FRM_KOND_BASIS_164
4.3.3 Pricing Requirement Formulas
4.3.3.1 Formula 160
Include: LV61A160
Condition-based tax calculation in R/3 for Brazil 45
SAP Online Help 10/12/2011
This formula sets sy-subrc = 0 if the calling application is a purchase order or the inventory
management. Otherwise, sy-subrc is set to 4 which means that the condition is not fulfilled.
Source code
FORM KOBED_160.
sy-subrc = 0.
check xkomv-kposn = '999999'.
sy-subrc = 4.
ENDFORM.
FORM KOBEV_160.
sy-subrc = 0.
ENDFORM.
4.3.3.2 Formula 161
Include: LV61A161
This formula sets sy-subrc = 0 if the calling application is the invoice verification. Otherwise, sy-
subrc is set to 4 which means that the condition is not fulfilled.
Source code
FORM KOBED_161.
sy-subrc = 0.
check xkomv-kposn <> '999999'.
sy-subrc = 4.
ENDFORM.
FORM KOBEV_161.
sy-subrc = 0.
ENDFORM.
4.4 DDIC Class: CL_TAX_CONDITION
This class is an abstract base class that encapsulates the automatic generation, change, and
deletion of condition records. It contains also the class-method transfer_view_data that
transfers the changed view data to condition records.
The constructor needs to be provided with the following import parameters:
Parameter Description
I_DATEFINDER An optional reference parameter to an instance of a class derived
from CL_DATEFINDER. Serves to determine the valid to date of
condition records based on other entries in the database if only a
valid from date is available in a table from which condition records
are to be generated.
I_CODE Internal code of condition (from table J_1BCONDMAP) that has to
be mapped against a condition type in table J_1BTXCOND.
Indicates which condition is being maintained.
I_KAPPL Application; either TX or V.
I_TABNAME Name of the table that contains the records whose fields are being
converted to condition records by the instance of this class.
I_GET_COND_TABLE A flag that indicates whether the number of the condition table is to
be determined only once at the creation of the instance of the class
by reading the entry in J_1BVIEWMAP. If the flag is not set, the
condition table has to be determined before a condition is changed.
Condition-based tax calculation in R/3 for Brazil 46
SAP Online Help 10/12/2011
Parameter Description
This is necessary if the table I_TABNAME contains records that do
not all belong to one condition table. An example are the tables
J_1BTX*3 with the dynamic tax exceptions (look at function group
J1BW to find examples).
I_DELETE_IF_ZERO A flag that indicates how to proceed in case the value of the
condition record that is to be created is zero. If this flag is set (per
default it is not set), no condition record will be created if the value
of the record (KBETR) is zero. If an existing record is to be changed
and the new value is zero, this record will be deleted instead. The
flag is being set in the views J_1BTREGV or J_1BTAXCODEV, for
example.
Derived classes have to implement the method fill_values in which some class attributes have
to be provided with values: the key fields m_wa_keyfields, the dates m_date_from and
m_date_to, possibly the number of the condition table m_condition_table, and the values of
the fields of the condition record m_wa_komv.
Condition records are being generated, changed and deleted by calling the public methods
new, change, and delete, respectively.
The class can be utilized when condition records shall be maintained automatically in the
background. Examples can be found in function groups J1BQ, J1BW, and J1B0 which contain
coding that generates condition records during the maintenance of the Brazilian tax tables.
4.5 DDIC Class: CL_DATE_DETERMINE
This class is an abstract base class that serves to determine the valid to date of items in a
table with records having a validity period that, however, only have information about the valid
from date. It is used to generate condition records (that have validity periods with valid from
and valid to dates) out of entries in the Brazilian tax rate tables that have only the valid from
date.
Examples how to use the class can be found in function groups J1BQ, J1BW, and J1B0, as well
as in the program J_1B_MIGRATE_TAX_RATES.
4.6 DDIC Class: CL_KEYFINDER
This class is used in the automatic generation of condition records of tables that contain
dynamic exceptions. Since the tax group can vary from table line to table line, the key fields and
the condition table can vary as well and thus have to be determined in each loop.
The two methods of the class, get_condition_table and fill_key_fields, are called in the
method fill_values of the condition classes that process the table lines.
4.7 Business Add-In: TAX_CONDITIONS
This BAdI is used to implement country-specific extensions before and after the calls to the
pricing during the tax calculation. It is filter-dependent with the country ISO-code INTCA as filter
type.
The interface, IF_EX_TAX_CONDITIONS, consists of two methods.
4.7.1 Method FILL_KOMK_KOMP
This method is used to modify the communication structures KOMK and KOMP before the
pricing is called. It can be called after the application has filled KOMK and KOMP to fill country-
specific fields.
Condition-based tax calculation in R/3 for Brazil 47
SAP Online Help 10/12/2011
Parameter Type Pass
Value
Opt. Typing
Method
Assoc.
Type
Description
FLT_VAL Importing X Type INTCA Country Key
I_INDEX Importing X X Type N Index in Internal Table with
Control Fields (IV)
CH_KOMK Changing Type KOMK Communication Header for
Pricing
CH_KOMP Changing Type KOMP Pricing Communication Item
4.7.2 Method PROCESS_TKOMV
This method can be called after the pricing to modify or save the table TKOMV that contains the
table of the active lines of the calculation procedure.
Parameter Type Pass
Value
Opt. Typing
Method
Assoc.
Type
Description
FLT_VAL Importing X Type INTCA Country Key
I_KOMK Importing Type KOMK Communication Header for
Pricing
I_KOMP Importing Type KOMP Pricing Communication Item
CH_TKOMV Changing Type KOMV_TAB Table Type KOMV
4.8 Automatic Generation of Condition Records in the View
Maintenance
The views of the Brazilian tax data have been modified to trigger an event in the extended table
maintenance (transaction SE54): Event 01 is triggered after the user has chosen to save the
data, but before the data are saved in the database.
The views that were modified in this way are listed in the following table.
View Function group Include with Events Include with Classes
J_1BTXIC1 J1BQ LJ1BQF05 LJ1BQCL4
J_1BTXIC2 J1BQ LJ1BQF04 LJ1BQCL3
J_1BTXIC3V J1BW LJ1BWF03 LJ1BWCL2
J_1BTXCI1 J1BQ LJ1BQF08 LJ1BQCL7
J_1BTXIP1 J1BQ LJ1BQF03 LJ1BQCL2
J_1BTXIP2 J1BQ LJ1BQF02 LJ1BQCL1
J_1BTXIP3V J1BW LJ1BWF02 LJ1BWCL1
J_1BTXIS1 J1BQ LJ1BQF06 LJ1BQCL5
J_1BTXIS3V J1BW LJ1BWF04 LJ1BWCL3
J_1BTXST1 J1BQ LJ1BQF07 LJ1BQCL6
J_1BTXST2 J1B0 LJ1BWF01 LJ1BWCL1
J_1BTXST3V J1BW LJ1BWF05 LJ1BWCL4
J_1BTAXCODEV J1BCONDTAX LJ1BCONDTAXF03 LJ1BCONDTAXCL1
J_1BTXSDCV J1BQ LJ1BQF12 LJ1BQCLB
J_1BTXDEF J1BQ LJ1BQF10 LJ1BQCL9
J_1BTREGV J1BQ LJ1BQF11 LJ1BQCLA
J_1BTXMMCV J1BQ LJ1BQF09 LJ1BQCL8
The way conditions are maintained automatically follows the same scheme for all views. Please
refer to the respective coding in the mentioned includes to see all details. Here, only a general
overview about the steps is given.
Condition-based tax calculation in R/3 for Brazil 48
SAP Online Help 10/12/2011
4.8.1 Classes
If the tax table has no valid to date, define a datefinder class derived from the DDIC
class CL_DATE_DETERMINE (section 4.5). Implement the two methods
compare_items and get_validfrom_date_from_item that are abstract in the base
class. Compare_items has to determine whether all key fields of the respective table
item are the same. Get_validfrom_date_from_item has to return the valid from field
of the respective table line.
For each condition type for which records are to be created define a class that is derived
from the DDIC class CL_TAX_CONDITION (see section 4.4).
In case of dynamic exceptions add a private member to the class that contains a
reference to the DDIC class CL_KEYFINDER (see section 4.6). Redefine the constructor
so that a reference to a CL_KEYFINDER object is imported.
Implement the method fill_values that is abstract in the base class. Here, all the key
fields and condition data fields have to be provided with values. The method has to be
implemented because this task is specific for every table. If the tax table has no valid to
date, use the method determine_valid_to_date from the member variable
m_obj_datefinder to get the date.
4.8.2 Event 01
Check if condition-based tax calculation is active at all.
Create instances of all needed classes, i.e. the classes derived from
CL_TAX_CONDITION, possibly the datefinder class, and possibly a keyfinder class.
Append all condition objects to a table of type J_1B_CONDREF_TAB.
Call the class-method cl_tax_condition=>transfer_view_data, exporting the internal view
table total[], the name of the DDIC table that is maintained by the view, the table with the
condition object references, and, optionally, the datefinder object reference. In this
method, the condition records are created, changed, or deleted depending on the
changes on the respective view entry.
4.8.3 Function Module J_1B_TRANSFER_TAX_CONDITION
This new function module in function group J1BQ processes one line of the view. It loops over a
table of objects of type CL_TAX_CONDITION and calls either the method new, change, or
delete in case the view line has changed.
This function module is only used in the event 1 of the view maintenance of the table J_1BTXDEF
that contains the default tax rates. In all other views, the class method
cl_tax_condition=>transfer_view_data is used instead as described in section 4.8.2.
Condition-based tax calculation in R/3 for Brazil 49
SAP Online Help 10/12/2011
5 Standard Customizing
5.1 Access Sequences MM
Table 5-3: Access sequences used in the MM (FI) tax calculation
AccSeq Description
BRB1 Dummy 1 for Brazil
BRCI Brazil ICMS Complement
BRIB Brazil ICMS Base
BRIC Brazil ICMS
BRID Brazil ICMS Rate SF=ST
BRIF Brazil ICMS Freight
BRIP Brazil IPI
BRIR Brazil ICMS Rate and Freight
BRIS Brazil ISS
BRLC Brazil Tax Law: ICMS
BRLP Brazil Tax Law: IPI
BRST Brazil Subtrib.
BRTF Brazil: Tax-Exempt
5.2 Condition Types MM
Documentation of condition types is still in progress.
5.3 Calculation Procedure in MM (FI): TAXBRC
The calculation procedure TAXBRC is used in the FI tax calculation, which is called in MM
transactions. This calculation procedure is assigned to the country in table T005.
Documentation of calculation procedure is still in progress.
5.3.1 Step 100
To be documented
5.3.2 Step 110
To be documented
5.4 Internal Condition Codes
Table 5-4: Internal condition codes used in the CBT
TxCondCode Description Tax Group
ICMSBASE ICMS Reduced Base Rate ICMS
ICMSCOMPBASE ICMS Complement, Tax Base
ICMSCOMPEXEMPT ICMS Complement, Tax Exemption
ICMSCONV100 ICMS Code: Convnio 100 ICMS
ICMSDISCOUNT ICMS Indicator Tax-Free Region
ICMSFREIGHT ICMS on Freight ICMS
ICMSLAW ICMS Tax Law ICMS
ICMSNULLEXEMPT ICMS Base in Exempt Base If Not ICMS-Relevant
ICMSOTHER ICMS Code: Other Base ICMS
ICMSRATE ICMS Tax Rate ICMS
IPIBASE IPI Reduced Base Rate IPI
IPILAW IPI Tax Law IPI
Condition-based tax calculation in R/3 for Brazil 50
SAP Online Help 10/12/2011
TxCondCode Description Tax Group
IPINULLEXEMPT IPI Base in Exempt Base If Not IPI-Relevant
IPIOTHER IPI Code: Other Base IPI
IPIPAUTA IPI Pauta Rate IPI
IPIRATE IPI Tax Rate IPI
ISSRATE ISS Tax Rate ISS
SUBTRIBBASE1 Substituio Tributria Red. Base 1 ICST
SUBTRIBBASE2 Substituio Tributria Red. Base 2 ICST
SUBTRIBFIXPRICE Substituio Tributria Fixed Price ICST
SUBTRIBICMS Substituio Tributria ICMS Reduction ICST
SUBTRIBMINPRICE Substituio Tributria Minimum Price ICST
SUBTRIBSURCHARGE Substituio Tributria Surcharge Rate ICST
SUBTRIBSURTYPE Substituio Tributria Calculation Rule ICST
TAXFREEREGION Tax Free Region Indicator (Zona Franca)
TXSDCICMS SD Tax Code: Calculate ICMS
TXSDCICMSFREIGHT SD Tax Code: Calculate ICMS on Freight
TXSDCINDUS SD Tax Code: Material Usage Indicator
TXSDCIPI SD Tax Code: Calculate IPI
TXSDCISS SD Tax Code: Calculate ISS
TXSDCSUBTRIB SD Tax Code: Calculate Substituio Tributria
TXSDCSUBTRIBFREIGHT SD Tax Code: Calculate SubTrib on Freight
5.5 Assignment of Condition Types to Internal Codes
Table 5-5: SAP standard assignment of condition types to internal codes
Internal TC Code App CTyp
ICMSBASE TX BIC1
ICMSBASE V ICBS
ICMSCOMPBASE TX BCI1
ICMSCOMPBASE V ICCB
ICMSCOMPEXEMPT TX BCI2
ICMSCOMPEXEMPT V ICCX
ICMSCONV100 TX B100
ICMSCONV100 V I100
ICMSDISCOUNT TX ICZF
ICMSDISCOUNT V ICZF
ICMSFREIGHT TX BIC0
ICMSFREIGHT V ICFR
ICMSLAW TX BLIC
ICMSLAW V ICLW
ICMSNULLEXEMPT TX BICX
ICMSOTHER TX BIC2
ICMSOTHER V ICOB
ICMSRATE TX BIC0
ICMSRATE V ICVA
IPIBASE TX BIP1
IPIBASE V IPBS
IPIBASE_MM TX IPI3
IPILAW TX BLIP
IPILAW V IPLW
IPINULLEXEMPT TX BIPX
IPIOTHER TX BIP2
IPIOTHER V IPOB
IPIOTHER_MM TX IPI3
IPIPAUTA TX BIPP
Condition-based tax calculation in R/3 for Brazil 51
SAP Online Help 10/12/2011
Internal TC Code App CTyp
IPIPAUTA V IPIP
IPIRATE TX BIP0
IPIRATE V IPVA
IPIRATE_MM TX IPI3
ISSRATE TX BIS0
ISSRATE V ISVA
SUBTRIBBASE1 TX BST6
SUBTRIBBASE1 V ISTB
SUBTRIBBASE2 TX BST7
SUBTRIBBASE2 V IST2
SUBTRIBFIXPRICE TX BST3
SUBTRIBFIXPRICE V ISTF
SUBTRIBICMS TX BST8
SUBTRIBICMS V ISTC
SUBTRIBMINPRICE TX BST2
SUBTRIBMINPRICE V ISTM
SUBTRIBSURCHARGE TX BST0
SUBTRIBSURCHARGE V ISTS
SUBTRIBSURTYPE TX BST1
SUBTRIBSURTYPE V ISTT
5.6 Assignment of Tax Rate Tables to Condition Tables
Table 5-6: Assignment of Brazil-specific tax tables to condition tables
Table Name Tax Group Condition Table
J_1BTAXCODEV 3
J_1BTREGX 394
J_1BTXCI1 349
J_1BTXDEF 392
J_1BTXIC1 382
J_1BTXIC2 382
J_1BTXIC3 any
*
382
J_1BTXIP1 346
J_1BTXIP2 346
J_1BTXIP3 any* 346
J_1BTXIS1 121
J_1BTXIS3 any* 347
J_1BTXSDC 291
J_1BTXST1 348
J_1BTXST2 348
J_1BTXST3 any* 348
5.7 Definition of Tax Types
Table 5-7: Definition of Brazilian tax types
TxTy TxGr Description LPP
IC1C ICMS ICMS Clearing
IC1O ICMS ICMS Ind. Clear. Off.
ICM0 ICMS ICMS NF Zero Line Consumption
*
SAP does not deliver standard Customizing of dynamic tax exeptions. If you create new tax groups you have to specify a new entry for
each group you use. In SAPs standard concept, the condition table is the same for all tax groups (see section 3.4). However, should you
need to follow a different concept of Customizing access sequences you can specify different condition tables per tax group. We
recommend to stay with the standard concept of one tax group per table.
Condition-based tax calculation in R/3 for Brazil 52
SAP Online Help 10/12/2011
TxTy TxGr Description LPP
ICM1 ICMS ICMS Deductible X
ICM2 ICMS ICMS Non-deductible X
ICM3 ICMS ICMS from SD Industralization
ICM4 ICMS ICMS from SD Consumption
ICM5 ICMS ICMS Deductible with LPP X
ICM6 ICMS ICMS Industr. non Deductible X
ICM7 ICMS ICMS Industr. non Ded. retail X
ICM8 ICMS ICMS Industr. non Ded. retail X
ICM9 ICMS ICMS transfer non Ded. retail X
ICMF ICMS ICMS on freight offset
ICMN ICMS ICMS zero line industralizatio
ICMX ICMS Icms active X
ICOP ICOP Complement of ICMS X
ICOT ICOP Complement of ICMS
ICS1 ICST ICMS Sub.Trib. X
ICS2 ICST ICMS Sub.Trib. Non-deductible
ICS3 ICST ICMS Sub.Trib. from SD
ICS4 ICST ICMS Sub.Trib. X
ICS5 ICST ICMS Sub.Trib. Non-deductible X
ICS6 ICST ICMS Sub.Trib. Non-deductible
ICS7 ICST ICMS Sub.Trib. Non-deductible X
ICS8 ICST ICMS Sub.Trib. Non-deductible
ICS9 ICST ICMS Sub.Trib. Non-deductible
ICZF ICMS ICMS Discount Zona Franca
ICZT ICMS ICSM TF to ZF
IFR1 ICFR ICMS on freight
IFR3 ICFR ICMS on freight from SD
IFS1 ICFS ICMS Sub.Trib. on freight
IFS3 ICFS ICMS Sub.Trib. on freight SD
IP1C IPI IPI clearing
IP1O IPI IPI Ind.Clear.Off.
IPI0 IPI IPI zero line consumption X
IPI1 IPI IPI Deductible
IPI2 IPI IPI Non-deductible X
IPI3 IPI IPI from SD Industralization
IPI4 IPI IPI from SD Consumption
IPI5 IPI IPI Deductible X
IPIA IPI IPI industr. outgoinng NF
IPIB IPI IPI consum. outgoing NF
IPIN IPI IPI zero line industralization
IPIX IPI IPI active X
IRD1 RBIC ICMS Reimbursement X
IRD2 RBIC ICMS Reimbur. offset X
IRD3 RBST SUBT Reimbursement X
IRD4 RBST SUBT Reimbur. offset X
IRD5 RBIC ICMS Reim.offset NVV X
IRD6 RBST SUBT Reim.offset NVV X
ISS2 ISS ISS from MM
ISS3 ISS ISS from SD
ISSO ISS ISS from MM Offset
5.8 Standard Tax Codes
In the Brazilian localization tax codes are used to determine
- which type of taxes are calculated for a line item,
- the usage of the material on the incoming side (MM),
- and how the taxes are posted in FI (separate line items or not).
Condition-based tax calculation in R/3 for Brazil 53
SAP Online Help 10/12/2011
To simplify the documentation only the active lines per tax codes are listed.
Note: The Tax Codes described here refer to the Condition Based Tax Calculation
Procedure TAXBRC. Therefore they have a different definition than the former tax
codes used for TAXBRJ. The differences are displayed as follows: Additional lines are
displayed in bold blue, removed lines in red strikethrough. In case it is required to use
both Condition Based Tax Calculation and the classic tax calculation in the same
system, it might be necessary to clone the existing tax codes and apply the
modification to the cloned tax codes. In this case it is also necessary to make sure that
the correct set of tax codes is being applied in the respective transactions.
5.8.1 Tax codes for non taxable transactions
For non taxable transactions special tax codes have to be defined on company code level. In
the properties of these tax code the field Relevant to tax must be set to 2:
Tax code IE
Input: Tax exempt transactions
Tax type Acc. key Rate Condition type
Base amount BASB
Level 200
IPI Industr. VS1 IPI1
Tax code SE
Output: Tax exempt transactions
Tax type Acc. key Rate Condition type
Base amount BASB
Level 200
IPI Industr. VS1 IPI1
5.8.2 Tax codes for incoming movements - Industrialization
For each of the industrialization tax codes the field Usage of the Brazilian tax code
enhancements to be set to Industrialization.
Tax code I0
Input: Industrialization: No tax
Tax type Acc.
key
Rate Condition type
Base amount BASB
Tax Law IPI 100,000 BLIP
Tax Law ICMS 100,000 BLIC
ICMS exempt 0,000 BCIX
ICMS NF nullv. Indus VST 100,000 ICMN
IPI NF nullv. Indus VST 100,000 IPIN
Level 200
IPI Indus.In VS1 0,000 IPI1
Tax code I1
Input: Industrialization: ICMS
Tax type Acc.
key
Rate Condition type
Condition-based tax calculation in R/3 for Brazil 54
SAP Online Help 10/12/2011
Base amount BASB
Tax Law IPI 100,000 BLIP
Tax Law ICMS 100,000 BLIC
ICMS Industr. In VS1 100,000 ICM1
ICMS exempt 0,000 BICX
ICMS active 100,000 ICMX
IPI NF nullv. Indus VST 100,000 IPIN
Tax code I2
Input: Industrialization: ICMS+
Sub.Trib.
Tax type Acc.
key
Rate Condition type
Base amount BASB
Tax Law IPI 100,000 BLIP
Tax Law ICMS 100,000 BLIC
ICMS Industr. In VS1 100,000 ICM1
ICMS exempt 0,000 BICX
ICMS active 100,000 ICMX
IPI NF nullv. Indus VST 100,000 IPIN
Sub.Tributaria In VS3 100,000 ICS1
Tax code I3
Input: Industrialization:
ICMS+IPI
Tax type Acc.
key
Rate Condition type
Base amount BASB
Tax Law IPI 100,000 BLIP
Tax Law ICMS 100,000 BLIC
ICMS Industr. In VS1 100,000 ICM1
ICMS exempt 0,000 BICX
ICMS active 100,000 ICMX
IPI active 100,000 IPIX
IPI Industr. In VS2 100,000 IPI1
Tax code I4
Input: Industrialization:
ICMS+IPI+Sub.Trib.
Tax type Acc.
key
Rate Condition type
Base amount BASB
Tax Law IPI 100,000 BLIP
Tax Law ICMS 100,000 BLIC
ICMS Industr. In VS1 100,000 ICM1
ICMS exempt 0,000 BICX
ICMS active 100,000 ICMX
IPI active 100,000 IPIX
IPI Industr. In VS2 100,000 IPI1
Sub.Tributaria In VS3 100,000 ICS1
Tax code I5
Input: Industrialization: IPI only
Tax type Acc.
key
Rate Condition type
Base amount BASB
Tax Law IPI 100,000 BLIP
Condition-based tax calculation in R/3 for Brazil 55
SAP Online Help 10/12/2011
Tax Law ICMS 100,000 BLIC
ICMS exempt 0,000 BICX
ICMS NF nullv. Indus VST 100,000 ICMN
IPI active 100,000 IPIX
IPI Industr. In VS2 100,000 IPI1
Tax code I6
Input: Ind.: ICMS+IPI: Reselling
Tax type Acc. key Rate Condition type
Base amount BASB
Level 200
ICMS Industr. VS2 100,000 ICM1
Level 300
IPI Consumption NVV 100,000 IPI2
Tax code I7
Input: Ind.: ICMS+Sub.Trib.+IPI :
Reselling
Tax type Acc. key Rate Condition type
Base amount BASB
Level 200
ICMS Industr. VS2 100,000 ICM1
Sub.Tributaria VS3 100,000 ICS1
Level 300
IPI Consumption NVV 100,000 IPI2
5.8.3 Tax codes for incoming movements - Consumption
For each of the industrialization tax codes the field Usage of the brazilian tax code
enhancements to be set to Consumption.
Tax code C0
Input: Consumption: No tax
Tax type Acc.
key
Rate Condition type
Base amount BASB
Tax Law IPI 100,000 BLIP
Tax Law ICMS 100,000 BLIC
ICMS exempt 0,000 BCIX
ICMS NF nullv. Cons. VST 100,000 ICM0
IPI nullvalues NF VST 100,000 IPI0
IPI Indus.In VS1 0,000 IPI1
Tax code C1
Input: Consumption
ICMS+Compl.
Tax type Acc.
key
Rate Condition type
Base amount BASB
Tax Law IPI 100,000 BLIP
Tax Law ICMS 100,000 BLIC
ICMS exempt 0,000 BCIX
ICMS active 100,000 ICMX
ICMS Consumption In NVV 100,000 ICM2
IPI nullvalues NF VST 100,000 IPI0
ICMS complement ICP 100,000 ICOP
ICMS complement 100 ICX 100,000- ICOX
Condition-based tax calculation in R/3 for Brazil 56
SAP Online Help 10/12/2011
Tax code C2
Input: Consumption
ICMS+Compl.+ Sub.Trib.
Tax type Acc.
key
Rate Condition type
Base amount BASB
Tax Law IPI 100,000 BLIP
Tax Law ICMS 100,000 BLIC
ICMS exempt 0,000 BCIX
ICMS active 100,000 ICMX
ICMS Consumption In NVV 100,000 ICM2
IPI nullvalues NF VST 100,000 IPI0
S.T. Consumption In NVV 100,000 ICS2
ICMS complement ICP 100,000 ICOP
ICMS complement 100 ICX 100,000- ICOX
Tax code C3
Input: Consumption
ICMS+Compl.+IPI
Tax type Acc.
key
Rate Condition type
Base amount BASB
Tax Law IPI 100,000 BLIP
Tax Law ICMS 100,000 BLIC
ICMS exempt 0,000 BCIX
ICMS active 100,000 ICMX
IPI active 100,000 IPIX
IPI Consumption In NVV 100,000 IPI2
ICMS Consumption In NVV 100,000 ICM2
ICMS complement ICP 100,000 ICOP
ICMS complement 100 ICX 100,000- ICOX
Tax code C4
Input: Consumption
ICMS+Compl.+IPI+Sub.Trib.
Tax type Acc.
key
Rate Condition type
Base amount BASB
Tax Law IPI 100,000 BLIP
Tax Law ICMS 100,000 BLIC
ICMS exempt 0,000 BCIX
ICMS active 100,000 ICMX
IPI active 100,000 IPIX
IPI Consumption In NVV 100,000 IPI2
ICMS Consumption In NVV 100,000 ICM2
S.T. Consumption In NVV 100,000 ICS2
ICMS complement ICP 100,000 ICOP
ICMS complement 100 ICX 100,000- ICOX
Tax code C5
Input Consumption IPI
Tax type Acc.
key
Rate Condition type
Base amount BASB
Tax Law IPI 100,000 BLIP
Tax Law ICMS 100,000 BLIC
ICMS exempt 0,000 BCIX
Condition-based tax calculation in R/3 for Brazil 57
SAP Online Help 10/12/2011
IPI active 100,000 IPIX
IPI Consumption In NVV 100,000 IPI2
ICMS NF nullv. Indus VST 100,000 ICMN
5.8.4 Tax codes for incoming movements - ICMS Sub.Trib. on freight
For the processing of ICMS Sub.Trib. on freight special tax codes are necessary to support the
required posting logic. Depending on the material usage of the respective material a different
tax code must be used (industrialization / consumption). The calculation and posting of the tax is
the same for both tax codes:
Tax code IF
Input: Ind.: ICMS (S.T. on freight)
Tax type Acc. key Rate Condition type
Base amount BASB
Level 200
ICMS Industr. VS2 100,000 ICM1
ICMS S.T. freight offset IC1 100,000 ICMF
Tax code CF
ICMS + ICMS Freight Cons.
Incoming
Tax type Acc.
key
Rate Condition type
Base amount BASB
Tax Law IPI 100,000 BLIP
Tax Law ICMS 100,000 BLIC
ICMS exempt 0,000 BCIX
ICMS active 100,000 ICMX
ICMS Consumption In NVV 100,000 ICM2
IPI nullvalues NF VST 100,000 IPI0
ICMS S.T. freight offset VS3 100,000 ICMF
5.8.5 Tax codes for incoming movements - Future delivery purchasing /
Consignment
Tax code K0
Future Delivery purchasing G/R
Tax type Acc.
key
Rate Condition type
Base amount BASB
Tax Law IPI 100,000 BLIP
Tax Law ICMS 100,000 BLIC
ICMS Industr. In VS1 100,000 ICM1
ICMS exempt 0,000 BCIX
ICMS active 100,000 ICMX
IPI nullv. Indus VST 100,000 IPIN
ICMS Ind. clearing offset ICC 100,000- IC1O
Tax code K1
Future Delivery purchasing I/R
Tax type Acc.
key
Rate Condition type
Base amount BASB
Condition-based tax calculation in R/3 for Brazil 58
SAP Online Help 10/12/2011
Tax Law IPI 100,000 BLIP
Tax Law ICMS 100,000 BLIC
ICMS exempt 0,000 BCIX
ICMS NF nullv. Indus VST 100,000 ICMN
IPI active 100,000 IPIX
IPI Industr. In VS2 100,000 IPI1
ICMS Ind. clearing ICC 100,000 IC1C
Tax code K2
Future Delivery purchasing G/R
Industr. All taxes
Tax type Acc. key Rate Condition type
Base amount BASB
Level 200
IPI Industrialization VS1 100,000 IPI1
ICMS Industrialization VS2 100,000 ICM1
IPI Ind. clearing offset IPC 100,000- IP1O
ICMS Ind. clearing offset ICC 100,000- IC1O
Tax code K3
Future Delivery purchasing I/R
Industr. Statistik taxes
Tax type Acc. key Rate Condition type
Base amount BASB
Level 200
IPI Ind. clearing IPC 100,000 IP1C
ICMS Ind. clearing ICC 100,000 IC1C
Tax code K5
Consignment Shipment G/R
Tax type Acc.
key
Rate Condition type
Base amount BASB
Tax Law IPI 100,000 BLIP
Tax Law ICMS 100,000 BLIC
ICMS Industr. In VS1 100,000 ICM1
ICMS exempt 0,000 BCIX
ICMS active 100,000 ICMX
IPI active 100,000 IPIX
ICMS Ind. clearing offset ICC 100,000- IC1O
IPI Ind. clearing offset IPC 100,000- IP1O
Tax code K6
Consignment: Invoice I/R
Tax type Acc.
key
Rate Condition type
Base amount BASB
Tax Law IPI 100,000 BLIP
Tax Law ICMS 100,000 BLIC
ICMS exempt 0,000 BCIX
ICMS active 100,000 ICMX
IPI active 100,000 IPIX
ICMS Ind. clearing ICC 100,000 IC1C
IPI Ind. clearing IPC 100,000 IP1C
Tax code K8
Future Delivery purchasing G/R
Condition-based tax calculation in R/3 for Brazil 59
SAP Online Help 10/12/2011
Resale All taxes
Tax type Acc. key Rate Condition type
Base amount BASB
Level 200
ICMS Industrialization VS2 100,000 ICM1
ICMS Ind. Clearing offset ICC 100,000- IC1O
Level 300
IPI Consumption In NVV 100,000 IPI2
Tax code K9
Future Delivery purchasing I/R
Resale Statistik taxes
Tax type Acc. key Rate Condition type
Base amount BASB
Level 200
ICMS Ind. Clearing ICC 100,000 IC1C
Level 300
IPI Consumption In NVV 100,000 IPI2
Tax code KA
Input: Consi Consumption
ICMS+IPI
Tax type Acc.
key
Rate Condition type
Base amount BASB
Tax Law IPI 100,000 BLIP
Tax Law ICMS 100,000 BLIC
ICMS exempt 0,000 BCIX
ICMS active 100,000 ICMX
IPI active 100,000 IPIX
IPI Consi. Consumption NVV 100,000 IPIK
ICMS Consi. Consumption NVV 100,000 ICMK
Tax code KB
Consignment - Invoice I/R Resale
Tax type Acc. key Rate Condition type
Base amount BASB
Level 200
ICMS Ind. Clearing ICC 100,000 IC1C
Level 300
IPI Consumption In NVV 100,000 IPI2
5.8.6 Tax codes for incoming movements - Services - ISS and INSS
For the incoming services tax code the field Service of the Brazilian tax code enhancements
has to be marked.
Tax code I9
Input: ISS
Tax type Acc. key Rate Condition type
Base amount BASB
Level 200
IPI Industr. VS1 IPI1
Condition-based tax calculation in R/3 for Brazil 60
SAP Online Help 10/12/2011
For INSS the tax code must contain the proper tax rate (here: 15% INSS)
Tax code IN
Input: Consi Consumption
ICMS+IPI
Tax type Acc.
key
Rate Condition type
Base amount BASB
INSS Incoming VST 15,00 INSS
INSS offset (100-) INX 100- INSX
5.8.7 Tax codes for outgoing movements - Ind.+Cons. posted in SD
For each of these tax codes the field Usage of the Brazilian tax code enhancements to be set
to Industrialization as a default. In SD the usage of the product by the customer is always taken
from the Brazil specific SD tax code in the sales order item.
Tax code SD
Output-SD tax:
IPI/ICMS/Sub.Trib.
Tax type Acc.
key
Rate Condition type
Base amount BASB
Tax Law IPI 100,000 BLIP
Tax Law ICMS 100,000 BLIC
ICMS exempt 0,000 BCIX
ICMS from SD MV2 100,000 ICM3
IPI from SD out MW1 100,000 IPIA
IPI consum out MW1 100,000 IPIB
IPI from SD M W 1 100,000 IPI3
Substituicao Tributaria MV3 100,000 ICS3
Tax code SZ
Output-SD tax: ICMS Zona Franca
Tax type Acc. key Rate Condition type
Base amount BASB
Level 500
ICMS from SD MV2 100,000 ICM3
Substituicao Tributaria MV3 100,000 ICS3
ICMS Reversal (Zona Franca) ICZ 100,000 ICZF
Tax code S0
Output-SD tax: No tax
Tax type Acc. key Rate Condition type
Base amount BASB
Level 500
IPI from SD MW1 IPI3
ICMS from SD MV2 ICM3
Substituicao Tributaria MV3 ICS3
ISS from SD MV4 ISS3
For the outgoing services tax code the field Service of the brazilian tax code enhancements
has to be marked.
Condition-based tax calculation in R/3 for Brazil 61
SAP Online Help 10/12/2011
Tax code SI
Output-SD tax: ISS
Tax type Acc. key Rate Condition type
Base amount BASB
Level 500
ISS from SD MV4 100,000 ISS3
5.8.8 Tax codes for transfer postings - outgoing movements - Ind.+Cons.
For the MM-IM transfer postings the following tax codes can be used for outgoing movements.
For incoming movements the normal codes Ix and Cx can be used.
Tax code A0
Output: Industrialization: No
tax
Tax type Acc.
key
Rate Condition type
Base amount BASB
Tax Law IPI 100,000 BLIP
Tax Law ICMS 100,000 BLIC
ICMS exempt 0,000 BCIX
ICMS NF nullv. Indus VST 100,000 ICMN
IPI NF nullv. Indus VST 100,000 IPIN
IPI from SD M W 1 IPI3
ICMS from SD M W 2 ICM3
Tax code A1
Output: Industrialization: ICMS
Tax type Acc.
key
Rate Condition type
Base amount BASB
Tax Law IPI 100,000 BLIP
Tax Law ICMS 100,000 BLIC
ICMS exempt 0,000 BCIX
ICMS active 100,000 ICMX
IPI NF nullv. Indus VST 100,000 IPIN
ICMS from SD out M W 2 100,000 ICM3
Tax code A3
Output: Industrialization:
ICMS+IPI
Tax type Acc.
key
Rate Condition type
Base amount BASB
Tax Law IPI 100,000 BLIP
Tax Law ICMS 100,000 BLIC
ICMS exempt 0,000 BCIX
ICMS active 100,000 ICMX
IPI active 100,000 IPIX
ICMS from SD out M W 2 100,000 ICM3
IPI from SD out MW1 100,000 IPI3
Tax code B0
Condition-based tax calculation in R/3 for Brazil 62
SAP Online Help 10/12/2011
Output: Consumption: No tax
Tax type Acc. key Rate Condition type
Base amount BASB
Level 500
IPI from SD MW1 IPI3
ICMS from SD MV2 ICM3
5.9 Reserved Tax Groups of Dynamic Exceptions
Table 5-8: Tax groups of dynamic exceptions reserved for SAP
Tax Group Usage
1 MM: ICMS base reduction carrier
SD: ICMS base reduction customer
ISS rates (material-dependent)
5 ICMS, IPI, S.T. material-dependent exceptions
MM: ISS exceptions (dependent on ship-from, ship-to, material)
97 SD: IPI tax laws (based on NCM code)
98 IPI standard taxes (based on NCM code)
SD: IPI tax laws (based on country)
ICMS standard tax rates (based on ship-from and ship-to)
S.T. standard tax rates (based on ship-from, ship-to, S.T. group)
99 Default taxes (based on country)
SD: IPI tax laws (based on tax code)
Condition-based tax calculation in R/3 for Brazil 63