design cbt brazil external

76
Condition-based tax calculation in R/3 for Brazil Release 4.70

Upload: leandro-nunes

Post on 10-Sep-2014

223 views

Category:

Documents


5 download

TRANSCRIPT

Page 1: Design CBT Brazil External
Page 2: Design CBT Brazil External

SAP Online Help 4/7/2023

Condition-based tax calculation in R/3 for Brazil 2

Condition-based tax calculationin R/3 for Brazil

Release 4 .70

Page 3: Design CBT Brazil External

SAP Online Help 4/7/2023

Condition-based tax calculation in R/3 for Brazil 3

Page 4: Design CBT Brazil External

SAP Online Help 4/7/2023

Condition-based tax calculation in R/3 for Brazil 4

Page 5: Design CBT Brazil External

SAP Online Help 4/7/2023

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 5

Page 6: Design CBT Brazil External

SAP Online Help 4/7/2023

Content

1 Glossary And Typographic Conventions.................................................7

2 Overview of the Changes.....................................................................82.1 Previous Tax Calculation Method......................................................................8

2.2 New Tax Calculation Method.............................................................................8

3 Customizing the Brazilian Tax Calculation......................................103.1 Activation of New Tax Calculation Method......................................................10

3.2 Tax Manager’s 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 6

Page 7: Design CBT Brazil External

SAP Online Help 4/7/2023

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..........................................................................................18

3.5.1 Tax Groups in Access Sequences...................................................................18

3.5.2 Automatic Adjustment of Access Sequences..................................................19

3.6 Condition Types...............................................................................................20

3.7 Tax Calculation Procedure..............................................................................20

3.8 Alternative Calculation Procedure...................................................................21

3.9 Internal Condition Codes.................................................................................21

3.10 Assignment of Condition Types to Internal Codes...........................................21

3.11 Assignment of Condition Tables to Tax Tables...............................................21

3.12 Definition of Tax Types....................................................................................21

3.13 Customizing FI/MM Tax Codes.......................................................................22

3.13.1 One Single Tax Code Maintenance Tool.........................................................22

3.13.2 Maintenance of Tax Code Conditions..............................................................23

3.13.3 Hints on Customizing Tax Code Conditions....................................................24

3.14 Mapping of Tax Values to the Nota Fiscal.......................................................24

3.15 Mapping of Tax Laws to the Nota Fiscal..........................................................24

3.16 Migration of Tax Data to Condition Records....................................................25

3.16.1 Check Conditions.............................................................................................25

3.16.2 Convert Tax Data to Condition Records..........................................................26

3.17 Sequence for SD Tax Code Determination.....................................................26

3.18 Sequence for SD Tax Law Determination.......................................................26

4 Detailed Design...................................................................................284.1 New DDIC Elements........................................................................................28

4.1.1 Tables..............................................................................................................28

4.1.2 Views...............................................................................................................31

4.1.3 Search Helps...................................................................................................32

4.1.4 Data Elements.................................................................................................32

4.1.5 Domains...........................................................................................................33

4.2 Changes of Existing DDIC Elements...............................................................34

4.2.1 Tables..............................................................................................................34

4.2.2 Views...............................................................................................................34

4.2.3 Data Elements.................................................................................................34

4.2.4 Domains...........................................................................................................34

4.3 New Formulas..................................................................................................34

Condition-based tax calculation in R/3 for Brazil 7

Page 8: Design CBT Brazil External

SAP Online Help 4/7/2023

4.3.1 Condition Value Formulas...............................................................................35

4.3.1.1 Formula 177.....................................................................................................35

4.3.1.2 Formula 163.....................................................................................................35

4.3.1.3 Formula 175.....................................................................................................36

4.3.1.4 Formula 164.....................................................................................................37

4.3.1.5 Formula 162.....................................................................................................37

4.3.1.6 Formula 171.....................................................................................................37

4.3.1.7 Formula 165.....................................................................................................38

4.3.1.8 Formula 167.....................................................................................................38

4.3.1.9 Formula 169.....................................................................................................39

4.3.1.10 Formula 172.....................................................................................................39

4.3.1.11 Formula 170.....................................................................................................40

4.3.1.12 Formula 173.....................................................................................................40

4.3.1.13 Formula 176.....................................................................................................40

4.3.1.14 Formula 178.....................................................................................................41

4.3.2 Condition Base Value Formulas......................................................................41

4.3.2.1 Formula 160.....................................................................................................41

4.3.2.2 Formula 161.....................................................................................................41

4.3.2.3 Formula 162.....................................................................................................42

4.3.2.4 Formula 163.....................................................................................................42

4.3.2.5 Formula 164.....................................................................................................42

4.3.3 Pricing Requirement Formulas........................................................................42

4.3.3.1 Formula 160.....................................................................................................42

4.3.3.2 Formula 161.....................................................................................................43

4.4 DDIC Class: CL_TAX_CONDITION................................................................43

4.5 DDIC Class: CL_DATE_DETERMINE.............................................................44

4.6 DDIC Class: CL_KEYFINDER.........................................................................44

4.7 Business Add-In: TAX_CONDITIONS.............................................................44

4.7.1 Method FILL_KOMK_KOMP...........................................................................44

4.7.2 Method PROCESS_TKOMV...........................................................................45

4.8 Automatic Generation of Condition Records in the View Maintenance...........45

4.8.1 Classes............................................................................................................45

4.8.2 Event 01...........................................................................................................46

4.8.3 Function Module J_1B_TRANSFER_TAX_CONDITION................................46

5 Standard Customizing........................................................................475.1 Access Sequences MM...................................................................................47

5.2 Condition Types MM........................................................................................47

5.3 Calculation Procedure in MM (FI): TAXBRC...................................................47

5.3.1 Step 100...........................................................................................................47

5.3.2 Step 110...........................................................................................................47

Condition-based tax calculation in R/3 for Brazil 8

Page 9: Design CBT Brazil External

SAP Online Help 4/7/2023

5.4 Internal Condition Codes.................................................................................47

5.5 Assignment of Condition Types to Internal Codes...........................................48

5.6 Assignment of Tax Rate Tables to Condition Tables.......................................49

5.7 Definition of Tax Types....................................................................................50

5.8 Standard Tax Codes........................................................................................51

5.8.1 Tax codes for non taxable transactions...........................................................51

5.8.2 Tax codes for incoming movements - Industrialization....................................51

5.8.3 Tax codes for incoming movements - Consumption........................................53

5.8.4 Tax codes for incoming movements - ICMS Sub.Trib. on freight....................55

5.8.5 Tax codes for incoming movements - Future delivery purchasing / Consign-ment.................................................................................................................55

5.8.6 Tax codes for incoming movements - Services - ISS and INSS......................57

5.8.7 Tax codes for outgoing movements - Ind.+Cons. posted in SD......................58

5.8.8 Tax codes for transfer postings - outgoing movements - Ind.+Cons...............58

5.9 Reserved Tax Groups of Dynamic Exceptions................................................59

Condition-based tax calculation in R/3 for Brazil 9

Page 10: Design CBT Brazil External

SAP Online Help 4/7/2023

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 cal-culation and tax rate determination is done by standard condition technique (pricing)

Tax Manager’s 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 proce-dure 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 10

CBT

MM

SD

Page 11: Design CBT Brazil External

