Condition-based tax calculation in R/3 for Brazil
Release 4.70
SAP Online Help
10/5/2012
Content 1 Glossary Glossary And And Typographic Typographic Conventions Conventions........ ................ ................ .............. .......... ........ ........ ........ ........ ...... ..6 2 Overview Overview of the Changes Changes........ ................ ................ ................ ................ .............. .......... ........ ........ ........ ........ ........ ........ ....... ... 7 2.1 Previous Tax Calcula Calculation tion Method...................... ............................................... ............................................... ................................ ..........7 2.2 New Tax Calcula Calculation tion Method........................ ................................................. .......................................................... ................................. ....7
3 Customizing the Brazilian Tax Calculation Calculation........ ................ ............ ........ ........ ........ ........ ........ ........ ........ ......9 3.1 Activation of New Tax Calcula Calculation tion Method...................... .............................................................. ........................................ ...9 3.2 Tax Manage Manager’s r’s Workplace....................... ................................................. ................................................... .......................................... .................9 3.2.1 Entities.............................. ........................................................ ................................................... ............................................................ ...................................10 3.2.1.1 Tax Region Regions s......................... ................................................... ................................................... ....................................... ......................... .............. ...10 3.2.1.2 NCM Codes....................... ................................................ .................................................. ......................................................... ................................10 10 3.2.1.3 Sub.Trib. Groups....................... ................................................. ................................................... .............................................. ....................... ..10 3.2.1.4 CFOP – CFOP Codes....................... ................................................ ................................................... ......................................... ...............11 11 3.2.1.5 CFOP – CFOP Determinatio Determination n MM....... ............... ................ ................ ................ ............... ............... ................ ................ ........11 11 3.2.1.6 CFOP – CFOP Determinatio Determination n SD........ ................ ................ ................ ................ ............... ............... ................ ................ ........11 11 3.2.1.7 CFOP – Length of CFOP Codes........ ................ ................ ................ ................ ................ ................ ............... ............... .......... ..11 11 3.2.1.8 CFOP – CFOP Exceptions MM....................... ................................................................... ............................................ .......11 11 3.2.1.9 CFOP – CFOP Exceptions SD......................... .................................................................... ........................................... .......11 11 3.2.1.10 Tax Laws IPI........................ IPI................................................. .................................................. ..................................................... ............................11 3.2.1.11 Tax Laws ICMS........................ .................................................. ................................................... ............................................ ...................... ...11 11 3.2.2 Tax Calcula Calculation tion...................... ............................................... .................................................. ........................................................ ...............................12 3.2.2.1 Maintain Tax Rates...................... ............................................... ................................................................. ........................................ ......12 12 3.2.2.2 Maintain Tax Groups...................... ............................................... ................................................... ............................................ ..................12 12 3.2.2.3 Tax Codes MM........................ .................................................. ................................................... .............................................. ......................... ....12 12 3.2.2.4 Tax Codes SD...................... ................................................ ................................................... .................................................. ............................ ...12 3.2.2.5 Alternativ Alternative e Calc. Procedu Procedure re...................... ............................................... ............................................... ................................. ...........12 12 3.2.2.6 Tax Code Determina Determination tion SD....................... ................................................. ...................................................... .............................. ..13 13 3.2.2.7 Tax Law Determin Determination ation SD...................... ................................................ ......................................................... ............................... ..13 13 3.2.2.8 Other Country.......................... ................................................... .................................................. ................................................... ..........................13 13 3.2.3 Condition Setup.......................... ................................................... .................................................. ................................................... ..........................13 13 3.2.3.1 Migration – Tax Tables to Condition Conditions s......................... .............................................................. ..................................... ...13 13 3.2.3.2 Migration – Tax Groups in Access Sequences ........ ................ ................ ................ ................ ................ ........... ...13 13 3.2.3.3 Nota-Fiscal Mapping – Tax Values MM........ ............... ............... ................ ................ ................ ................ ............ ....... ...13 13 3.2.3.4 Nota-Fiscal Mapping – Tax Values SD....... ............... ................ ................ ................ ................ ............... ........... ........ ......13 13 3.2.3.5 Nota-Fiscal Mapping – Tax Laws MM......................... .................................................... ...................................... .............14 14 3.2.3.6 Condition Mapping – Internal Codes........................ ....................................................... ............................... ........... ...........14 14 3.2.3.7 Condition Mapping – Assign Condition Conditions s........................ ............................................................. .....................................14 14 3.2.3.8 Condition Mapping – Tax Rate Tables...................... ..................................................... ............................... .......... ..........14 14 Condition-based tax calculation in R/3 for Brazil2
SAP Online Help
10/5/2012
Content 1 Glossary Glossary And And Typographic Typographic Conventions Conventions........ ................ ................ .............. .......... ........ ........ ........ ........ ...... ..6 2 Overview Overview of the Changes Changes........ ................ ................ ................ ................ .............. .......... ........ ........ ........ ........ ........ ........ ....... ... 7 2.1 Previous Tax Calcula Calculation tion Method...................... ............................................... ............................................... ................................ ..........7 2.2 New Tax Calcula Calculation tion Method........................ ................................................. .......................................................... ................................. ....7
3 Customizing the Brazilian Tax Calculation Calculation........ ................ ............ ........ ........ ........ ........ ........ ........ ........ ......9 3.1 Activation of New Tax Calcula Calculation tion Method...................... .............................................................. ........................................ ...9 3.2 Tax Manage Manager’s r’s Workplace....................... ................................................. ................................................... .......................................... .................9 3.2.1 Entities.............................. ........................................................ ................................................... ............................................................ ...................................10 3.2.1.1 Tax Region Regions s......................... ................................................... ................................................... ....................................... ......................... .............. ...10 3.2.1.2 NCM Codes....................... ................................................ .................................................. ......................................................... ................................10 10 3.2.1.3 Sub.Trib. Groups....................... ................................................. ................................................... .............................................. ....................... ..10 3.2.1.4 CFOP – CFOP Codes....................... ................................................ ................................................... ......................................... ...............11 11 3.2.1.5 CFOP – CFOP Determinatio Determination n MM....... ............... ................ ................ ................ ............... ............... ................ ................ ........11 11 3.2.1.6 CFOP – CFOP Determinatio Determination n SD........ ................ ................ ................ ................ ............... ............... ................ ................ ........11 11 3.2.1.7 CFOP – Length of CFOP Codes........ ................ ................ ................ ................ ................ ................ ............... ............... .......... ..11 11 3.2.1.8 CFOP – CFOP Exceptions MM....................... ................................................................... ............................................ .......11 11 3.2.1.9 CFOP – CFOP Exceptions SD......................... .................................................................... ........................................... .......11 11 3.2.1.10 Tax Laws IPI........................ IPI................................................. .................................................. ..................................................... ............................11 3.2.1.11 Tax Laws ICMS........................ .................................................. ................................................... ............................................ ...................... ...11 11 3.2.2 Tax Calcula Calculation tion...................... ............................................... .................................................. ........................................................ ...............................12 3.2.2.1 Maintain Tax Rates...................... ............................................... ................................................................. ........................................ ......12 12 3.2.2.2 Maintain Tax Groups...................... ............................................... ................................................... ............................................ ..................12 12 3.2.2.3 Tax Codes MM........................ .................................................. ................................................... .............................................. ......................... ....12 12 3.2.2.4 Tax Codes SD...................... ................................................ ................................................... .................................................. ............................ ...12 3.2.2.5 Alternativ Alternative e Calc. Procedu Procedure re...................... ............................................... ............................................... ................................. ...........12 12 3.2.2.6 Tax Code Determina Determination tion SD....................... ................................................. ...................................................... .............................. ..13 13 3.2.2.7 Tax Law Determin Determination ation SD...................... ................................................ ......................................................... ............................... ..13 13 3.2.2.8 Other Country.......................... ................................................... .................................................. ................................................... ..........................13 13 3.2.3 Condition Setup.......................... ................................................... .................................................. ................................................... ..........................13 13 3.2.3.1 Migration – Tax Tables to Condition Conditions s......................... .............................................................. ..................................... ...13 13 3.2.3.2 Migration – Tax Groups in Access Sequences ........ ................ ................ ................ ................ ................ ........... ...13 13 3.2.3.3 Nota-Fiscal Mapping – Tax Values MM........ ............... ............... ................ ................ ................ ................ ............ ....... ...13 13 3.2.3.4 Nota-Fiscal Mapping – Tax Values SD....... ............... ................ ................ ................ ................ ............... ........... ........ ......13 13 3.2.3.5 Nota-Fiscal Mapping – Tax Laws MM......................... .................................................... ...................................... .............14 14 3.2.3.6 Condition Mapping – Internal Codes........................ ....................................................... ............................... ........... ...........14 14 3.2.3.7 Condition Mapping – Assign Condition Conditions s........................ ............................................................. .....................................14 14 3.2.3.8 Condition Mapping – Tax Rate Tables...................... ..................................................... ............................... .......... ..........14 14 Condition-based tax calculation in R/3 for Brazil2
SAP Online Help
10/5/2012
3.2.3.9 Access Sequenc Sequences es – Access Sequenc Sequences es MM...................... ..................................... ........................... .............. ..14 14 3.2.3.10 Access Sequenc Sequences es – Access Sequence Sequences s SD........................ .................................. ...................... ................ ....14 14 3.2.3.11 Condition Types – Condition Types MM........ ................ ................ ................ ............... ............... ............... ........... ......14 14 3.2.3.12 Condition Types – Condition Types SD........ ............... ............... ................ ................ ................ ............... ........... ...... ..15 15 3.2.3.13 Calc. Procedures – Calc. Procedures MM........................ ..................................... ......................... .................. ......15 15 3.2.3.14 Calc. Procedures – Calc. Procedures SD...................... ........................................ ............................. ................ .....15 15 3.2.3.15 Tax Types...................... ............................................... .................................................. ........................................................... ..................................15 3.3 Maintena Maintenance nce of Tax Tables........................ ................................................. ................................................... ...................................... ............15 15 3.4 Tax Groups of Dynamic Exceptions........ ................ ............... ............... ................ ................ ................ ................ ................ ........... ...15 15 3.5 Access Sequence Sequences s...................... ................................................ ................................................... .................................................... ...........................19 19 3.5.1 Tax Groups in Access Sequence Sequences s....................... ................................................. .................................................. ........................19 19 3.5.2 Automatic Adjustment of Access Sequen Sequences ces...................... ........................................................ ..................................20 20 3.6 Condition Types....................... ................................................ .................................................. ................................................... ................................ ......21 3.7 Tax Calculation Procedure...................... ............................................... .................................................. ......................................... ................21 21 3.8 Alternative Calculat Calculation ion Procedu Procedure re........................ ................................................. ..................................................... ............................22 22 3.9 Internal Condition Codes........................ .................................................. ................................................... ......................................... ................22 22 3.10 Assignment of Condition Types to Internal Codes....................... ................................... ........................ .............. ..22 22 3.11 Assignment of Condition Tables to Tax Tables....................... ...................................................... ...............................22 22 3.12 Definition of Tax Types......................... .................................................. .................................................. .......................................... .................22 22 3.13 Customiz Customizing ing FI/MM Tax Codes....................... ................................................ .................................................. ............................... ......23 23 3.13.1 One Single Tax Code Maintena Maintenance nce Tool............................................................. Tool .............................................................23 23 3.13.2 Maintenance of Tax Code Conditions ....... ............... ................ ................ ................ ................ ................ ................ ........... ...25 25 3.13.3 Hints on Customiz Customizing ing Tax Code Conditions.......................... ........................................................ ..............................26 26 3.14 Mapping of Tax Values to the Nota Fiscal.............................................................. Fiscal ..............................................................26 26 3.15 Mapping of Tax Laws to the Nota Fiscal................................................................. Fiscal .................................................................26 26 3.16 Migration of Tax Data to Condition Records ........ ................ ................ ................ ............... ............... ............... ........... ......27 27 3.16.1 Check Condition Conditions s......................... .................................................. ........................................................................ ...............................................27 27 3.16.2 Convert Tax Data to Condition Records...................... ............................................... ................................... ............... .....28 28 3.17 Sequence for SD Tax Code Determination...................... .................................................. ...................................... ..........28 28 3.18 Sequence for SD Tax Law Determination.......................... .................................................. .................................... ............28 28
4 Detailed Design......... ................. ................ ................ ................ ................ ................ ................ ............. ......... ........ ........ ........ ........ ...... 30 4.1 New DDIC Elements........................ ................................................. ............................................................... ...................................... ..........30 30 4.1.1 Tables................................. .......................................................... .................................................. ........................................................... ..................................30 4.1.2 Views....................... ................................................ .................................................. ..................................................................... ............................................33 . 4.1.3 Search Helps........................ ................................................. .................................................. ......................................................... ................................34 34 4.1.4 Data Elements.......................... ................................................... .................................................. ..................................................... ............................34 34 4.1.5 Domains................................................. .......................................................................... .................................................. ........................................ ...............35 4.2 Chang Changes es of Existing DDIC Elements...................... ............................................... ........................................... ......................... .......35 35 4.2.1 Tables................................. .......................................................... .................................................. ........................................................... ..................................35 4.2.2 Views....................... ................................................ .................................................. ..................................................................... ............................................36 . 4.2.3 Data Elements.......................... ................................................... .................................................. ..................................................... ............................36 36 4.2.4 Domain Domains s....................... ................................................. ................................................... .................................................. ........................................ ...............36 4.3 New Formulas...................... ............................................... ................................................... ............................................. ............................... ............... ...36 Condition-based tax calculation in R/3 for Brazil3
SAP Online Help
10/5/2012
4.3.1 Condition Value Formulas......................................................................................37 4.3.1.1 Formula 177........................................................................................................37 4.3.1.2 Formula 163........................................................................................................37 4.3.1.3 Formula 175........................................................................................................37 4.3.1.4 Formula 164........................................................................................................38 4.3.1.5 Formula 162........................................................................................................39 4.3.1.6 Formula 171........................................................................................................39 4.3.1.7 Formula 165........................................................................................................40 4.3.1.8 Formula 167........................................................................................................40 4.3.1.9 Formula 169........................................................................................................41 4.3.1.10 Formula 172......................................................................................................41 4.3.1.11 Formula 170......................................................................................................41 4.3.1.12 Formula 173......................................................................................................42 4.3.1.13 Formula 176......................................................................................................42 4.3.1.14 Formula 178......................................................................................................43 4.3.2 Condition Base Value Formulas............................................................................43 4.3.2.1 Formula 160........................................................................................................43 4.3.2.2 Formula 161........................................................................................................43 4.3.2.3 Formula 162........................................................................................................44 4.3.2.4 Formula 163........................................................................................................44 4.3.2.5 Formula 164........................................................................................................44 4.3.3 Pricing Requirement Formulas..................................................................... .........44 4.3.3.1 Formula 160........................................................................................................44 4.3.3.2 Formula 161........................................................................................................45 4.4 DDIC Class: CL_TAX_CONDITION.................................................................... .....45 4.5 DDIC Class: CL_DATE_DETERMINE ......................................................................46 4.6 DDIC Class: CL_KEYFINDER..................................................................................46 4.7 Business Add-In: TAX_CONDITIONS......................................................................46 4.7.1 Method FILL_KOMK_KOMP..................................................................................46 4.7.2 Method PROCESS_TKOMV..................................................................................47 4.8 Automatic Generation of Condition Records in the View Maintenance...................47 4.8.1 Classes...................................................................................................................47 4.8.2 Event 01..................................................................................................................48 4.8.3 Function Module J_1B_TRANSFER_TAX_CONDITION......................................48
5 Standard Customizing................................................................................ 49 5.1 Access Sequences MM.............................................................................................49 5.2 Condition Types MM......................................................................................... ........49 5.3 Calculation Procedure in MM (FI): TAXBRC............................................................49 5.3.1 Step 100.......................................................................................................... .......49 5.3.2 Step 110.......................................................................................................... .......49
Condition-based tax calculation in R/3 for Brazil4
SAP Online Help
10/5/2012
5.4 Internal Condition Codes...........................................................................................49 5.5 Assignment of Condition Types to Internal Codes...................................................50 5.6 Assignment of Tax Rate Tables to Condition Tables........................................... ....51 5.7 Definition of Tax Types..............................................................................................51 5.8 Standard Tax Codes......................................................................................... ........52 5.8.1 Tax codes for non taxable transactions.................................................................53 5.8.2 Tax codes for incoming movements - Industrialization............................... ..........53 5.8.3 Tax codes for incoming movements - Consumption......................................... ....55 5.8.4 Tax codes for incoming movements - ICMS Sub.Trib. on freight.........................57 5.8.5 Tax codes for incoming movements - Future delivery purchasing / Consignment ...........................................................................................................................57 5.8.6 Tax codes for incoming movements - Services - ISS and INSS...........................59 5.8.7 Tax codes for outgoing movements - Ind.+Cons. posted in SD............................60 5.8.8 Tax codes for transfer postings - outgoing movements - Ind.+Cons....................61 5.9 Reserved Tax Groups of Dynamic Exceptions.........................................................62
Condition-based tax calculation in R/3 for Brazil5
SAP Online Help
10/5/2012
1 Glossary And Typographic Conventions Condition record – Data record with condition rate, possibly units, text, and other data Condition table – Table that stores the numbers of condition records Condition-based tax calculation (CBT) – Contrary to external tax calculation, in the CBT all calculation and tax rate determination is done by standard condition technique (pricing) Tax 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 procedure was processed. In other words, the table with the pricing results.
In this document, sections that are only valid for specific application areas are marked at the side of the text: Sections that are only relevant for condition based tax calculation are marked with a grey line and the text CBT .
CBT
Sections that are only relevant for Materials Management are marked with a grey line and the text MM .
MM
Sections that are only relevant for Sales and Distribution are marked with a grey line and the text SD.
SD
Condition-based tax calculation in R/3 for Brazil6
SAP Online Help
10/5/2012
2 Overview of the Changes 2.1 Previous Tax Calculation Method The previous way of calculating Brazilian taxes made use of the external tax interface. The task of tax calculation is being executed by a dedicated function module rather than by direct processing of the tax calculation procedure assigned to the country, using the tax rates customized in transaction FTXP. The previous standard calculation procedure assigned to Brazil, TAXBRJ, does not actually make use of the calculation functionality provided by the pricing modules, but only calls the function module J_1BCALCULATE_TAXES in formula 320. All the tax calculation logic is contained in this function module. The tax code serves to indicate which taxes are due, activating specific lines in the calculation procedure by setting the respective rate to 100%. Lines (taxes) which are not to be taken into account for the respective tax code have to be deactivated (N.B.: not only set to be 0%). However, a significant amount of logic that deals with specific special cases of the complicated Brazilian tax system is hidden in the function module, thus preventing a flexible and t ransparent adaption of the tax calculation logic to new legal requirements or special customer needs. Moreover, the tax rates are being read from the database in function J_1BCALCULATE_TAXES and not detemined by the standard condition technique that is meant to get the rates based on the actual entries in the communication structures KOMP and KOMK. The values of the various taxes are being fetched by base formulas 301 – 308 and value formulas 521 – 528 which only serve to get the values stored in the global variables of function group J1BR by the module J_1BCALCULATE_TAXES.
2.2 New Tax Calculation Method The new approach of the Brazilian tax calculation that is decribed in this design document makes use of the standard condition technique to calculate the taxes. During the tax calculation, by calls to the function module PRICING a calculation procedure is processed. The rates are stored as condition records and determined during the pricing procedure based on the actual values of the fields of the communication structures KOMP and KOMK. The whole calculation logic is contained in the calculation procedure itself without calling an external function module. Formulas are only used to do special calculations that are not provided by the standard pricing functionality. These formulas typically consist of only a few lines of code, processing at most four parameters that are stored in the work fields XWORKD and XWORKE, the base value XKAWRT of the respective line in the calculation procedure, and the condition rate XKOMV-KBETR. The tax rates, tax laws, and special indicators considering the appearance of the tax line item in the nota fiscal are maintained in Brazil-specific views J_1BTX* (e.g. J_1BTXIP1 contains the IPI rates). In the old method, the underlying tables are being read directly in the function module J_1BCALCULATE_TAXES. In the new approach the data are not only stored in the J_1BTX* tables, but are additionally present as condition records on the database. These records can be directly read by the pricing logic so that no extra database selections have to be performed in formulas being processed in the calculation procedure. Furthermore, the condition records can easily be transferred to other systems (e.g. CRM systems). The generation of the condition records takes place during the view mainenance of the J_1BTX* tables. By making use of the event technique provided in the extended table maintenance (transaction SE54), condition records are automatically written, updated, or deleted when data are maintained in the views and saved to the database. Which conditions are to be generated is being customized in mapping tables that are described in section 3. The generation of the nota fiscal used to be partly performed in J_1BCALCULATE_TAXES in the old method. In the new method, all logic which values are written in which fields in the nota fiscal line items and which tax lines are generated is customized in another mapping table and by the customizing of the tax code. Basically, the system is being told which lines and values of the table of the calculation procedure contain which tax items. Thus, the whole nota-fiscal-mapping logic is
Condition-based tax calculation in R/3 for Brazil7
SAP Online Help
10/5/2012
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 Brazil8
SAP Online Help
10/5/2012
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 relevant for the Brazilian tax calculation. It is called by the transaction J1BTAX and can also be accessed from the IMG: IMG Financial Accounting Financial Accounting Global Settings Tax on Sales/Purchases Calculation Settings for Tax Calculation in Brazil Access Tax 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.
Figure 1. Activation of new tax calculation method. Condition-based tax calculation in R/3 for Brazil9
CBT
SAP Online Help
10/5/2012
Figure 2. Initial screen of the Tax Manager’s Workplace.
3.2.1 Entities In this menu, Customizing steps are collected that define basic constants that are relevant for the Brazilian tax calculation.
3.2.1.1 Tax Regions Assignment of geographical regions to tax regions that are used in the ship-from and ship-to fields during the tax calculation. If the Tax-Free Zone indicator is set and the condition-based tax calculation is active (see section 3.1), a condition record with a rate of 100% is generated in the background whose type was assigned to the internal code TAXFREEREGION. This condition can be used in the tax calculation procedure to perform special handling of tax-free regions. The IMG activity that corresponds to this menu item can be found in IMG Financial Accounting Financial Accounting Global Settings Tax on Sales/Purchases Basic Settings Brazil Tax Regions. The corresponding maintenance view is J_1BTREGV.
3.2.1.2 NCM Codes Definition of NCM codes. The IMG activity that corresponds to this menu item can be found in IMG Cross Application Components General Application Functions Nota Fiscal NCM Codes Define NCM Codes. The corresponding maintenance view is J_1BT604FV.
3.2.1.3 Sub.Trib. Groups Definition of possible 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 maintenance view is J_1BTXSTGV. Condition-based tax calculation in R/3 for Brazil10
SAP Online Help
10/5/2012
3.2.1.4 CFOP – CFOP Codes Definition of CFOP codes. The IMG activity that corresponds to this menu item can be found in IMG Cross Application Components General Application Functions Nota Fiscal CFOP CFOP. The corresponding maintenance view is J_1BAGV.
3.2.1.5 CFOP – CFOP Determination MM Rules for the determination of the CFOP codes in MM applications. The IMG activity that corresponds to this menu item can be found in IMG Cross Application Components General Application Functions Nota Fiscal CFOP CFOP Determination for Goods Receipts and Returns. The corresponding maintenance view is J_1BAOV.
MM
3.2.1.6 CFOP – CFOP Determination SD Rules for the determination of the CFOP codes in SD applications. The IMG activity that corresponds to this menu item can be found in IMG Cross Application Components General Application Functions Nota Fiscal CFOP CFOP Determination for Goods Issues and Returns. The corresponding maintenance view is J_1BAPV.
SD
3.2.1.7 CFOP – Length of CFOP Codes Definition of the length of CFOP extensions that are used in certain Brazilian states. The IMG activity that corresponds to this menu item can be found in IMG Cross Application Components General Application Functions Nota Fiscal CFOP Define Length of CFOP Extensions. The corresponding maintenance view is J_1BCFOP_XREGV.
3.2.1.8 CFOP – CFOP Exceptions MM Rules for the determination of special CFOP codes in MM applications. These CFOP codes are used in certain Brazilian states that require a different CFOP code format. The IMG activity that corresponds to this menu item can be found in IMG Cross Application Components General Application Functions Nota Fiscal CFOP Exceptions for Incoming Goods Movements and Returns. The corresponding maintenance view is J_1BAOXV.
MM
3.2.1.9 CFOP – CFOP Exceptions SD Rules for the determination of special CFOP codes in SD applications. The IMG activity that corresponds to this menu item can be found in IMG Cross Application Components General Application Functions Nota Fiscal CFOP Exceptions for Outgoing Goods Movements and Returns. The corresponding maintenance view is J_1BAPXV.
3.2.1.10 Tax Laws IPI Definition of IPI tax laws. The IMG activity that corresponds to this menu item can be found in IMG Financial Accounting Financial Accounting Global Settings Tax on Sales/Purchases Basic Settings Brazil Define IPI Tax Laws. The corresponding maintenance view is J_1BATL2V.
3.2.1.11 Tax Laws ICMS Definition of ICMS tax laws. The IMG activity that corresponds to this menu item can be found in IMG Financial Accounting Financial Accounting Global Settings Tax on Sales/Purchases Basic Settings Brazil Define ICMS Tax Laws. The corresponding maintenance view is J_1BATL1V.
Condition-based tax calculation in R/3 for Brazil11
SD
SAP Online Help
10/5/2012
3.2.2 Tax Calculation In this menu, Customizing steps are collected that control the rates, flags, and texts that are used in the tax calculation.
3.2.2.1 Maintain Tax Rates Selecting this menu item starts the maintenance of the tax rates of the selected line in the table of the overview screen. It can also be accessed by pressing the button in the application toolbar or by double-clicking the line in the table. If the condition-based tax calculation is active, condition records are being generated, modified, or deleted automatically in the background when the data are saved. The IMG activities that correspond to this menu item can be found in IMG Financial Accounting Financial Accounting Global Settings Tax on Sales/Purchases Calculation Settings for Tax Calculation in Brazil Tax Rates.
3.2.2.2 Maintain Tax Groups Here you define tax groups used in the dynamic tax exceptions. The activity can also be accessed by pressing the button in the application toolbar. Groups in the range from 10 to 89 can be defined. The numbers between 0 and 9 as well as between 90 and 99 are reserved for SAP. These groups must not be deleted. To use newly defined tax groups requires additional Customizing activities when the conditionbased tax calculation is used. See section 3.4 for further information. The IMG activitity that corresponds to this menu item can be found in IMG Financial Accounting Financial Accounting Global Settings Tax on Sales/Purchases Calculation Settings for Tax Calculation in Brazil Tax Rates Maintain Tax Groups for Dynamic Exceptions. The corresponding table is J_1BTXGRUOP.
3.2.2.3 Tax Codes MM Definition of FI tax codes that are used in MM applications. The activity can also be accessed by pressing the MM button in the application toolbar. Details for this Customizing step can be found in section 3.13.
MM
The IMG activitity that corresponds to this menu item can be found in IMG Financial Accounting Financial Accounting Global Settings Tax on Sales/Purchases Calculation Settings for Tax Calculation in Brazil Define MM Tax Codes. The corresponding maintenance view is J_1BTAXCODEV.
3.2.2.4 Tax Codes SD Definition of tax codes that are used in SD applications. The activity can also be accessed by pressing the SD button in the application toolbar. The IMG activitity that corresponds to this menu item can be found in IMG Financial Accounting Financial Accounting Global Settings Tax on Sales/Purchases Calculation Settings for Tax Calculation in Brazil Define SD Tax Codes. The corresponding maintenance view is J_1BTAXCODEV.
SD
3.2.2.5 Alternative Calc. Procedure Assignment of tax codes defined for a tax calculation procedure to a different combination of tax code/calculation procedure. Details can be found in section 3.8. The IMG activitity that corresponds to this menu item can be found in IMG Financial Accounting Financial Accounting Global Settings Tax on Sales/Purchases Basic Settings Brazil Define Alternative Calculation Procedure. The corresponding maintenance view is J_1BMWSKZKALSMV.
Condition-based tax calculation in R/3 for Brazil12
MM
SAP Online Help
10/5/2012
3.2.2.6 Tax Code Determination SD Definition of the sequence of the determination logic of the SD tax codes. Details can be found in section 3.17. The IMG activitity that corresponds to this menu item can be found in IMG Financial Accounting Financial Accounting Global Settings Tax on Sales/Purchases Calculation Settings for Tax Calculation in Brazil Define Sequence for SD Tax Code Determination. The corresponding table is J_1BTXCODESEQ.
SD
3.2.2.7 Tax Law Determination SD Definition of the sequence of the determination logic of the SD tax laws. The IMG activitity that corresponds to this menu item can be found in IMG Financial Accounting Financial Accounting Global Settings Tax on Sales/Purchases Basic Settings Brazil Define Sequence for SD Tax Law Determination. The corresponding table is J_1BTXLAWSEQ.
SD
3.2.2.8 Other Country Here a different country can be selected. At the start of the Tax Manager’s Workplace the country is determined from the set/get parameter LND. If this parameter has no value the user is prompted for a country that is stored in this parameter afterwards. This can also be executed by choosing this menu point. The calculation procedure assigned to the selected country (in table T005) is then taken as the default value.
3.2.3 Condition Setup In this menu, all Customizing steps are collected that are related to the condition technique in the tax calculation.
3.2.3.1 Migration – Tax Tables to Conditions Choosing this menu point, the generation of condition records out of the entries in the Brazilian tax tables can be triggered initially, and the correct conversion can be monitored. Details can be found in section 3.16. There is no entry in the IMG to start this activity. The TMW always has to be used for this.
CBT
3.2.3.2 Migration – Tax Groups in Access Sequences You use this activity to automatically update access sequences after you have created or changed tax groups for dynamic exceptions. Details can be found in section 3.5.2.
CBT
You need to have authorization for cross-client Customizing if you want t o modify the access sequences. It is important that you ensure that tax groups are not customized differently in different clients because with each conversion to access sequences, the previous Customizing settings will be overwritten.
3.2.3.3 Nota-Fiscal Mapping – Tax Values MM Here it is customized which fields of the table of the tax calculation procedure used in MM contain the values of the nota fiscal. Details can be found in section 3.14. The IMG activitity that corresponds to this menu item can be found in IMG Financial Accounting Financial Accounting Global Settings Tax on Sales/Purchases Basic Settings Brazil ConditionBased Tax Calculation Map MM Tax Values to Nota Fiscal Fields. The corresponding maintenance view is J_1BNFTXCONDMMV.
CBT MM
3.2.3.4 Nota-Fiscal Mapping – Tax Values SD Here it is customized which fields of the table of the calculation procedure used in SD contain the values of the nota fiscal. Details can be found in section 3.14. The IMG activitity that corresponds to this menu item can be found in IMG Financial Accounting Financial Accounting Global Settings Tax on Sales/Purchases Basic Settings Brazil Condition-Based Tax
Condition-based tax calculation in R/3 for Brazil13
CBT SD
SAP Online Help
10/5/2012
Calculation Map SD Tax Values to Nota Fiscal Fields.The corresponding maintenance view is J_1BNFTXCONDV.
3.2.3.5 Nota-Fiscal Mapping – Tax Laws MM Here it is customized which fields of the table of the tax calculation procedure used in MM contain the tax law texts of the nota fiscal. Details can be found in section 3.15. The IMG activitity that corresponds to this menu item can be found in IMG Financial Accounting Financial Accounting Global Settings Tax on Sales/Purchases Basic Settings Brazil Condition-Based Tax Calculation Map MM Tax Laws to Nota Fiscal Fields. The corresponding maintenance view is J_1BNFLWCONDMMV.
CBT MM
3.2.3.6 Condition Mapping – Internal Codes Definition of internal codes used in the condition-based tax calculation. Details can be found in section 3.8. The IMG activitity that corresponds to this menu item can be found in IMG Financial Accounting Financial Accounting Global Settings Tax on Sales/Purchases Basic Settings Brazil Condition-Based Tax Calculation Define Internal Codes for Tax Conditions. The corresponding maintenance view is J_1BCONDMAPV.
CBT
3.2.3.7 Condition Mapping – Assign Conditions Assignment of condition types to the internal codes. Details can be found in section 3.10. The IMG activitity that corresponds to this menu item can be found in IMG Financial Accounting Financial Accounting Global Settings Tax on Sales/Purchases Basic Settings Brazil Condition-Based Tax Calculation Assign Internal Codes for Tax Conditions to Condtion Types. The corresponding table is J_1BTXCOND.
CBT
3.2.3.8 Condition Mapping – Tax Rate Tables Assignment of tax rate tables to the condition tables. Details can be found in section 3.11. The IMG activitity that corresponds to this menu item can be found in IMG Financial Accounting Financial Accounting Global Settings Tax on Sales/Purchases Basic Settings Brazil Condition-Based Tax Calculation Assign Tax Rate Tables to Condition Tables. The corresponding table is J_1BVIEWMAP.
CBT
3.2.3.9 Access Sequences – Access Sequences MM Definition of access sequences with application TX . These access sequences can be used in the tax calculation that is called by the MM applications. The IMG activitity that corresponds to this menu item can be found in IMG Financial Accounting Financial Accounting Global Settings Tax on Sales/Purchases Basic Settings Check Calculation Procedure – Access Sequences. The corresponding view cluster is VVC_T682_TX.
MM
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.
SD
3.2.3.11 Condition Types – Condition Types MM Definition of condition types with application TX . These condition types can be used in the tax calculation that is called by the MM applications. The IMG activitity that corresponds to this menu item can be found in IMG Financial Accounting Financial Accounting Global Settings Tax on Sales/Purchases Basic Settings Check Calculation Procedure – Define Condition Types. The corresponding maintenance view is VV_T685A_V1.
Condition-based tax calculation in R/3 for Brazil14
MM
SAP Online Help
10/5/2012
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.
SD
3.2.3.13 Calc. Procedures – Calc. Procedures MM Definition of tax calculation procedures. These calculation procedures can be used in the tax calculation that is called by the MM applications. The IMG activitity that corresponds to this menu item can be found in IMG Financial Accounting Financial Accounting Global Settings Tax on Sales/Purchases Basic Settings Check Calculation Procedure – Define Procedures. The corresponding view cluster is VVC_T683_TX.
MM
3.2.3.14 Calc. Procedures – Calc. Procedures SD Definition of pricing calculation procedures. These access sequences can be used in the SD pricing procedures. The IMG activitity that corresponds to this menu item can be found in IMG Sales and Distribution Basic Functions Pricing Pricing Control Define And Assign Pricing Procedures. The corresponding view cluster is V_T683.
3.2.3.15 Tax Types In this IMG activity, you define tax types for Brazil. Here it is customized which fields of the pricing procedure results table contain the values of the Nota Fiscal. Details can be found in section 3.14. Furthermore, you can set the LPP (Last Purchase Price) indicator for each tax type in order to activate the recording of the LPP. Further details can be found in the document Last purchase price in R/3 for Brazil . The IMG activitity that corresponds to this menu item can be found in IMG Financial Accounting Financial Accounting Global Settings Tax on Sales/Purchases Basic Settings Brazil Define Tax Types. The corresponding maintenance view is J_1BNFTXCONDMMV.
3.3 Maintenance of Tax Tables Selecting a line of the table on the overview screen of the TMW leads to the maintenance view of the selected table. If a table with dynamic exceptions is selected the user is prompted for the tax group prior to the table maintenance. The screenshot in Figure 3 shows an example, the maintenance view J_1BTXIP3V. If the condition-based tax calculation is active (see section 3.1), condition records are generated and changed automatically when the data that are entered in these views are saved. These conditions are accessed in the tax calculation. The Brazilian tables are no longer accessed anywhere in the applications and only serve as a comfortable way of simultaneously maintaining multiple conditions having the same key fields. It is possible to display the automatically generated condition records in transaction FV13. However, never may these condition records be changed or deleted with transaction FV12 or new conditions be created with transaction FV11. This will lead to inconsistencies between the data in the Brazilian tax tables and the condition records. In section 3.16, it is decribed how to verify and reestablish the consistency of the data.
3.4 Tax Groups of Dynamic Exceptions The screenshot in Figure 4 shows the maintenance of the table J_1BTXGRUOP in which the groups of dynamic tax exceptions are defined. For each tax group, you can specify up to three key fields that are to be used to determine the tax rates. You can choose from the following key fields: material, NCM code, material class/material group, tax code, vendor, customer, industry
Condition-based tax calculation in R/3 for Brazil15
SD
SAP Online Help
10/5/2012
sector, and city code. All of the fields are taken from the customer, vendor, and material master records - with the exception of the tax code, which is taken from the item level in the transactions.
Condition-based tax calculation in R/3 for Brazil16
SAP Online Help
Condition-based tax calculation in R/3 for Brazil17
10/5/2012
SAP Online Help
10/5/2012
Figure 3. Maintenance of the tax rate table J_1BTXIP3, tax group 6, in the view J_1BTXIP3V. The dynamic key fields are material and vendor.
The number of the tax group determines which rates are taken i n case of more than one matching record. For example, supposed tax group 50 has the key field NCM code and tax group 51 has the key field material class. If in the tax calculation a record is found as well for tax group 50 as for group 51, the record of group 50 will be taken since i t 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 subapplications PO, IM , and IV , are no longer supported since it makes no sense to use, for example, different tax rates in the invoice compared to the purchase order. Also it can be restricted to be used only for certain tax types by only setting some tax type indicators in the columns at the right side of the table. You can individually activate the consideration of a tax group in the tax rate determination for the types ICMS, IPI, ISS, and SubTrib (ST). In the former tax calculation method, the described logic is programmed in the tax-calculating function, J_1BCALCULATE_TAXES. When using the new tax calculation, this logic has to be transferred to the customizing of the access sequences belonging to the conditions that store the tax rates. See section 3.5.1 for a detailed description how this is realized. Using CBT, in the standard setup delivered by SAP the tax data belonging to different tax groups are stored in condition records that have the same condition table. In order to identify which tax group an entry in the condition table belongs to, the condition table contains a key field TAXGROUP. However, this condition table is not only used for dynamic tax exceptions, but for other tax tables. For example, condition table 382 is used for all ICMS tax tables, i.e. J_1BTXIC1, J_1BTXIC2, and J_1BTXIC3). Therefore, SAP defines standard tax groups that are not to be used by customers. They are listed in section 5.9. In consequence, customers may only use tax group numbers in the range from 10 to 89. The other numbers are reserved for SAP.
Condition-based tax calculation in R/3 for Brazil18
SAP Online Help
10/5/2012
Figure 4. Maintenance of tax groups of dynamic exceptions. The displayed groups are an example which is not deliverd as standard.
3.5 Access Sequences In the TMW, the maintenance of access sequences is accessed by selecting the menu item Condition Setup – Access Sequences MM and Access Sequences SD. This calls the maintenance of the view clusters VVC_T682_TX and V_T682, respectively. Access sequences are cross-client data. In section 5.1, the access sequences and the underlying condition tables and fields that are used for the access are described. The new access sequences are shown in Table 5-3.
3.5.1 Tax Groups in Access Sequences Whenever a new tax group was created or an existing group was changed, e.g. tax type indicators were switched on and off, the application was changed, or even key fields were changed, the access sequences have to be adjusted accordingly if the condition-based tax calculation is used. A new step has to be included in all those access sequences that are used by conditions that are used to calculate taxes of the type that is switched as active in the customizing of the tax group. A program, J_1B_EXT_ACC_SEQ, is provided that can do this automatically. This is described in section 3.5.2. If you change the access sequences manually, the following example illustrates what you need to change. Suppose you create tax group 50 with two key fields city code and NCM code, calling application General , and marked as active for ICMS only. Then, you need to extend all MM and SD access sequences that are used in the ICMS conditions – by adding step 50. One example from MM is BRIB. You can create step 50 by copying step 5, since they both use the same condition table (the one corresponding to material-dependent exceptions). By copying step 5, you take over the assignment of fields and constant values for the fields - except for the dynamic ones. In the field assignment, you need to assign the city code to dynamic field 1, the NCM code to field 2, and the constant 'X' to field 3. Lastly, assign the constant value '50' to the field Tax group , so that the system can uniquely identify the record during rate determination.
Condition-based tax calculation in R/3 for Brazil19
CBT
SAP Online Help
10/5/2012
If you do not use condition-based tax calculation, you do not need to adjust the corresponding access sequences. In this case, the system searches through the defined order of key fields of an active group as described above.
3.5.2 Automatic Adjustment of Access Sequences With the report J_1B_EXT_ACC_SEQ you can automatically adjust all access sequences that are used by condition types used for the condition-based tax calculation. Figure 5 shows the initial selection screen. You need to have authorization for cross-client Customizing if you want t o modify the access sequences. It is important that you ensure that tax groups are not customized differently in different clients because with each conversion to access sequences, the previous Customizing settings will be overwritten. On the program selection screen, you enter the tax groups you want to include in the update. You can simulate the results of the program by setting the Simulate Only indicator. This is extremely important, since the program makes cross-client changes to your data. If you have no authorization for cross-client customizing, this i ndicator is set by default and cannot be cleared. Additionally, you need to specify what type of conversion is to take place:
•
Update access sequences - if you want to update existing steps in the access sequences.
•
Insert into the access sequences - if you want to include new steps in the access sequences after creating a new tax group .
•
Delete from access sequences - if you want to delete existing steps from the access sequences.
Following the conversion or the simulation, the system displays a log that contains all messages issued during processing. In detail, the system behaves as follows based on the selected option: A. Update access sequences
Figure 5. Selection screen of the program that automatically adjusts access sequences based on the Customizing of the tax groups of dynamic exceptions. Condition-based tax calculation in R/3 for Brazil20
CBT
SAP Online Help
10/5/2012
•
If the system finds a step in the access sequence that has the same number of the tax group, it overwrites the step's field assignment with the values customized for the tax group.
•
If the system does not find a corresponding step in the access sequence, it inserts a new step.
•
If the system finds a step in the access sequence that corresponds to the selected tax group, but the Customizing settings indicate that this access sequence is not to have this step, then the system deletes the step from the access sequence.
B. Insert into access sequences Select this option if the tax groups you have specified have no corresponding steps and field assignments in the access sequences yet (this would be when you have created a new tax group). If the system does find a step with the number of the tax group in an access sequence, it displays one of the following in the application log:
•
Warning message: if the existing field assignment is identical to the field assignment that would be generated by the conversion
•
Error message: if the actual field assignment differs, in which case the system does not change the access sequence
C. Delete from access sequences Select this option if the tax groups you have specified are to be deleted from all access sequences used in the CBT.
3.6 Condition Types The condition types that have to be defined can be classified in four categories: 1.
CBT
Conditions containing tax data. These condition records are maintained automatically during the maintenance of the Brazilian tax rate tables. An internal code must be assigned to each condition in table J_1BTXCOND (see sections 3.8 and 3.10).
2. Conditions that refer to other conditions. These are conditions that have a reference condition containing the data. They are used to reuse a condition value in another line of the calculation procedure. 3.
Conditions that are only used to mark specific lines of the calculation procedure to use them in the Nota Fiscal mapping tables. The access sequence BRB1 is a dummy that always accesses the conditions with LAND1=‘BR’ in the condition table A391. For these conditions, one single condition record has to be created manually with transaction FV11. Specify 100% as condition value in order to simply take over the base value (KAWRT) in the calculation procedure to the condition value (KWERT).
4. Conditions indicating that a certain tax type is due. These condition types have to be entered also in the table J_1BAJ to classify them as tax type. The maintenance of the tax types is accessed in the TMW under Condition Setup – Tax Types. The records are maintained by customizing the tax codes. The newly created condition types are described in section 5.2.
3.7 Tax Calculation Procedure The new standard tax calculation procedure for Brazil is TAXBRC. The customizing of calculation procedures is done in the view cluster VVC_T683_TX and can be reached from the TMW by choosing Condition Setup – Calc. Procedure MM . This tax calculation procedure has to be assigned to the country BR in table T005. The corresponding IMG activity can be found in IMG Financial Accounting Financial Accounting Global Settings Tax on Sales/Purchases Basic Settings Assign Country To Calculation Procedure.
Condition-based tax calculation in R/3 for Brazil21
CBT MM
SAP Online Help
10/5/2012
A detailed detailed description description of of the new standard standard calcula calculation tion procedu procedure re TAXBRC TAXBRC can be found found in section 5.3.
3.8 Al Alter ternat native ive Calc Calcula ulatio tion n Proced Procedure ure 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.
MM
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 3. 9 In Inte tern rnal al Con Condi ditio tion n Code Codes s An internal code has to be created for each condition type that is to t o be used in the automatic automatic generation of condition records during the maintenance of the Brazilian tax tables. Only the internal codes are used in the program coding. By this mapping, the customers are free to use their own condition types.
CBT
The internal codes are maintained in the TMW by choosing Condition Setup – Condition Map ping – Internal Internal Codes Codes in the menu or maintaining the view J_1BCONDMAPV. The customer usually is not expected to maintain this table because SAP delivers the internal codes required for the standard Brazilian tax calculation. If customers need to define their own internal codes for user-specific coding, they can define new codes beginning with Z . Table 5-4 shows all standard internal condition codes delivered by SAP. For the internal codes that represent condition types that contain data of a specific tax group (ICMS, IPI, ISS, or SubTrib), the respective tax group has to be assigned to the codes. This is necessary for the system to consider the access sequence of the condition type assigned to the internal code in the automatic extension of access sequences after changing tax groups of dynamic exceptions (see section 3.5.2). 3.5.2).
3.10 Assignment of Condition Condition Types to Internal Codes Codes The condition types that are actually used in the tax calculation procedure have to be assigned to the above described internal codes. For the standard Brazilian tax calculation, SAP delivers all internal codes, conditions, and their assignments. Table 5-5 shows the standard mapping delivered by SAP.
CBT
3.11 Assignment of Condition Condition Tables to Tax Tables During During the mainte maintena nance nce of the Brazil Brazilian ian tax tables tables,, condit condition ion record records s are genera generated ted and and changed automatically. In the table J_1BVIEWMAP it has to be specified which condition tables are to be used for a specific tax table. In the case of dynamic exceptions, you additionally specify the condition table per tax group. The default entries delivered by SAP are shown in Table 5-6. 5-6.
3.12Definition of Tax Types The condition types that indicate whether a specific tax is due or whether specific lines are to be listed in the nota fiscal have to be specified in the table J_1BAJ. The condition types are referred to as tax types in this table. They are customized in the view J_1BAJV that can be accessed in the TMW by choosing Condition Setup – Tax Types. Types.
Condition-based tax calculation in R/3 for Brazil22
CBT
SAP Online Help
10/5/2012
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 LPP can be set, indicating that for this tax type the last purchasing price is to be calculated and used in the tax rate determination. Details about this functionality can be found in the document Last purchase price in R/3 for Brazil . Brazil . Table 5-7 shows the standard tax types delivered by SAP.
3.13 Customizing FI/MM FI/MM Tax Codes 3.13.1 One Single Tax Code Maintenance Tool Tool The Customizing of FI/MM tax codes is done in the TMW by choosing Tax Calculation – Tax Codes MM. This leads to the maintenance view J_1BTAXCODEV. It is no longer done with the transaction FTXP. Before the table with the tax codes is displayed, the user is prompted for the calculation procedure. As default, the tax calculation procedure assigned to the country is displayed. This can be overwritten if the feature of alternative calculation procedures (section 3.8) 3.8) is used. Until release 4.6C three customizing steps had to be executed to customize a tax code. First, the conditions of the tax code had to be maintained in transaction FTXP. There it was also specified whether the code belongs to input or output tax. The Brazil-specific fields in table T007A, which contains the tax code data (except the condition records), had to be maintained with the view J_1BTXMMCV. For the automatic determination of tax codes in stock transfer processes, finally the table T007_IT had to be maintained to map SD tax codes (defined in table J_1BTXSDC) against incoming and outgoing tax codes (defined i n T007A).
Condition-based tax calculation in R/3 for Brazil23
SAP Online Help
Condition-based tax calculation in R/3 for Brazil24
10/5/2012
SAP Online Help
10/5/2012
The table T007_IT has been replaced by the new table J_1BT007 in release 4.7. The new view J_1BTAXCODEV allows the maintenance of all fields mentioned in the three steps above at the same time in one line. Figure 6 shows a screenshot of this view.
3.13.2 Maintenance of Tax Code Conditions The conditions belonging to a tax code are maintained by selecting the line with the tax code that is to be maintained and afterwards choosing Goto – Maintain Conditions (Ctrl+F3) or pressing the button on the application toolbar. In case the system does not find a unique assignment of a tax calculation procedure to a country (in table T005), the user i s asked to select a country first. The screenshot in Figure 7 shows an example of the screen where the tax code conditions are maintained. In the table, all condition types are listed that are defined as tax types in the table J_1BAJ (see the previous section) and that are present in the calculation procedure assigned to the country. A tax type is active when the respective checkbox is checked; otherwise it is inactive. When the data are saved in the screen displayed in Figure 6, condition records are automatically being generated. Checked tax types are transferred to condition records with a value of 100%; for unchecked types the respective condition records are deleted so that the line will not appear in the pricing-procedure results table after the execution of the pricing procedure in the tax calculation. The tax code conditions are stored in the condition table A003 which has as key fields the country and the tax code. This is different to the table T007A in which the tax codes are defined for a country and calculation procedure. In the standard tax calculation, only one tax calculation procedure can be assigned to a country in table T005. However, if the new feature of alternative calculation procedures is used (see section 3.8), a different calculation procedure can be used for certain tax codes. For this reason, the tax codes defined for different calculation procedures have to be given different names if their conditions are to be customized differently, in order its conditions do not overwrite the ones of tax codes with the same name assigned to a different calculation pro cedure.
Figure 6. 7. Conditions Overview ofthat the belong tax code tomaintenance. the selected tax code. Condition-based tax calculation in R/3 for Brazil25
SAP Online Help
10/5/2012
3.13.3 Hints on Customizing Tax Code Conditions Compared with the former way of customizing Brazilian tax code conditions, some changes were introduced in the condition-based tax calculation. The basic idea is the same: You activate the lines of the calculation procedure that store the tax amounts which are to be taken for the tax code. The other lines that contain tax code conditions (tax types) are deactivated. The table displayed in Figure 7 is basically a special view on the tax calculation procedure in which only those lines are displayed that contain conditions that are tax types (defined in table J_1BAJ, see section 3.12). What has changed is that no special internal nota-fiscal handling is performed in an external tax calculation any longer. For example, in the old tax calculation method, always as well an ICMS as an IPI line were generated in the nota fiscal, even if, according to the tax code, only one of the two taxes is active (or even no tax, like in the standard tax codes I0 or C0). In the new approach, however, all this logic is customizable in the nota-fiscal mapping table J_1BNFTXCOND, which is explained in section 3.14. In order to generate the IPI or ICMS lines in the nota fiscal that only store the calculation base in the Other Base field in case the respective tax is not due (referred to as dummy line in the following, the following conditions (lines in the table shown in Figure 7) have to be activated too:
• • •
ICMX
Activate if ICMS is due
IPIX
Activate if IPI is due
ICM0, IPI0
Activate if IPI and/or ICMS dummy line is to be generated in the nota fiscal, material usage is consumption
•
ICMN, IPIN
Activate if IPI and/or ICMS dummy line is to be generated in the nota fiscal; usage is not consumption
These special additional conditions that have to be maintained are only relevant for ICMS and IPI, not for ISS, SubTrib, or any other tax group. In section 5.8, the Brazilian tax codes SAP delivers as standard are described. Refer to that section for examples and further explanations.
3.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_1BNFTXCONDMMV (for MM) and J_1BNFTXCONDV (for SD) that define the mapping rules. The screenshot in Figure 8 shows an example.
CBT
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 pricingprocedure results table and the initial value will be transferred. Furthermore, the field of the line of the pricing-procedure results table has to be specified in the column Map. Field . There are three alternatives: the condition base value, KAWRT; the condition rate or amount, KBETR; and the condition value, KWERT.
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-
Condition-based tax calculation in R/3 for Brazil26
CBT MM
SAP Online Help
10/5/2012
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.
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 screenshot 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.
CBT
3.16.1 Check Conditions The entries in the table of the selected line in the list of tax rate tables can be checked for corresponding condition records by choosing Condition Records – Check Conditions (F5) or pressing the button in the application toolbar. For each entry in the respective table it is checked (based on the customizing in the mapping tables J_1BVIEWMAP and J_1BTXCOND) whether corresponding condition records exist. The selections made in the Application group determine whether the conditions for the application TX (used in materials management) or V (used in sales and distribution) are being checked. The entries and the numbers of the corresponding conditions are displayed in the ALV list. By double-clicking a condition record number a modeless popup window is displayed that contains detailed information about the condition record from the corresponding entries in the DDIC tables KONH and KONP. The screenshot in Figure 10 shows an example. 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
Condition-based tax calculation in R/3 for Brazil27
CBT
SAP Online Help
10/5/2012
Figure 9. Mapping of lines in the table of the calculation procedure to tax law texts in the Nota-Fiscal.
corresponding condition records; red means that at least one entry has no condition records so far; yellow means that at least one line has only some converted fields.
3.16.2 Convert Tax Data to Condition Records By choosing Condition Records – Convert (F6) or pressing the button in the application toolbar, the conversion of tax records to conditions is started. It is prerequisite that all customizing of the mapping tables described in this section is already done; otherwise errors are being issued. The selection made in the group Conversion Options determines the mode of conversion. If the first option is chosen, every field is converted in any case, no matter if there already exists a corresponding condition record. If the second option is chosen, the user is asked in case of the previously described situation. If the third option is chosen, only the fields are converted that do not have corresponding condition records so far.
CBT
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 automatically determined in a transaction (e.g. a sales order). It can be either derived from the Item Category, or the Customer/Material Information Record.
CBT SD
By means of the table J_1BTXCODESEQ, a sequence can be defined by which these data sources are accessed. Enter sequential integer numbers and assign the data sources from the drop down menu to them. During the transaction, the system will look up the data sources in ascending order of the sequence number until a tax code is found. Table 3-1. Example of a sequence for tax code determination. Sequence in Tax Code Determination 1 2
Source for Tax Code Determination Item Category Table Customer Material Information
An example is shown in Table 3-1. In this example the system would first look up the item category table and if no tax code was found, the customer material information.
3.18Sequence for SD Tax Law Determination In Sales and Distribution there are several places to define Tax Laws for ICMS and IPI which can be automatically determined in a transaction (e.g. a sales order). They can be either derived from the Item Category, the Tax Rate Exception Tables or from t he Customer Master Record.
Condition-based tax calculation in R/3 for Brazil28
CBT SD
SAP Online Help
10/5/2012
Figure 10. The migration and check tool that controls the initial conversion and the consistency of entries in Brazilian tax tables to condition records.
By means of the table J_1BTXLAWSEQ, a sequence can be defined by which the various data sources are accessed. Enter sequential integer numbers and assign the data sources from the drop down menu to them. During the transaction, the system will look up the data sources in ascending order of the sequence number until the tax laws are found. Table 3-2. Example of a sequence for tax law determination. Sequence in Tax Law Determination
Source for Tax Law Determination
3 4 5
Tax Exception Tables Item Category Table Customer Master
An example is shown in Table 3-2. In this example the system would first look up the tax exception tables, then the item category tables if no tax laws were found and finally the customer master.
Condition-based tax calculation in R/3 for Brazil29
SAP Online Help
10/5/2012
4 Detailed Design 4.1 New DDIC Elements 4.1.1 Tables J_1BCONDMAP, J_1BCONDMAPT The table J_1BCONDMAP contains all internal codes f or condition records that are being generated automatically during the maintenance of the Brazilian tax tables or during the initial conversion with the program J_1B_MIGRATE_TAX_RATES. The table J_1BCONDMAPT is the corresponding text table. Both tables are maintained with the view J_1BCONDMAPV. J_1BTXCOND In this table, the internal codes defined in J_1BCONDMAP are assigned to condition types (defined in table T685). A combination (internal code, application) is mapped against a condition type. J_1BVIEWMAP In this table, the Brazilian tax tables are mapped against condition tables. Each pair (table, tax group) is assigned a condition table (named A*, e.g. ‘A346’). Specifying the tax group only makes sense in the case of tables containing dynamic exceptions. For the other tables, this field is initial. J_1BNFTXCOND This table serves to define the transfer of information from the KOMV-like table that is generated during the calculation procedure processing to the Nota Fiscal. Grouping key fields are the usage KVEWE of the condition table (‘TX’ or ‘V’), the application KAPPL (‘A’ – Pricing), and the calculation procedure KALSM (in the case of KVEWE=’TX’ the tax calculation procedure assigned to the country, i.e. TAXBRC in the standard Brazil case; in the case of KVEWE=’V’ the respective calculation procedure assigned to order types in pricing). The key field TAXTYP is defined in table J_1BAJ. In the case of KAPPL=’TX’ it has to be a condition type that is used in the tax calculation procedure and activated or deactivated by customizing the tax code. The further fields of the table have to be regarded as pairs, i.e. RATE and RATE_MAP belong together, VALUE and VALUE_MAP, etc. The first field of the pair contains a condition type that has to be present in the calculation procedure. The second field specifi es which number in the KOMVlike line of the table of the calculation procedure is transferred: KWERT, KBETR, or KAWRT. This number is going to be transferred in the respective field of the Nota Fiscal. The table is being maintained with the view J_1BNFTXCONDMMV for the materials-management applications (KAPPL=’TX’). J_1BNFLWCOND This table defines the transfer of the tax law texts to the Nota Fiscal from the KOMV-like table that is generated during the calculation procedure processing. The grouping key fields are the same as for the table J_1BNFTXCOND. A condition type KSCHL is assigned to a tax group TAXGRP. The condition type has to be present in the calculation procedure. The respective line of the KOMV-like table has to have the field KNUMA_BO filled with the respective text (e.g. IPI or ICMS law). The table is being maintained with the view J_1BNFLWCONDMMV for the materials-management applications (KAPPL=’TX’).
Condition-based tax calculation in R/3 for Brazil30
SAP Online Help
10/5/2012
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 KAPPL KSCHL ALAND TAXBS DOCTYP DATBI DATAB KNUMH
MANDT KAPPL KSCHA ALAND TAXBS J_1BDOCTYP KODATBI KODATAB KNUMH
Client Application Condition type Departure country (country from which the goods are sent) Tax Base in Percentage Document type Validity end date of the condition record Validity start date of the condition record Condition record number
A346 Condition table: BR: IPI rate determination Component
Comp. Type
Short Text
MANDT KAPPL KSCHL ALAND MATNR STEUC MATKL MWSKZ LIFNR KUNNR BRSCH CITYC DATBI DATAB KNUMH
MANDT KAPPL KSCHA ALAND MATNR STEUC MATKL MWSKZ ELIFN KUNNR_V BRSCH CITYC KODATBI KODATAB KNUMH
Client Application Condition type Departure country (country from which the goods are sent) Material Number Control code for consumption taxes in foreign trade Material Group Tax on sales/purchases code Vendor's account number Customer number Industry key City Code Validity end date of the condition record Validity start date of the condition record Condition record number
A347 Condition table. BR: ICMS rate determination Component
Comp. Type
Short Text
MANDT KAPPL KSCHL ALAND TXREG_SF TXREG_ST MATNR STEUC MATKL MWSKZ
MANDT KAPPL KSCHA ALAND J_1BTXSHPF J_1BTXSHPT MATNR STEUC MATKL MWSKZ
Client Application Condition type Departure country (country from which the goods are sent) Ship from location (tax region) Ship to location (tax region) Material Number Control code for consumption taxes in foreign trade Material Group Tax on sales/purchases code
Condition-based tax calculation in R/3 for Brazil31
SAP Online Help
10/5/2012
Component
Comp. Type
Short Text
LIFNR KUNNR BRSCH CITYC DATBI DATAB KNUMH
ELIFN KUNNR_V BRSCH CITYC KODATBI KODATAB KNUMH
Vendor's account number Customer number Industry key City Code Validity end date of the condition record Validity start date of the condition record Condition record number
A348 Condition table. BR: SubTrib rate determination Component
Comp. Type
Short Text
MANDT KAPPL KSCHL ALAND TXREG_SF TXREG_ST XSUBT MATNR STEUC MATKL MWSKZ LIFNR KUNNR BRSCH CITYC DATBI DATAB KNUMH
MANDT KAPPL KSCHA ALAND J_1BTXSHPF J_1BTXSHPT J_1BTCST MATNR STEUC MATKL MWSKZ ELIFN KUNNR_V BRSCH CITYC KODATBI KODATAB KNUMH
Client Application Condition type Departure country (country from which the goods are sent) Ship from location (tax region) Ship to location (tax region) Customer group for Substituiçao Tributária calculation Material Number Control code for consumption taxes in foreign trade Material Group Tax on sales/purchases code Vendor's account number Customer number Industry key City Code Validity end date of the condition record Validity start date of the condition record Condition record number
A349 Condition table. BR: ICMS Complementar rate determination Component
Comp. Type
Short Text
MANDT KAPPL KSCHL ALAND TXREG_ST MATNR DATBI DATAB KNUMH
MANDT KAPPL KSCHA ALAND J_1BTXSHPT MATNR KODATBI KODATAB KNUMH
Client Application Condition type Departure country (country from which the goods are sent) Ship to location (tax region) Material Number Validity end date of the condition record Validity start date of the condition record Condition record number
A382 Condition table. BR: ICMS rate Component
Comp. Type
Short Text
MANDT KAPPL KSCHL ALAND DOCTYP TXREG_SF TXREG_ST
MANDT KAPPL KSCHA ALAND J_1BDOCTYP J_1BTXSHPF J_1BTXSHPT
Mandant Applikation Konditionsart Lieferndes Land (Land aus dem die Ware versandt wird) Belegart Sender (Steuerregion) Empfänger (Steuerregion)
Condition-based tax calculation in R/3 for Brazil32
SAP Online Help
10/5/2012
Component
Comp. Type
Short Text
MATNR STEUC MATKL MWSKZ LIFNR KUNNR BRSCH CITYC DATBI DATAB KNUMH
MATNR STEUC MATKL MWSKZ ELIFN KUNNR_V BRSCH CITYC KODATBI KODATAB KNUMH
Materialnummer Steuerungscode für Verbrauchssteuern im Außenhandel Warengruppe Umsatzsteuerkennzeichen Kontonummer des Lieferanten Kundennummer Branchenschlüssel City Code Gültigkeitsende des Konditionssatzes Gültigkeitsbeginn des Konditionssatzes Nummer Konditionssatz
A392 Condition table. Country Component
Comp. Type
Short Text
MANDT KAPPL KSCHL ALAND DATBI DATAB KNUMH
MANDT KAPPL KSCHA ALAND KODATBI KODATAB KNUMH
Mandant Applikation Konditionsart Lieferndes Land (Land aus dem die Ware versandt wird) Gültigkeitsende des Konditionssatzes Gültigkeitsbeginn des Konditionssatzes Nummer Konditionssatz
4.1.2 Views J_1BCONDMAPV This is the maintenance view of the table J_1BCONDMAP and its text table J_1BCONDMAPT. See the description of the tables for details. J_1BNFTXCONDMMV This is the maintenance view of the table J_1BNFTXCOND for usage ‘TX’ and application ‘A’. See the description of the tables for details. J_1BNFLWCONDMMV This is the maintenance view of the table J_1BNFLWCOND for usage ‘TX’ and application ‘A’. See the description of the tables for details. J_1BTAXCODEV This is the maintenance view of the tax codes. It allows the simultaneous maintenance of tables T007A and J_1BT007. See section 3.13 for further details. J_1BTXIP3V, J_1BTXIC3V, J_1BTXIS3V, J_1BTXST3V New maintenance views for the dynamic tax exceptions. Since release 4.7, dynamic exceptions may have up to 3 dynamic key fields. The screens have been modified to provide the user with an easy-to-understand user interface. The headers of the table control are modified dynamically, based on the key fields of the respective tax group that are defined in J_1BTXGRUOP. The events 01 and 02 of the extended table maintenance (transaction SE54) trigger the automatic generation of condition records when the data are saved. See section 4.8 for details. J_1BCONDCALC Help view used in the search help H_J_1B_T683S to display conditions used in a calculation procedure.
Condition-based tax calculation in R/3 for Brazil33
SAP Online Help
10/5/2012
4.1.3 Search Helps H_J_1B_T683S This search help is used in the tables J_1BNFTXCOND and J_1BNFLWCOND for the fields containing condition types. Only those conditions are displayed in the search help list that are used in the selected calculation procedure.
4.1.4 Data Elements J_1BCONDREF Reference type for the DDIC class CL_TAX_CONDITION. See section 4.4 for details about this class. J_1BCONDREF_TAB Table type. Represents a standard table with lines of type J_1BCONDREF. Used in the automatic generation of condition records during the view maintenance (see section 4.8). J_1BKOMVMAP Mapping of fields of the KOMV-like table of a calculation procedure to the Nota Fiscal. This data element has as elementary type the domain J_1BKOMVMAP (see section 4.1.5). It is used in the table J_1BNFTXCOND (see section 4.1.1). J_1BTXCODE Internal code of tax conditions; with elementary data type: domain J_1BTXCODE. Used in tables J_1BCONDMAP, J_1BCONDMAPT, and J_1BTXCOND. See section 4.1.1 for details. J_1BINMWSKZ Tax code used in goods receipts. Elementary data type: domain MWSKZ. Used in table J_1BT007. J_1BOUTMWSKZ Tax code used in goods issues. Elementary data type: domain MWSKZ. Used in table J_1BT007. J_1BSDMWSKZ SD tax code used in the deliveries for a stock transport order. Elementary data type: domain J_1BTXSDC. Used in table J_1BT007. J_1B_TAXCOM Structure with all Brazil-specific communication fields that have to be transferred between materials management applications (purchase order, goods movements, invoice verification) to the function group J1BCONDTAX in which the condition-based tax calculation is prepared Component
Comp. Type
Short Text
STEUC TXREG_SF TXREG_ST XXIPI XICMS XSUBT TAXBS IPISP DOCTYP MTORG
STEUC J_1BTXSHPF J_1BTXSHPT J_1BTCIPI J_1BTCICMS J_1BTCST TAXBS J_1BINDEQU J_1BDOCTYP J_1BMATORG
Control code for consumption taxes in foreign trade Ship from location (tax region) Ship to location (tax region) Customer is IPI-exempt Customer is ICMS-exempt Customer group for Substituiçao Tributária calculation Tax Base in Percentage Tax Split Document type Origin of the material
Condition-based tax calculation in R/3 for Brazil34
SAP Online Help
10/5/2012
Component
Comp. Type
Short Text
MTUSE OWNPR MATKL BRSCH CITYC LIFNR MGAME VRKME
J_1BMATUSE J_1BOWNPRO MATKL BRSCH CITYC LIFNR MENGE_D VRKME
Usage of the material Produced in-house Material Group Industry key City Code Account Number of Vendor or Creditor Quantity Sales unit
KOMKBRAZIL Include structure for Brazil-specific fields in the pricing communication structure KOMK. Component
Comp. Type
Short Text
XSUBT TAXBS IPISP DOCTYP
J_1BTCST TAXBS J_1BINDEQU J_1BDOCTYP
Customer group for Substituiçao Tributária calculation Tax Base in Percentage Tax Split Document type
KOMPBRAZIL Include structure for Brazil-specific fields in the pricing communication structure KOMP. Component
Comp. Type
Short Text
TXREG_SF TXREG_ST MTUSE OWNPR MTORG
J_1BTXSHPF J_1BTXSHPT J_1BMATUSE J_1BOWNPRO J_1BMATORG
Ship from location (tax region) Ship to location (tax region) Usage of the material Produced in-house Origin of the material
4.1.5 Domains J_1BKOMVMAP Mapping of fields of the KOMV-like table of a calculation procedure to the Nota Fiscal. Data type: NUMC 1. The domain has 3 fixed values: Value
Short text
0 1 2
Condition value Condition rate/amount 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).
4.2 Changes of Existing DDIC Elements 4.2.1 Tables J_1BTXIP3, J_1BTXIC3, J_1BTXIS3, J_1BTXST3 Since release 4.7, the dynamic exceptions may have up to 3 key fields. The primary keys of these tax rate tables were extended correspondingly. The three dynamic key fields are VALUE, VALUE2, and VALUE3.
Condition-based tax calculation in R/3 for Brazil35
SAP Online Help
10/5/2012
J_1BTXGRUOP The tax groups of dynamic exceptions can have 3 key fields. The primary key of this table was extended correspondingly. The three key fields (of type J_1BTXFIELDS) are FIELD, FIELD2, and FIELD3.
4.2.2 Views J_1BTXIC1, J_1BTXIC2, J_1BTXIP1, J_1BTXIP2, J_1BTXCI1, J_1BTXIS1, J_1BTXST1, J_1BTXST2, J_1BTXMMCV The events 01 and 02 of the extended table maintenance (transaction SE54) now trigger the automatic generation of condition records. See section 4.8 for details about the coding.
4.2.3 Data Elements KOMG This structure was extended to contain the Brazil-specific fields that are necessary to select condition records during the tax calculation procedure. Since KOMG contains all fields of KOMP and KOMK, see those elements for a description of the new fields. KOMP The Brazil-specific fields that are necessary to select condition records during the tax calculation procedure are contained in the new include KOMPBRAZIL. See section 4.1.4 for details. Furthermore, the field STEUC, used to store the NCM code, was included in the structure J_1INKOMP that is new in KOMP as well. KOMK The Brazil-specific fields that are necessary to select condition records during the tax calculation procedure are contained in the new include KOMKBRAZIL. See section 4.1.4 for details.
4.2.4 Domains J_1BTXFIELDS The field KONZS was removed from this domain, which contains the allowed key fields for dynamic tax exceptions.
4.3 New Formulas The following new formulas were created with transaction VOFM. They are used in the new tax calculation procedure TAXBRC that is discussed in detail in section 5.3. In the description of the essential mathematical formula that is behind the coding, the following symbols are going to be used: Symbol
Variable in source code
Description
a w r D E
XKAWRT XKWERT XKOMV-KBETR XWORKD XWORKE
Condition base value Condition value (result of calculation) Condition rate Work field D Work field E
The work fields have to be reset at the end of each formula because in the pricing logic the values specified in the calculation procedure are added to the work fields instead of overwriting the previous values.
Condition-based tax calculation in R/3 for Brazil36
SAP Online Help
10/5/2012
4.3.1 Condition Value Formulas 4.3.1.1 Formula 177 Include: RV64A177 This formula is used to get the discount value that was previously stored in function group J1BCONDTAX. Source code FORM FRM_KONDI_WERT_177. CALL FUNCTION 'J_1B_GET_DISCOUNT' exporting i_index = komp-taxps IMPORTING E_KWERT = xkwert. ENDFORM.
4.3.1.2 Formula 163 Include: FV64A163 This formula calculates a certain power of ten based on the condition base value. It is used to achieve a higher precision in calculations to avoid rounding errors. Mathematical formula: w = 10 n 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. xkwert = h1 . ENDFORM.
4.3.1.3 Formula 175 Include: RV64A175 This formula calculates the discount rate, a helping value that is used in the calculation of ICMS consumption. It is scaled analog to formula 163 to a certain power of ten based on the condition base value to avoid rounding errors. XWORKD contains the discount value, XKAWRT the net base value.
Condition-based tax calculation in R/3 for Brazil37
SAP Online Help
10/5/2012
Mathematical formula: w = 10
n
D D + a
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
4.3.1.4 Formula 164 Include: FV64A164 This formula calculates the value inclusive ICMS. XKAWRT contains the net base value, XWORKE the ICMS rate scaled with 10n, already reduced by the base rate (i.e. 10 n*rate*base), and XWORKD contains 10n. Mathematical formula: w =
a 1 − E D
Source code FORM FRM_KONDI_WERT_164.
Condition-based tax calculation in R/3 for Brazil38
SAP Online Help
10/5/2012
data: baseval type f, zehn_n type f, redrate type f, result type f, chzero type f. baseval = xkawrt. zehn_n = xworkd. redrate = xworke. chzero = redrate / zehn_n. if chzero = 1. exit. endif. result = baseval / ( 1 - chzero ). xkwert = result. * Reset work fields clear: xworkd, xworke. ENDFORM.
4.3.1.5 Formula 162 Include: FV64A162 This formula calculates the difference between XWORKD and XKAWRT. If the result is lower than zero, it is set to zero. Mathematical formula: w = max ( 0; D − a ) Source code FORM FRM_KONDI_WERT_162. * Base value: XWAWRT * Value + tax: XWORKD xkwert = xworkd - xkawrt. if xkwert < 0. clear xkwert. endif. * Reset work field clear xworkd. ENDFORM.
4.3.1.6 Formula 171 Include: FV64A171 This formula returns XWORKD in case it is greater than zero. If not, XKAWRT is returned. Mathematical formula: w =
D a
if D
>0
else
Source code FORM FRM_KONDI_WERT_171. if xworkd > 0. xkwert = xworkd. else. xkwert = xkawrt.
Condition-based tax calculation in R/3 for Brazil39
SAP Online Help
10/5/2012
endif. clear xworkd. ENDFORM.
4.3.1.7 Formula 165 Include: FV64A165 This formula is used in the calculation of ICMS consumption. XKAWRT, XWORKD, and XWORKE are used.
Mathematical formula: w = E 1 −
D a
Source code FORM FRM_KONDI_WERT_165. data: a type f, d type f, e type f, result type f. a = xkawrt. d = xworkd. e = xworke. result = ( 1 - a / d ) * e. xkwert = result. clear: xworkd, xworke. ENDFORM.
4.3.1.8 Formula 167 Include: FV64A167 This formula is used to take the value in XWORKA if the material usage, stored in KOMPMATUSE, is consumption. In case of industrialization, resale, or assets, the value in XWORKD is taken.
Mathematical formula:
a w = D 0
if KOMP − MATUSE if KOMP − MATUSE else
Source code FORM FRM_KONDI_WERT_167. case komp-mtuse. *--- resale, industralization, assets when 0 or 1 or 3. xkwert = xworkd. *--- consumption when 2. xkwert = xkawrt. when others. xkwert = 0. endcase.
Condition-based tax calculation in R/3 for Brazil40
=2 = 0,1, or 3
SAP Online Help
10/5/2012
clear xworkd. ENDFORM.
4.3.1.9 Formula 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: w = a (1 − r ) 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: w =
a 0
if r = 3 else
Source code FORM FRM_KONDI_WERT_172. data: f type f. f = xkomv-kbetr. if f = 3000. xkwert = xkawrt. else. xkwert = 0. endif. ENDFORM.
4.3.1.11 Formula 170 Include: FV64A170
Condition-based tax calculation in R/3 for Brazil41
SAP Online Help
10/5/2012
This formula returns the greater value of XKAWRT and XWORKD. Mathematical formula: w = max ( a; D ) 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: w =
a 0
: f ≠ 0 : f = 0
Source code FORM FRM_KONDI_WERT_173. data: f type f. f = xkomv-kbetr. if f = 0. xkwert = 0. else. xkwert = xkawrt. endif. ENDFORM.
4.3.1.13 Formula 176 Include: RV64A176 This formula is used in the calculation of ICMS complementar. XKOMV-KBETR contains an exempt-flag. If XKOMV-KBETR is not zero, the formula returns zero. Otherwise, the product of XWORKD and XKAWRT is returned, where XWORKD contains a t ax rate. Mathematical formula: w =
0 a ⋅ D
: f ≠ 0 : f = 0
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.
Condition-based tax calculation in R/3 for Brazil42