SAP Online Help 4/7/2023

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 pro-cessing 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%). How-ever, 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. More-over, 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 formu-las 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* ta-bles, 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 11

Page 12: Design CBT Brazil External

SAP Online Help 4/7/2023

the table of the calculation procedure contain which tax items. Thus, the whole nota-fiscal-map-ping 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 12

Page 13: Design CBT Brazil External

SAP Online Help 4/7/2023

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 Manager’s Workplace

The Tax Manager’s Workplace (TMW) is a general entry point to do almost all Customizing rele-vant for the Brazilian tax calculation. It is called by the transaction J1BTAX and can also be ac-cessed from the IMG: IMG Financial Accounting Financial Accounting Global Settings Tax on Sales/Purchases Calculation Settings for Tax Calculation in Brazil Access Tax Manager’s 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 “Convênio 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 13

Figure 1. Activation of new tax calculation method.

CBT

Page 14: Design CBT Brazil External

SAP Online Help 4/7/2023

3.2.1Entities

In this menu, Customizing steps are collected that define basic constants that are relevant for the Brazilian tax calculation.

3.2.1.1Tax 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 condi-tion 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 Account-ing Financial Accounting Global Settings Tax on Sales/Purchases Basic Settings Brazil Tax Regions. The corresponding maintenance view is J_1BTREGV.

3.2.1.2NCM 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.3Sub.Trib. Groups

Definition of possible Substituição Tributária 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 Define Customer Groups for Substituição Tributária Calculation. The corresponding mainte-nance view is J_1BTXSTGV.

Condition-based tax calculation in R/3 for Brazil 14

Figure 2. Initial screen of the Tax Manager’s Workplace.

Page 15: Design CBT Brazil External

SAP Online Help 4/7/2023

3.2.1.4CFOP – 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.5CFOP – CFOP Determination MM

Rules for the determination of the CFOP codes in MM applications. The IMG activity that corre-sponds 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.6CFOP – CFOP Determination SD

Rules for the determination of the CFOP codes in SD applications. The IMG activity that corre-sponds 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.7CFOP – 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 Compo-nents General Application Functions Nota Fiscal CFOP Define Length of CFOP Ex-tensions. The corresponding maintenance view is J_1BCFOP_XREGV.

3.2.1.8CFOP – 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 Gen-eral Application Functions Nota Fiscal CFOP Exceptions for Incoming Goods Move-ments and Returns. The corresponding maintenance view is J_1BAOXV.

3.2.1.9CFOP – CFOP Exceptions SD

Rules for the determination of special CFOP codes in SD applications. The IMG activity that cor-responds 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/Pur-chases 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/Pur-chases Basic Settings Brazil Define ICMS Tax Laws. The corresponding maintenance view is J_1BATL1V.

3.2.2Tax Calculation

In this menu, Customizing steps are collected that control the rates, flags, and texts that are used in the tax calculation.

Condition-based tax calculation in R/3 for Brazil 15

MM

SD

MM

SD

Page 16: Design CBT Brazil External

SAP Online Help 4/7/2023

3.2.2.1Maintain 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 Account-ing Financial Accounting Global Settings Tax on Sales/Purchases Calculation Set-tings for Tax Calculation in Brazil Tax Rates.

3.2.2.2Maintain Tax Groups

Here you define tax groups used in the dynamic tax exceptions. The activity can also be ac-cessed 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 Account-ing Financial Accounting Global Settings Tax on Sales/Purchases Calculation Set-tings for Tax Calculation in Brazil Tax Rates Maintain Tax Groups for Dynamic Excep-tions. The corresponding table is J_1BTXGRUOP.

3.2.2.3Tax 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 Account-ing Financial Accounting Global Settings Tax on Sales/Purchases Calculation Set-tings for Tax Calculation in Brazil Define MM Tax Codes. The corresponding maintenance view is J_1BTAXCODEV.

3.2.2.4Tax 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 Set-tings Tax on Sales/Purchases Calculation Settings for Tax Calculation in Brazil De-fine SD Tax Codes. The corresponding maintenance view is J_1BTAXCODEV.

3.2.2.5Alternative 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 Account-ing 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 16

MM

SD

MM

Page 17: Design CBT Brazil External

SAP Online Help 4/7/2023

3.2.2.6Tax 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 Fi-nancial Accounting Financial Accounting Global Settings Tax on Sales/Purchases Cal-culation Settings for Tax Calculation in Brazil Define Sequence for SD Tax Code Determi-nation. The corresponding table is J_1BTXCODESEQ.

3.2.2.7Tax 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 Ac-counting Global Settings Tax on Sales/Purchases Basic Settings Brazil Define Se-quence for SD Tax Law Determination. The corresponding table is J_1BTXLAWSEQ.

3.2.2.8Other Country

Here a different country can be selected. At the start of the Tax Manager’s Workplace the coun-try 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.3Condition Setup

In this menu, all Customizing steps are collected that are related to the condition technique in the tax calculation.

3.2.3.1Migration – 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.2Migration – 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 se-quences. It is important that you ensure that tax groups are not customized differently in differ-ent clients because with each conversion to access sequences, the previous Customizing set-tings will be overwritten.

3.2.3.3Nota-Fiscal Mapping – Tax Values MM

Here it is customized which fields of the table of the tax calculation procedure used in MM con-tain 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 Ac-counting Global Settings Tax on Sales/Purchases Basic Settings Brazil Condition-Based Tax Calculation Map MM Tax Values to Nota Fiscal Fields. The corresponding main-tenance view is J_1BNFTXCONDMMV.

3.2.3.4Nota-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 corre-sponds 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

Condition-based tax calculation in R/3 for Brazil 17

CBT

CBTMM

SD

CBTSD

CBT

SD

Page 18: Design CBT Brazil External

SAP Online Help 4/7/2023

Calculation Map SD Tax Values to Nota Fiscal Fields.The corresponding maintenance view is J_1BNFTXCONDV.

3.2.3.5Nota-Fiscal Mapping – Tax Laws MM

Here it is customized which fields of the table of the tax calculation procedure used in MM con-tain 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 mainte-nance view is J_1BNFLWCONDMMV.

3.2.3.6Condition 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 Finan-cial Accounting Financial Accounting Global Settings Tax on Sales/Purchases Basic Settings Brazil Condition-Based Tax Calculation Define Internal Codes for Tax Condi-tions. The corresponding maintenance view is J_1BCONDMAPV.

3.2.3.7Condition 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.8Condition 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 corre-sponding table is J_1BVIEWMAP.

3.2.3.9Access 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 – Ac-cess 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 Set-tings 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 18

CBTMM

CBT

MM

SD

MM

CBT

CBT

Page 19: Design CBT Brazil External

SAP Online Help 4/7/2023

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 Set-tings 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 pric-ing 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 Account-ing 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 any-where 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. How-ever, 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 fields: material, NCM code, material class/material group, tax code, vendor, customer, industry

Condition-based tax calculation in R/3 for Brazil 19

SD

MM

SD

Page 20: Design CBT Brazil External

SAP Online Help 4/7/2023

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 transac-tions.

The number of the tax group determines which rates are taken in case of more than one match-ing 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 exam-ple, 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 indi -cators in the columns at the right side of the table. You can individually activate the considera-tion 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.

Condition-based tax calculation in R/3 for Brazil 20

Figure 3. Maintenance of the tax rate table J_1BTXIP3, tax group 6, in the view J_1BTX-IP3V. The dynamic key fields are material and vendor.

Page 21: Design CBT Brazil External

SAP Online Help 4/7/2023

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 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 mainte-nance 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.1Tax Groups in Access Sequences

Whenever a new tax group was created or an existing group was changed, e.g. tax type indica-tors 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 applica-tion General, and marked as active for ICMS only. Then, you need to extend all MM and SD ac-cess 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

Condition-based tax calculation in R/3 for Brazil 21

Figure 4. Maintenance of tax groups of dynamic exceptions. The displayed groups are an example which is not deliverd as standard.

CBT

Page 22: Design CBT Brazil External

SAP Online Help 4/7/2023

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.

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.2Automatic 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 ini-tial selection screen.

You need to have authorization for cross-client Customizing if you want to modify the access se-quences. It is important that you ensure that tax groups are not customized differently in differ-ent clients because with each conversion to access sequences, the previous Customizing set-tings 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 ex-tremely 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 se-quences.

Insert into the access sequences - if you want to include new steps in the access se-quences after creating a new tax group .

Delete from access sequences - if you want to delete existing steps from the access se-quences.

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:

Condition-based tax calculation in R/3 for Brazil 22

Figure 5. Selection screen of the program that automatically adjusts access sequences based on the Customizing of the tax groups of dynamic exceptions.

CBT

Page 23: Design CBT Brazil External

SAP Online Help 4/7/2023

A. Update access sequences

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 as-signments 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 dis-plays 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 se-quences 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 as-signed 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 calcula-tion 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 corre-sponding IMG activity can be found in IMG Financial Accounting Financial Accounting

Condition-based tax calculation in R/3 for Brazil 23

CBT

CBTMM

Page 24: Design CBT Brazil External

SAP Online Help 4/7/2023

Global Settings Tax on Sales/Purchases Basic Settings Assign Country To Calculation Procedure.

A detailed description of the new standard calculation procedure TAXBRC can be found in sec-tion 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 in-ternal 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 Map-ping – 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 stan-dard 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 dy-namic exceptions (see section 3.5.2).

3.10 Assignment 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 de-livered by SAP.

3.11 Assignment 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 spec-ify the condition table per tax group.

The default entries delivered by SAP are shown in Table 5-6.

Condition-based tax calculation in R/3 for Brazil 24

CBT

CBT

CBT

MM

Page 25: Design CBT Brazil External

SAP Online Help 4/7/2023

3.12 Definition 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 re-ferred to as tax types in this table. They are customized in the view J_1BAJV that can be ac-cessed in the TMW by choosing Condition Setup – Tax Types.

Each tax type has to be assigned to a tax group. Tax groups are the different Brazilian taxes (IPI, ICMS, Substituição 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 purchas-ing price is to be calculated and used in the tax rate determination. Details about this functional-ity 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.13 Customizing 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 proce-dure. 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 spec-ified 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 25

Page 26: Design CBT Brazil External

SAP Online Help 4/7/2023

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 press-ing the button on the application toolbar. In case the system does not find a unique assign-ment 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 inac-tive.

When the data are saved in the screen displayed in Figure 6, condition records are automati-cally 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 coun-try 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 pro-cedure 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.

Page 27: Design CBT Brazil External

SAP Online Help 4/7/2023

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 ap-proach, however, all this logic is customizable in the nota-fiscal mapping table J_1BNFTX-COND, 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 fol-lowing, 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 fis-cal, material usage is consumption

ICMN, IPIN Activate if IPI and/or ICMS dummy line is to be generated in the nota fis-cal; 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.14 Mapping 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_1BNFTX-CONDMMV (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 condi-tion rate or amount, KBETR; and the condition value, KWERT.

Condition-based tax calculation in R/3 for Brazil 27

CBT

Page 28: Design CBT Brazil External

SAP Online Help 4/7/2023

3.15 Mapping 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 main-tained 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 screen-shot in Figure 9 shows the standard mapping delivered by SAP.

3.16 Migration 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 corre-sponding 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 ta-bles 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.

CBTMM

CBT

CBT

Page 29: Design CBT Brazil External

SAP Online Help 4/7/2023

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 tool-bar, 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 is-sued. 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.17 Sequence for SD Tax Code Determination

In Sales and Distribution there are two places to define the SD Tax Code which can be automat-ically determined in a transaction (e.g. a sales order). It can be either derived from the Item Cat-egory, 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 as-cending 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 Table2 Customer Material Information

An example is shown in Table 3-1. In this example the system would first look up the item cate-gory 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

CBTSD

Page 30: Design CBT Brazil External

SAP Online Help 4/7/2023

3.18 Sequence 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 as-cending 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 Tables4 Item Category Table5 Customer Master

An example is shown in Table 3-2. In this example the system would first look up the tax excep-tion 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 con-sistency of entries in Brazilian tax tables to condition records.

CBTSD

Page 31: Design CBT Brazil External

SAP Online Help 4/7/2023

4 Detailed Design

4.1 New DDIC Elements

4.1.1Tables

J_1BCONDMAP, J_1BCONDMAPT

The table J_1BCONDMAP contains all internal codes for condition records that are being gener-ated automatically during the maintenance of the Brazilian tax tables or during the initial conver-sion with the program J_1B_MIGRATE_TAX_RATES. The table J_1BCONDMAPT is the corre-sponding 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 (de-fined 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 con-dition type that is used in the tax calculation procedure and activated or deactivated by cus-tomizing 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-manage-ment 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 calcu-lation 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-manage-ment applications (KAPPL=’TX’).

Condition-based tax calculation in R/3 for Brazil 31

Page 32: Design CBT Brazil External

SAP Online Help 4/7/2023

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 ClientKAPPL KAPPL ApplicationKSCHL KSCHA Condition typeALAND ALAND Departure country (country from which the goods are sent)TAXBS TAXBS Tax Base in PercentageDOCTYP J_1BDOCTYP Document typeDATBI KODATBI Validity end date of the condition recordDATAB KODATAB Validity start date of the condition recordKNUMH KNUMH Condition record number

A346

Condition table: BR: IPI rate determination

Component Comp. Type Short Text

MANDT MANDT ClientKAPPL KAPPL ApplicationKSCHL KSCHA Condition typeALAND ALAND Departure country (country from which the goods are sent)MATNR MATNR Material NumberSTEUC STEUC Control code for consumption taxes in foreign tradeMATKL MATKL Material GroupMWSKZ MWSKZ Tax on sales/purchases codeLIFNR ELIFN Vendor's account numberKUNNR KUNNR_V Customer numberBRSCH BRSCH Industry keyCITYC CITYC City CodeDATBI KODATBI Validity end date of the condition recordDATAB KODATAB Validity start date of the condition recordKNUMH KNUMH Condition record number

A347

Condition table. BR: ICMS rate determination

Component Comp. Type Short Text

MANDT MANDT ClientKAPPL KAPPL ApplicationKSCHL KSCHA Condition typeALAND 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 NumberSTEUC STEUC Control code for consumption taxes in foreign tradeMATKL MATKL Material Group

Condition-based tax calculation in R/3 for Brazil 32

Page 33: Design CBT Brazil External

SAP Online Help 4/7/2023

Component Comp. Type Short Text

MWSKZ MWSKZ Tax on sales/purchases codeLIFNR ELIFN Vendor's account numberKUNNR KUNNR_V Customer numberBRSCH BRSCH Industry keyCITYC CITYC City CodeDATBI KODATBI Validity end date of the condition recordDATAB KODATAB Validity start date of the condition recordKNUMH KNUMH Condition record number

A348

Condition table. BR: SubTrib rate determination

Component Comp. Type Short Text

MANDT MANDT ClientKAPPL KAPPL ApplicationKSCHL KSCHA Condition typeALAND 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 Substituiçao Tributária calculationMATNR MATNR Material NumberSTEUC STEUC Control code for consumption taxes in foreign tradeMATKL MATKL Material GroupMWSKZ MWSKZ Tax on sales/purchases codeLIFNR ELIFN Vendor's account numberKUNNR KUNNR_V Customer numberBRSCH BRSCH Industry keyCITYC CITYC City CodeDATBI KODATBI Validity end date of the condition recordDATAB KODATAB Validity start date of the condition recordKNUMH KNUMH Condition record number

A349

Condition table. BR: ICMS Complementar rate determination

Component Comp. Type Short Text

MANDT MANDT ClientKAPPL KAPPL ApplicationKSCHL KSCHA Condition typeALAND ALAND Departure country (country from which the goods are sent)TXREG_ST J_1BTXSHPT Ship to location (tax region)MATNR MATNR Material NumberDATBI KODATBI Validity end date of the condition recordDATAB KODATAB Validity start date of the condition recordKNUMH KNUMH Condition record number

A382

Condition table. BR: ICMS rate

Component Comp. Type Short Text

MANDT MANDT MandantKAPPL KAPPL ApplikationKSCHL KSCHA KonditionsartALAND ALAND Lieferndes Land (Land aus dem die Ware versandt wird)DOCTYP J_1BDOCTYP BelegartTXREG_SF J_1BTXSHPF Sender (Steuerregion)

Condition-based tax calculation in R/3 for Brazil 33

Page 34: Design CBT Brazil External

SAP Online Help 4/7/2023

Component Comp. Type Short Text

TXREG_ST J_1BTXSHPT Empfänger (Steuerregion)MATNR MATNR MaterialnummerSTEUC STEUC Steuerungscode für Verbrauchssteuern im AußenhandelMATKL MATKL WarengruppeMWSKZ MWSKZ UmsatzsteuerkennzeichenLIFNR ELIFN Kontonummer des LieferantenKUNNR KUNNR_V KundennummerBRSCH BRSCH BranchenschlüsselCITYC CITYC City CodeDATBI KODATBI Gültigkeitsende des KonditionssatzesDATAB KODATAB Gültigkeitsbeginn des KonditionssatzesKNUMH KNUMH Nummer Konditionssatz

A392

Condition table. Country

Component Comp. Type Short Text

MANDT MANDT MandantKAPPL KAPPL ApplikationKSCHL KSCHA KonditionsartALAND ALAND Lieferndes Land (Land aus dem die Ware versandt wird)DATBI KODATBI Gültigkeitsende des KonditionssatzesDATAB KODATAB Gültigkeitsbeginn des KonditionssatzesKNUMH KNUMH Nummer Konditionssatz

4.1.2Views

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 dynamic-ally, 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 auto-matic 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

Page 35: Design CBT Brazil External

SAP Online Help 4/7/2023

J_1BCONDCALC

Help view used in the search help H_J_1B_T683S to display conditions used in a calculation procedure.

4.1.3Search 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.4Data 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 auto-matic 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 ta-bles 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 mate-rials 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 tradeTXREG_SF J_1BTXSHPF Ship from location (tax region)TXREG_ST J_1BTXSHPT Ship to location (tax region)XXIPI J_1BTCIPI Customer is IPI-exemptXICMS J_1BTCICMS Customer is ICMS-exempt

Condition-based tax calculation in R/3 for Brazil 35

Page 36: Design CBT Brazil External

SAP Online Help 4/7/2023

Component Comp. Type Short Text

XSUBT J_1BTCST Customer group for Substituiçao Tributária calculationTAXBS TAXBS Tax Base in PercentageIPISP J_1BINDEQU Tax SplitDOCTYP J_1BDOCTYP Document typeMTORG J_1BMATORG Origin of the materialMTUSE J_1BMATUSE Usage of the materialOWNPR J_1BOWNPRO Produced in-houseMATKL MATKL Material GroupBRSCH BRSCH Industry keyCITYC CITYC City CodeLIFNR LIFNR Account Number of Vendor or CreditorMGAME MENGE_D QuantityVRKME 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 Substituiçao Tributária calculationTAXBS TAXBS Tax Base in PercentageIPISP J_1BINDEQU Tax SplitDOCTYP 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 materialOWNPR J_1BOWNPRO Produced in-houseMTORG J_1BMATORG Origin of the material

4.1.5Domains

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 value1 Condition rate/amount2 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

Page 37: Design CBT Brazil External

SAP Online Help 4/7/2023

4.2 Changes of Existing DDIC Elements

4.2.1Tables

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.2Views

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.3Data 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. Fur-thermore, 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.4Domains

J_1BTXFIELDS

The field KONZS was removed from this domain, which contains the allowed key fields for dy-namic 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

Page 38: Design CBT Brazil External

SAP Online Help 4/7/2023

Symbol Variable in source code Description

a XKAWRT Condition base valuew XKWERT Condition value (result of calculation)r XKOMV-KBETR Condition rateD XWORKD Work field DE XWORKE Work field E

The work fields have to be reset at the end of each formula because in the pricing logic the val-ues specified in the calculation procedure are added to the work fields instead of overwriting the previous values.

4.3.1Condition Value Formulas

4.3.1.1Formula 177

Include: RV64A177

This formula is used to get the discount value that was previously stored in function group J1B-CONDTAX.

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.2Formula 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:

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

Page 39: Design CBT Brazil External

SAP Online Help 4/7/2023

xkwert = h1 .

ENDFORM.

4.3.1.3Formula 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:

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

Page 40: Design CBT Brazil External

SAP Online Help 4/7/2023

4.3.1.4Formula 164

Include: FV64A164

This formula calculates the value inclusive ICMS. XKAWRT contains the net base value, XWORKE the ICMS rate scaled with 10n, already reduced by the base rate (i.e. 10n*rate*base), and XWORKD contains 10n.

Mathematical formula:

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.5Formula 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:

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.6Formula 171

Include: FV64A171

Condition-based tax calculation in R/3 for Brazil 40

Page 41: Design CBT Brazil External

SAP Online Help 4/7/2023

This formula returns XWORKD in case it is greater than zero. If not, XKAWRT is returned.

Mathematical formula:

Source code

FORM FRM_KONDI_WERT_171.

if xworkd > 0. xkwert = xworkd. else. xkwert = xkawrt. endif.

clear xworkd.

ENDFORM.

4.3.1.7Formula 165

Include: FV64A165

This formula is used in the calculation of ICMS consumption. XKAWRT, XWORKD, and XWORKE are used.

Mathematical formula:

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.8Formula 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:

Source code

FORM FRM_KONDI_WERT_167.

Condition-based tax calculation in R/3 for Brazil 41

Page 42: Design CBT Brazil External

SAP Online Help 4/7/2023

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.9Formula 169

Include: FV64A169

This formula is used in the calculation of Substituição Tributária to apply base reductions. XKAWRT and XKOMV-KBETR are used.

Mathematical formula:

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 Substituição Tributária to return the minimum price if the surcharge type has the value 3 (“minprice or invoice value”).

Mathematical formula:

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

Page 43: Design CBT Brazil External

SAP Online Help 4/7/2023

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:

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:

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 ex-empt-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:

Condition-based tax calculation in R/3 for Brazil 43

Page 44: Design CBT Brazil External

SAP Online Help 4/7/2023

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 J1B-CONDTAX.

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.2Condition Base Value Formulas

4.3.2.1Formula 160

Include: FV63A160

This formula returns 1. It is used to store rates in the calculation procedure that can referred to later.

Mathematical formula:

Source code

FORM FRM_KOND_BASIS_160. xkwert = 1000. "1,000ENDFORM.

4.3.2.2Formula 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

Page 45: Design CBT Brazil External

SAP Online Help 4/7/2023

Mathematical formula:

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.3Formula 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:

Source code

FORM FRM_KOND_BASIS_162.

xkwert = xkawrt * 100.

ENDFORM. "FRM_KOND_BASIS_162

4.3.2.4Formula 163

Include: FV63A163

This formula clears the base value.

Mathematical formula:

Source code

FORM FRM_KOND_BASIS_163. clear xkwert.ENDFORM. "FRM_KOND_BASIS_163

4.3.2.5Formula 164

Include: FV63A164

This formula multiplies the base value with -1. It is used in offset postings.

Mathematical formula:

Source code

FORM FRM_KOND_BASIS_164.

xkwert = 0 - xkomv-kawrt.

ENDFORM. "FRM_KOND_BASIS_164

4.3.3Pricing Requirement Formulas

4.3.3.1Formula 160

Include: LV61A160

Condition-based tax calculation in R/3 for Brazil 45

Page 46: Design CBT Brazil External

SAP Online Help 4/7/2023

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.2Formula 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 trans-fers 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. Indi-cates 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. 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).

Condition-based tax calculation in R/3 for Brazil 46

Page 47: Design CBT Brazil External

SAP Online Help 4/7/2023

Parameter Description

I_DELETE_IF_ZERO A flag that indicates how to proceed in case the value of the condi-tion 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 exam-ple.

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 back-ground. Examples can be found in function groups J1BQ, J1BW, and J1B0 which contain cod-ing 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 ta-ble 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 dy-namic 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 pri-cing 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.1Method FILL_KOMK_KOMP

This method is used to modify the communication structures KOMK and KOMP before the pri-cing is called. It can be called after the application has filled KOMK and KOMP to fill country-specific fields.

Parameter Type PassValue

Opt. TypingMethod

Assoc.Type

Description

FLT_VAL Importing X Type INTCA Country Key

I_INDEX Importing X X Type N Index in Internal Table with

Condition-based tax calculation in R/3 for Brazil 47

Page 48: Design CBT Brazil External

SAP Online Help 4/7/2023

Parameter Type PassValue

Opt. TypingMethod

Assoc.Type

Description

Control Fields (IV)

CH_KOMK Changing Type KOMK Communication Header for Pricing

CH_KOMP Changing Type KOMP Pricing Communication Item

4.7.2Method 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 PassValue

Opt. TypingMethod

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 LJ1BQCL4J_1BTXIC2 J1BQ LJ1BQF04 LJ1BQCL3J_1BTXIC3V J1BW LJ1BWF03 LJ1BWCL2J_1BTXCI1 J1BQ LJ1BQF08 LJ1BQCL7J_1BTXIP1 J1BQ LJ1BQF03 LJ1BQCL2J_1BTXIP2 J1BQ LJ1BQF02 LJ1BQCL1J_1BTXIP3V J1BW LJ1BWF02 LJ1BWCL1J_1BTXIS1 J1BQ LJ1BQF06 LJ1BQCL5J_1BTXIS3V J1BW LJ1BWF04 LJ1BWCL3J_1BTXST1 J1BQ LJ1BQF07 LJ1BQCL6J_1BTXST2 J1B0 LJ1BWF01 LJ1BWCL1J_1BTXST3V J1BW LJ1BWF05 LJ1BWCL4J_1BTAXCODEV J1BCONDTAX LJ1BCONDTAXF03 LJ1BCONDTAXCL1J_1BTXSDCV J1BQ LJ1BQF12 LJ1BQCLBJ_1BTXDEF J1BQ LJ1BQF10 LJ1BQCL9J_1BTREGV J1BQ LJ1BQF11 LJ1BQCLAJ_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.

4.8.1Classes

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

Condition-based tax calculation in R/3 for Brazil 48

Page 49: Design CBT Brazil External

SAP Online Help 4/7/2023

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 refer-ence 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 im-plemented 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.2Event 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_CONDI-TION, 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.3Function 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 de-lete 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=>trans-fer_view_data is used instead as described in section 4.8.2.

Condition-based tax calculation in R/3 for Brazil 49

Page 50: Design CBT Brazil External

SAP Online Help 4/7/2023

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 BrazilBRCI Brazil ICMS ComplementBRIB Brazil ICMS BaseBRIC Brazil ICMSBRID Brazil ICMS Rate SF=STBRIF Brazil ICMS FreightBRIP Brazil IPIBRIR Brazil ICMS Rate and FreightBRIS Brazil ISSBRLC Brazil Tax Law: ICMSBRLP Brazil Tax Law: IPIBRST 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.1Step 100

To be documented

5.3.2Step 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 ICMSICMSCOMPBASE ICMS Complement, Tax BaseICMSCOMPEXEMPT ICMS Complement, Tax ExemptionICMSCONV100 ICMS Code: Convênio 100 ICMSICMSDISCOUNT ICMS Indicator Tax-Free RegionICMSFREIGHT ICMS on Freight ICMSICMSLAW ICMS Tax Law ICMSICMSNULLEXEMPT ICMS Base in Exempt Base If Not ICMS-RelevantICMSOTHER ICMS Code: Other Base ICMSICMSRATE ICMS Tax Rate ICMSIPIBASE IPI Reduced Base Rate IPI

Condition-based tax calculation in R/3 for Brazil 50

Page 51: Design CBT Brazil External

SAP Online Help 4/7/2023

TxCondCode Description Tax Group

IPILAW IPI Tax Law IPIIPINULLEXEMPT IPI Base in Exempt Base If Not IPI-RelevantIPIOTHER IPI Code: Other Base IPIIPIPAUTA IPI Pauta Rate IPIIPIRATE IPI Tax Rate IPIISSRATE ISS Tax Rate ISSSUBTRIBBASE1 Substituição Tributária Red. Base 1 ICSTSUBTRIBBASE2 Substituição Tributária Red. Base 2 ICSTSUBTRIBFIXPRICE Substituição Tributária Fixed Price ICSTSUBTRIBICMS Substituição Tributária ICMS Reduction ICSTSUBTRIBMINPRICE Substituição Tributária Minimum Price ICSTSUBTRIBSURCHARGE Substituição Tributária Surcharge Rate ICSTSUBTRIBSURTYPE Substituição Tributária Calculation Rule ICSTTAXFREEREGION Tax Free Region Indicator (Zona Franca)TXSDCICMS SD Tax Code: Calculate ICMSTXSDCICMSFREIGHT SD Tax Code: Calculate ICMS on FreightTXSDCINDUS SD Tax Code: Material Usage IndicatorTXSDCIPI SD Tax Code: Calculate IPITXSDCISS SD Tax Code: Calculate ISSTXSDCSUBTRIB SD Tax Code: Calculate Substituição TributáriaTXSDCSUBTRIBFREIGHT 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 BIC1ICMSBASE V ICBSICMSCOMPBASE TX BCI1ICMSCOMPBASE V ICCBICMSCOMPEXEMPT TX BCI2ICMSCOMPEXEMPT V ICCXICMSCONV100 TX B100ICMSCONV100 V I100ICMSDISCOUNT TX ICZFICMSDISCOUNT V ICZFICMSFREIGHT TX BIC0ICMSFREIGHT V ICFRICMSLAW TX BLICICMSLAW V ICLWICMSNULLEXEMPT TX BICXICMSOTHER TX BIC2ICMSOTHER V ICOBICMSRATE TX BIC0ICMSRATE V ICVAIPIBASE TX BIP1IPIBASE V IPBSIPIBASE_MM TX IPI3IPILAW TX BLIPIPILAW V IPLWIPINULLEXEMPT TX BIPXIPIOTHER TX BIP2IPIOTHER V IPOBIPIOTHER_MM TX IPI3

Condition-based tax calculation in R/3 for Brazil 51

Page 52: Design CBT Brazil External

SAP Online Help 4/7/2023

Internal TC Code App CTyp

IPIPAUTA TX BIPPIPIPAUTA V IPIPIPIRATE TX BIP0IPIRATE V IPVAIPIRATE_MM TX IPI3ISSRATE TX BIS0ISSRATE V ISVASUBTRIBBASE1 TX BST6SUBTRIBBASE1 V ISTBSUBTRIBBASE2 TX BST7SUBTRIBBASE2 V IST2SUBTRIBFIXPRICE TX BST3SUBTRIBFIXPRICE V ISTFSUBTRIBICMS TX BST8SUBTRIBICMS V ISTCSUBTRIBMINPRICE TX BST2SUBTRIBMINPRICE V ISTMSUBTRIBSURCHARGE TX BST0SUBTRIBSURCHARGE V ISTSSUBTRIBSURTYPE TX BST1SUBTRIBSURTYPE V ISTT

5.6 Assignment of Tax Rate Tables to Condition Ta-bles

Table 5-6: Assignment of Brazil-specific tax tables to condition tables

Table Name Tax Group Condition Table

J_1BTAXCODEV 3J_1BTREGX 394J_1BTXCI1 349J_1BTXDEF 392J_1BTXIC1 382J_1BTXIC2 382J_1BTXIC3 any * 382J_1BTXIP1 346J_1BTXIP2 346J_1BTXIP3 anyError: Ref-

erence sourcenot found

346

J_1BTXIS1 121J_1BTXIS3 anyError: Ref-

erence sourcenot found

347

J_1BTXSDC 291J_1BTXST1 348J_1BTXST2 348J_1BTXST3 anyError: Ref-

erence sourcenot found

348

* 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 SAP’s 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

Page 53: Design CBT Brazil External

SAP Online Help 4/7/2023

5.7 Definition of Tax Types

Table 5-7: Definition of Brazilian tax types

TxTy TxGr Description LPP

IC1C ICMS ICMS ClearingIC1O ICMS ICMS Ind. Clear. Off.ICM0 ICMS ICMS NF Zero Line ConsumptionICM1 ICMS ICMS Deductible XICM2 ICMS ICMS Non-deductible XICM3 ICMS ICMS from SD IndustralizationICM4 ICMS ICMS from SD ConsumptionICM5 ICMS ICMS Deductible with LPP XICM6 ICMS ICMS Industr. non Deductible XICM7 ICMS ICMS Industr. non Ded. retail XICM8 ICMS ICMS Industr. non Ded. retail XICM9 ICMS ICMS transfer non Ded. retail XICMF ICMS ICMS on freight offsetICMN ICMS ICMS zero line industralizatioICMX ICMS Icms active XICOP ICOP Complement of ICMS XICOT ICOP Complement of ICMSICS1 ICST ICMS Sub.Trib. XICS2 ICST ICMS Sub.Trib. Non-deductibleICS3 ICST ICMS Sub.Trib. from SDICS4 ICST ICMS Sub.Trib. XICS5 ICST ICMS Sub.Trib. Non-deductible XICS6 ICST ICMS Sub.Trib. Non-deductibleICS7 ICST ICMS Sub.Trib. Non-deductible XICS8 ICST ICMS Sub.Trib. Non-deductibleICS9 ICST ICMS Sub.Trib. Non-deductibleICZF ICMS ICMS Discount Zona FrancaICZT ICMS ICSM TF to ZFIFR1 ICFR ICMS on freightIFR3 ICFR ICMS on freight from SDIFS1 ICFS ICMS Sub.Trib. on freightIFS3 ICFS ICMS Sub.Trib. on freight SDIP1C IPI IPI clearingIP1O IPI IPI Ind.Clear.Off.IPI0 IPI IPI zero line consumption XIPI1 IPI IPI DeductibleIPI2 IPI IPI Non-deductible XIPI3 IPI IPI from SD IndustralizationIPI4 IPI IPI from SD ConsumptionIPI5 IPI IPI Deductible XIPIA IPI IPI industr. outgoinng NFIPIB IPI IPI consum. outgoing NFIPIN IPI IPI zero line industralizationIPIX IPI IPI active XIRD1 RBIC ICMS Reimbursement XIRD2 RBIC ICMS Reimbur. offset XIRD3 RBST SUBT Reimbursement XIRD4 RBST SUBT Reimbur. offset XIRD5 RBIC ICMS Reim.offset NVV XIRD6 RBST SUBT Reim.offset NVV XISS2 ISS ISS from MMISS3 ISS ISS from SDISSO ISS ISS from MM Offset

Condition-based tax calculation in R/3 for Brazil 53

Page 54: Design CBT Brazil External

SAP Online Help 4/7/2023

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).

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 Proce-dure TAXBRC. Therefore they have a different definition than the former tax codes used for TAXBRJ. The differences are displayed as follows: Additional lines are dis-played 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 sys-tem, 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.1Tax 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 IEInput: Tax exempt transactions

Tax type Acc. key Rate Condition typeBase amount BASBLevel 200IPI Industr. VS1 IPI1

Tax code SEOutput: Tax exempt transactions

Tax type Acc. key Rate Condition typeBase amount BASBLevel 200IPI Industr. VS1 IPI1

5.8.2Tax codes for incoming movements - Industrialization

For each of the industrialization tax codes the field ‘Usage’ of the Brazilian tax code enhance-ments to be set to ‘Industrialization’.

Tax code I0Input: Industrialization: No tax

Tax type Acc. key

Rate Condition type

Base amount BASBTax Law IPI 100,000 BLIPTax Law ICMS 100,000 BLICICMS exempt 0,000 BCIXICMS NF nullv. Indus VST 100,000 ICMNIPI NF nullv. Indus VST 100,000 IPIN

Condition-based tax calculation in R/3 for Brazil 54

Page 55: Design CBT Brazil External

SAP Online Help 4/7/2023

Level 200IPI Indus.In VS1 0,000 IPI1

Tax code I1Input: Industrialization: ICMS

Tax type Acc. key

Rate Condition type

Base amount BASBTax Law IPI 100,000 BLIPTax Law ICMS 100,000 BLICICMS Industr. In VS1 100,000 ICM1ICMS exempt 0,000 BICXICMS active 100,000 ICMXIPI NF nullv. Indus VST 100,000 IPIN

Tax code I2Input: Industrialization: ICMS+ Sub.Trib.Tax type Acc.

keyRate Condition type

Base amount BASBTax Law IPI 100,000 BLIPTax Law ICMS 100,000 BLICICMS Industr. In VS1 100,000 ICM1ICMS exempt 0,000 BICXICMS active 100,000 ICMXIPI NF nullv. Indus VST 100,000 IPINSub.Tributaria In VS3 100,000 ICS1

Tax code I3Input: Industrialization: ICMS+IPITax type Acc.

keyRate Condition type

Base amount BASBTax Law IPI 100,000 BLIPTax Law ICMS 100,000 BLICICMS Industr. In VS1 100,000 ICM1ICMS exempt 0,000 BICXICMS active 100,000 ICMXIPI active 100,000 IPIXIPI Industr. In VS2 100,000 IPI1

Tax code I4Input: Industrialization: ICMS+IPI+Sub.Trib.Tax type Acc.

keyRate Condition type

Base amount BASBTax Law IPI 100,000 BLIPTax Law ICMS 100,000 BLICICMS Industr. In VS1 100,000 ICM1ICMS exempt 0,000 BICXICMS active 100,000 ICMXIPI active 100,000 IPIX

Condition-based tax calculation in R/3 for Brazil 55

Page 56: Design CBT Brazil External

SAP Online Help 4/7/2023

IPI Industr. In VS2 100,000 IPI1Sub.Tributaria In VS3 100,000 ICS1

Tax code I5Input: Industrialization: IPI onlyTax type Acc.

keyRate Condition type

Base amount BASBTax Law IPI 100,000 BLIPTax Law ICMS 100,000 BLICICMS exempt 0,000 BICXICMS NF nullv. Indus VST 100,000 ICMNIPI active 100,000 IPIXIPI Industr. In VS2 100,000 IPI1

Tax code I6Input: Ind.: ICMS+IPI: Reselling

Tax type Acc. key Rate Condition typeBase amount BASBLevel 200ICMS Industr. VS2 100,000 ICM1Level 300IPI Consumption NVV 100,000 IPI2

Tax code I7Input: Ind.: ICMS+Sub.Trib.+IPI : ResellingTax type Acc. key Rate Condition typeBase amount BASBLevel 200ICMS Industr. VS2 100,000 ICM1Sub.Tributaria VS3 100,000 ICS1Level 300IPI Consumption NVV 100,000 IPI2

5.8.3Tax codes for incoming movements - Consumption

For each of the industrialization tax codes the field ‘Usage’ of the brazilian tax code enhance-ments to be set to ‘Consumption’.

Tax code C0Input: Consumption: No tax

Tax type Acc. key

Rate Condition type

Base amount BASBTax Law IPI 100,000 BLIPTax Law ICMS 100,000 BLICICMS exempt 0,000 BCIXICMS NF nullv. Cons. VST 100,000 ICM0IPI nullvalues NF VST 100,000 IPI0IPI Indus.In VS1 0,000 IPI1

Tax code C1

Condition-based tax calculation in R/3 for Brazil 56

Page 57: Design CBT Brazil External

SAP Online Help 4/7/2023

Input: Consumption ICMS+Compl.Tax type Acc.

keyRate Condition type

Base amount BASBTax Law IPI 100,000 BLIPTax Law ICMS 100,000 BLICICMS exempt 0,000 BCIXICMS active 100,000 ICMXICMS Consumption In NVV 100,000 ICM2IPI nullvalues NF VST 100,000 IPI0ICMS complement ICP 100,000 ICOPICMS complement 100 ICX 100,000- ICOX

Tax code C2Input: Consumption ICMS+Compl.+ Sub.Trib.Tax type Acc.

keyRate Condition type

Base amount BASBTax Law IPI 100,000 BLIPTax Law ICMS 100,000 BLICICMS exempt 0,000 BCIXICMS active 100,000 ICMXICMS Consumption In NVV 100,000 ICM2IPI nullvalues NF VST 100,000 IPI0S.T. Consumption In NVV 100,000 ICS2ICMS complement ICP 100,000 ICOPICMS complement 100 ICX 100,000- ICOX

Tax code C3Input: Consumption ICMS+Compl.+IPITax type Acc.

keyRate Condition type

Base amount BASBTax Law IPI 100,000 BLIPTax Law ICMS 100,000 BLICICMS exempt 0,000 BCIXICMS active 100,000 ICMXIPI active 100,000 IPIXIPI Consumption In NVV 100,000 IPI2ICMS Consumption In NVV 100,000 ICM2ICMS complement ICP 100,000 ICOPICMS complement 100 ICX 100,000- ICOX

Tax code C4Input: Consumption ICMS+Compl.+IPI+Sub.Trib.Tax type Acc.

keyRate Condition type

Base amount BASBTax Law IPI 100,000 BLIPTax Law ICMS 100,000 BLICICMS exempt 0,000 BCIXICMS active 100,000 ICMXIPI active 100,000 IPIXIPI Consumption In NVV 100,000 IPI2

Condition-based tax calculation in R/3 for Brazil 57

Page 58: Design CBT Brazil External

SAP Online Help 4/7/2023

ICMS Consumption In NVV 100,000 ICM2S.T. Consumption In NVV 100,000 ICS2ICMS complement ICP 100,000 ICOPICMS complement 100 ICX 100,000- ICOX

Tax code C5Input Consumption IPI

Tax type Acc. key

Rate Condition type

Base amount BASBTax Law IPI 100,000 BLIPTax Law ICMS 100,000 BLICICMS exempt 0,000 BCIXIPI active 100,000 IPIXIPI Consumption In NVV 100,000 IPI2ICMS NF nullv. Indus VST 100,000 ICMN

5.8.4Tax 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 IFInput: Ind.: ICMS (S.T. on freight)

Tax type Acc. key Rate Condition typeBase amount BASBLevel 200ICMS Industr. VS2 100,000 ICM1ICMS S.T. freight offset IC1 100,000 ICMF

Tax code CFICMS + ICMS Freight Cons. In-comingTax type Acc.

keyRate Condition type

Base amount BASBTax Law IPI 100,000 BLIPTax Law ICMS 100,000 BLICICMS exempt 0,000 BCIXICMS active 100,000 ICMXICMS Consumption In NVV 100,000 ICM2IPI nullvalues NF VST 100,000 IPI0ICMS S.T. freight offset VS3 100,000 ICMF

5.8.5Tax codes for incoming movements - Future delivery purchasing / Consignment

Tax code K0Future Delivery purchasing G/R

Tax type Acc. Rate Condition type

Condition-based tax calculation in R/3 for Brazil 58

Page 59: Design CBT Brazil External

SAP Online Help 4/7/2023

keyBase amount BASBTax Law IPI 100,000 BLIPTax Law ICMS 100,000 BLICICMS Industr. In VS1 100,000 ICM1ICMS exempt 0,000 BCIXICMS active 100,000 ICMXIPI nullv. Indus VST 100,000 IPINICMS Ind. clearing offset ICC 100,000- IC1O

Tax code K1Future Delivery purchasing I/R

Tax type Acc. key

Rate Condition type

Base amount BASBTax Law IPI 100,000 BLIPTax Law ICMS 100,000 BLICICMS exempt 0,000 BCIXICMS NF nullv. Indus VST 100,000 ICMNIPI active 100,000 IPIXIPI Industr. In VS2 100,000 IPI1ICMS Ind. clearing ICC 100,000 IC1C

Tax code K2Future Delivery purchasing G/R In-dustr. All taxesTax type Acc. key Rate Condition typeBase amount BASBLevel 200IPI Industrialization VS1 100,000 IPI1ICMS Industrialization VS2 100,000 ICM1IPI Ind. clearing offset IPC 100,000- IP1OICMS Ind. clearing offset ICC 100,000- IC1O

Tax code K3Future Delivery purchasing I/R In-dustr. Statistik taxesTax type Acc. key Rate Condition typeBase amount BASBLevel 200IPI Ind. clearing IPC 100,000 IP1CICMS Ind. clearing ICC 100,000 IC1C

Tax code K5Consignment Shipment G/R

Tax type Acc. key

Rate Condition type

Base amount BASBTax Law IPI 100,000 BLIPTax Law ICMS 100,000 BLICICMS Industr. In VS1 100,000 ICM1ICMS exempt 0,000 BCIXICMS active 100,000 ICMXIPI active 100,000 IPIXICMS Ind. clearing offset ICC 100,000- IC1OIPI Ind. clearing offset IPC 100,000- IP1O

Condition-based tax calculation in R/3 for Brazil 59

Page 60: Design CBT Brazil External

SAP Online Help 4/7/2023

Tax code K6Consignment: Invoice I/R

Tax type Acc. key

Rate Condition type

Base amount BASBTax Law IPI 100,000 BLIPTax Law ICMS 100,000 BLICICMS exempt 0,000 BCIXICMS active 100,000 ICMXIPI active 100,000 IPIXICMS Ind. clearing ICC 100,000 IC1CIPI Ind. clearing IPC 100,000 IP1C

Tax code K8Future Delivery purchasing G/R Resale All taxesTax type Acc. key Rate Condition typeBase amount BASBLevel 200ICMS Industrialization VS2 100,000 ICM1ICMS Ind. Clearing offset ICC 100,000- IC1OLevel 300IPI Consumption In NVV 100,000 IPI2

Tax code K9Future Delivery purchasing I/R Re-sale Statistik taxesTax type Acc. key Rate Condition typeBase amount BASBLevel 200ICMS Ind. Clearing ICC 100,000 IC1CLevel 300IPI Consumption In NVV 100,000 IPI2

Tax code KAInput: Consi Consumption ICMS+IPITax type Acc.

keyRate Condition type

Base amount BASBTax Law IPI 100,000 BLIPTax Law ICMS 100,000 BLICICMS exempt 0,000 BCIXICMS active 100,000 ICMXIPI active 100,000 IPIXIPI Consi. Consumption NVV 100,000 IPIKICMS Consi. Consumption NVV 100,000 ICMK

Tax code KBConsignment - Invoice I/R Resale

Tax type Acc. key Rate Condition typeBase amount BASBLevel 200

Condition-based tax calculation in R/3 for Brazil 60

Page 61: Design CBT Brazil External

SAP Online Help 4/7/2023

ICMS Ind. Clearing ICC 100,000 IC1CLevel 300IPI Consumption In NVV 100,000 IPI2

5.8.6Tax 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 I9Input: ISS

Tax type Acc. key Rate Condition typeBase amount BASBLevel 200IPI Industr. VS1 IPI1

For INSS the tax code must contain the proper tax rate (here: 15% INSS)

Tax code INInput: Consi Consumption ICMS+IPITax type Acc.

keyRate Condition type

Base amount BASBINSS Incoming VST 15,00 INSSINSS offset (100-) INX 100- INSX

5.8.7Tax 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 SDOutput-SD tax: IPI/ICMS/Sub-.Trib.Tax type Acc.

keyRate Condition type

Base amount BASBTax Law IPI 100,000 BLIPTax Law ICMS 100,000 BLICICMS exempt 0,000 BCIXICMS from SD MV2 100,000 ICM3IPI from SD out MW1 100,000 IPIAIPI consum out MW1 100,000 IPIBIPI from SD MW1 100,000 IPI3Substituicao Tributaria MV3 100,000 ICS3

Tax code SZ

Condition-based tax calculation in R/3 for Brazil 61

Page 62: Design CBT Brazil External

SAP Online Help 4/7/2023

Output-SD tax: ICMS Zona Franca

Tax type Acc. key Rate Condition typeBase amount BASBLevel 500ICMS from SD MV2 100,000 ICM3Substituicao Tributaria MV3 100,000 ICS3ICMS Reversal (Zona Franca) ICZ 100,000 ICZF

Tax code S0Output-SD tax: No tax

Tax type Acc. key Rate Condition typeBase amount BASBLevel 500IPI from SD MW1 IPI3ICMS from SD MV2 ICM3Substituicao Tributaria MV3 ICS3ISS from SD MV4 ISS3

For the outgoing services tax code the field ‘Service’ of the brazilian tax code enhancements has to be marked.

Tax code SIOutput-SD tax: ISS

Tax type Acc. key Rate Condition typeBase amount BASBLevel 500ISS from SD MV4 100,000 ISS3

5.8.8Tax 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 A0Output: Industrialization: No taxTax type Acc.

keyRate Condition type

Base amount BASBTax Law IPI 100,000 BLIPTax Law ICMS 100,000 BLICICMS exempt 0,000 BCIXICMS NF nullv. Indus VST 100,000 ICMNIPI NF nullv. Indus VST 100,000 IPINIPI from SD MW1 IPI3ICMS from SD MW2 ICM3

Tax code A1Output: Industrialization: ICMS

Tax type Acc. key

Rate Condition type

Base amount BASBTax Law IPI 100,000 BLIP

Condition-based tax calculation in R/3 for Brazil 62

Page 63: Design CBT Brazil External

SAP Online Help 4/7/2023

Tax Law ICMS 100,000 BLICICMS exempt 0,000 BCIXICMS active 100,000 ICMXIPI NF nullv. Indus VST 100,000 IPINICMS from SD out MW2 100,000 ICM3

Tax code A3Output: Industrialization: ICMS+IPITax type Acc.

keyRate Condition type

Base amount BASBTax Law IPI 100,000 BLIPTax Law ICMS 100,000 BLICICMS exempt 0,000 BCIXICMS active 100,000 ICMXIPI active 100,000 IPIXICMS from SD out MW2 100,000 ICM3IPI from SD out MW1 100,000 IPI3

Tax code B0Output: Consumption: No tax

Tax type Acc. key Rate Condition typeBase amount BASBLevel 500IPI from SD MW1 IPI3ICMS 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 carrierSD: ICMS base reduction customerISS rates (material-dependent)

5 ICMS, IPI, S.T. material-dependent exceptionsMM: 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