Tax calculation in SAP's Brazil localization: where the rule lives in each model
Calculating tax in Brazil takes knowledge of legislation that keeps changing. SAP can do it with the Brazil localization, with an external calculation engine or with a mix of the two. The choice affects cost, risk and how the rule is kept alive.
The calculation paths, what SAP publishes about each one and what changes for those on RISE with SAP or GROW with SAP.
SAP can calculate tax with the Brazil localization, with an external calculation engine or with both, and the choice affects cost, risk and how the rule is maintained. DFSpro compares the models by tax criteria, reviews rules, data and calculation results and builds test scenarios with an expected value.
The question is not which tool, it is where the rule lives
Every invoice issued carries amounts of ICMS (Brazil's state value-added tax), IPI, PIS, COFINS and, from the reform onward, CBS and IBS. Someone has to determine each one: which rate, which base, which benefit, which tax situation. What defines the risk is where that determination sits, who maintains it and how the result is proved.
Inside the ERP, the rule lives in schemas and conditions that the team configures and reviews. In an external engine, it lives in a service the company contracts and integrates. In both cases, master data, product classification and checking of the result remain the company's job.
Choose the entry point by your role
01Tax and fiscal
Base and rate of each tax, with the rule.
Go to the section02IT and architecture
Where SAP determines the tax.
Go to the section03Accounting
Withholding taxes in accounts payable.
Go to the section04Audit
How to prove the calculated amount.
Go to the sectionDirect links
Three ways to calculate tax in SAP
The table summarizes what is published and turns each path into a decision for the tax team.
| Path | What SAP publishes | What it means in practice | Focus of the tax layer |
|---|---|---|---|
| Brazil localization in the ERP | Calculation schemas such as TAXBRA, with conditions maintained in J1BTAX, used in sales and purchasing. | The rule is configured and maintained by the team. It needs people who know the scenarios and follow the legislation. | Review rules, exceptions and the owner of each adjustment. |
| External calculation engine | Third-party service called by SAP during the calculation. In the Public Edition, through the TXSC price condition and integration via SAP Integration Suite (scope item 43D). | The rule lives in the contracted service. It needs integration, monitoring and checking of the result. | Validate coverage, traceability and response time to changes. |
| A mix of the two | Part of the operations in the ERP standard and part in an external engine, by type of operation or entity. | It requires clarity on which rule applies to each operation, so as not to duplicate or leave gaps. | Map the boundary between the two and test the points of contact. |
Sources: SAP's what's-new documentation for functional localizations and an SAP product expert's blog on the external calculation engine.
From the invoice item to the tax amount: what SAP documents
When a tax amount comes out different from expected, the cause is almost always in one of three places. SAP's documentation points to which.
This investigation order is our recommendation, not a step published by SAP: from the procedure to the condition record and from there to the invoice field. The page consulted is from the SAP Library, Brazil section, and its address points to old documentation (AFS 6.4, an industry product line), not S/4HANA documentation. Check the documentation for the version of your environment before applying it, because table names, transactions and behavior change between ECC and S/4HANA.
Source: SAP Library, Brazil, "Calculation Procedure", read on 16/10/2026. The review of the rules themselves is covered in Tax setup in SAP.
Each tax has its own base and its own calculation rule
Before discussing where the rule lives, it helps to know what the law says to calculate. The table lists only what the laws say, with the article.
| Tax | What the law says | What the calculation must respect |
|---|---|---|
| ICMS | The base is the value of the operation (LC 87/1996, art. 13, I). The amount of the tax itself is part of the base (art. 13, par. 1, I). Non-cumulative, with credit for inputs (arts. 19 and 20). LC stands for Complementary Law. | Calculation on the inside: the base already contains the tax. Rate and benefit depend on the state and the operation, a topic covered in ICMS-ST and DIFAL in SAP. |
| IPI | The taxable value of a domestic product is the total value of the outbound operation of the industrial establishment or equivalent (Decree 7.212/2010, RIPI, art. 190, II). | The tax line follows the product classification in the TIPI (the IPI rate table). The classification is covered in NCM and tax classification in SAP. |
| PIS and COFINS | Non-cumulative regime: 1.65% (Law 10.637/2002, art. 2) and 7.6% (Law 10.833/2003, art. 2). Cumulative regime: base on revenue (Law 9.718/1998, arts. 2 and 3), with COFINS at 3% (art. 8). Cumulative PIS is not detailed here. | The company's regime and product exceptions change the rate. The laws carry the cross-reference "See Complementary Law 214/2025". See EFD-Contribuições. |
| ISS | The price of the service is taxed (LC 116/2003, art. 7). Maximum rate of 5% (art. 8) and minimum of 2% (art. 8-A, LC 157/2016). Due, as a rule, in the municipality of the provider (art. 3). | The rule is municipal and changes from one city to another. See NFS-e by municipality and ISS assessment. |
| IBS and CBS | The base is the value of the operation (LC 214/2025, art. 12). IBS itself, CBS and IPI are not part of the base (art. 12, par. 2, I and II). | Calculation on the outside, unlike ICMS. The transition dates are in Tax reform CBS and IBS in SAP. |
Official sources read on the Planalto site (the Presidency's legislation portal), on 15 and 16/10/2026. The table does not replace the legislation in force on the date of each operation, nor the interpretation of the company's tax team.
Withholding tax: the tax calculated by whoever pays
When services are bought, part of the tax is not calculated by the seller but withheld by whoever pays. The calculation then lives in accounts payable.
Federal withholdings
Law 10.833/2003, art. 30, subjects to withholding at source of CSLL, COFINS and PIS/Pasep the payments between private-law legal entities for services such as cleaning, upkeep, maintenance, security, surveillance, labor leasing and professional services. Companies under the Simples Nacional (Brazil's simplified tax regime) are not required to withhold (par. 2), and the withholding does not exclude income tax withholding (par. 3). Law 8.212/1991, art. 31, requires the contractor of services with labor assignment to withhold eleven percent of the gross value of the invoice or bill.
ISS withholding
LC 116/2003, art. 6, allows municipalities and the Federal District to assign by law the responsibility for the tax credit to a third party linked to the taxable event. The responsible party pays the full tax, whether or not it made the withholding (par. 1). Who decides whether the buyer withholds is the municipal law, not SAP.
What this asks of the calculation, in our reading: the vendor master record must say whether it is under the Simples Nacional and in which municipality it provides the service, and the service type of the invoice must reach the withholding calculation. Without these two data points, the withholding comes out too high, too low or not at all. The assessment and payment of what was withheld are covered in ISS assessment in SAP and EFD-Reinf in SAP.
Official sources read on the Planalto site, on 15 and 16/10/2026: Law 10,833, Law 8,212 and LC 116. Which services and percentages apply in each case is a reading of the legislation in force by the company's tax team.
Two calculation methods on the same invoice during the transition
ICMS is calculated on the inside and IBS and CBS on the outside. While the two coexist, the calculation must handle different bases on the same item.
| Point | ICMS | IBS and CBS |
|---|---|---|
| Law | LC 87/1996, art. 13 | LC 214/2025, art. 12 |
| Base | The value of the operation (art. 13, I). | The value of the operation (art. 12, caput). |
| The tax itself | Part of the base, and the amount shown on the invoice is a mere indication for control purposes (art. 13, par. 1, I). Calculation on the inside. | Not part of the base (art. 12, par. 2, I). Calculation on the outside. |
| Other taxes | No equivalent rule in this article. | IPI outside the base (par. 2, II). From 01/01/2026 to 31/12/2032, ICMS, ISS, COFINS and PIS/Pasep are also outside the base (par. 2, V). |
In practice, one item can have one base for ICMS, another for PIS and COFINS and a third for IBS and CBS. If the calculation schema or the external engine reuses the base of one tax in another, the error shows up only in the check. The 2026 test phase, the percentages and the milestones are in Tax reform CBS and IBS in SAP, and the tax situation codes in CST and cClassTrib of the reform. To learn what each invoice must contain, see electronic tax documents in SAP.
Official sources read on the Planalto site: LC 87/1996 and LC 214/2025, on 15/10/2026.
What SAP documents in the Brazil localization
SAP publishes, by version, what the localization started to do.
Invoice and fields
The what's-new documentation lists fields added to the invoice, such as tax benefit and presumed credit, and invoice types tied to specific scenarios. How the benefit is born in the calculation and proved later is covered in state tax benefits and incentives in SAP.
Calculation schemas
There are items on adding taxes to the pricing procedures TAXBRA, TAXBRJ, RVABRA and RVXBRA.
CBS and IBS
There are items on tax situation, statistical values on the invoice, fields and changes of base for CBS and IBS in the calculation procedures.
Ancillary obligations
There are items on EFD-Reinf technical notes, with layout updates.
Electronic documents
There are items on the handling of inbound messages and external document identification.
Controlled extension
There is an extension (BAdI) to determine the tax situation of CBS and IBS.
Source: SAP Help Portal, What's New for Functional Localizations in SAP S/4HANA and SAP S/4HANA Cloud Private Edition, Brazil section. The list changes with each version.
RISE and GROW with SAP: what changes for tax
Two offers, two points of attention. Both depend on confirming, in the contracted scope, what the localization covers.
RISE with SAP
According to SAP, it is the offer to modernize the ERP in an own installation and move it to the cloud, with methodology, guidance and migration assistants. SAP itself cites governed extensibility with Clean Core compatible development and rollout assistants with model comparison and automated localization.
For tax: the project is a migration. Rules, extensions and tax data must be inventoried before going to the cloud. See Migration to S/4HANA and Clean Core for tax.
GROW with SAP
According to SAP, it is the cloud ERP for companies of various sizes, with pre-configured flows and practices and a standardized implementation with partners in the GROW Fast format, to avoid custom development.
For tax: the standard weighs more. What the Brazilian operation requires and the standard does not cover needs a solution planned in the scope, for example the external calculation engine.
Five questions to decide the path
The answers guide the choice of model, whether native, external or combined.
- Which operations, states and document types must the calculation cover today and in the next two years?
- Who maintains the rule when the legislation changes, and how long does it take to reach SAP?
- How do you prove to the auditor why a rate was applied on a specific invoice?
- What happens to the calculation when the external engine or the integration is unavailable?
- Does the tax master data (NCM, NBS, classification) feed the calculation with enough quality?
The master data items are in Tax master data in SAP. Integration with external services is in Tax integration in SAP. NCM, from the table to the invoice, is in NCM and tax classification in SAP.
How to prove that the calculated amount is the amount due
A document authorized by SEFAZ (the state tax authority) proves that the invoice was accepted, not that the tax is right. The proof of the calculation is a different thing, and it is what the auditor asks for.
This is the criterion we apply, not a legal requirement. When the law changes, the cycle repeats: the company decides how to interpret it, the rule is changed in the schema or in the service, the affected scenarios are redone and only then does the new rule go into use. According to the documentation consulted, TAXBRA allows the logic to be adapted to new legal requirements; in the external engine, the speed of change depends on the contract. See tax tests in SAP and SAP Notes for the tax reform.
How far the tax layer goes: what it does and what it does not do
What it does
- Compares the models by tax criteria: coverage, traceability and maintenance.
- Reviews rules, data and calculation results.
- Builds test scenarios with an expected value per rule.
- Records the decision and the owner of each rule.
What it does not do
- Choose the SAP edition or offer on the company's behalf.
- Design or program the integration with the engine.
- Guarantee compliance: the tax interpretation belongs to the customer.
Official sources
- SAP Help Portal: What's New for Functional Localizations (Brazil)
- SAP Community: How to configure and use external Tax Engine calculation in S/4HANA Cloud (blog by an SAP product expert)
- SAP: RISE with SAP
- SAP: SAP GROW
- Planalto: Complementary Law 87/1996 (Lei Kandir), arts. 13, 19 and 20, read on 15/10/2026
- Planalto: Complementary Law 116/2003 (ISS), arts. 3, 6, 7, 8 and 8-A, read on 15/10/2026
- Planalto: Complementary Law 214/2025 (IBS and CBS), art. 12, read on 15/10/2026
- Planalto: Decree 7.212/2010 (RIPI), art. 190, read on 16/10/2026
- Planalto: Law 10.637/2002 (non-cumulative PIS), art. 2, read on 16/10/2026
- Planalto: Law 10.833/2003 (non-cumulative COFINS), arts. 2 and 30, read on 16/10/2026
- Planalto: Law 9.718/1998 (cumulative regime), arts. 2, 3 and 8, read on 16/10/2026
- Planalto: Law 8.212/1991, art. 31, read on 16/10/2026
- SAP Library: Brazil, Calculation Procedure (TAXBRA and TAXBRJ), old AFS 6.4 documentation, read on 16/10/2026
SAP changes offers and documentation; confirm at the source and in your contract before deciding.
Blog articles about tax calculation in SAP
Questions for your project
01What is the Brazil localization in SAP?+
It is the set of functions that adapts SAP to Brazilian tax requirements: invoicing, tax calculation, bookkeeping and obligations. SAP publishes the evolution of these functions by version, in its own what's-new document for functional localizations.
02How does SAP calculate taxes in Brazil in ECC and in S/4HANA on own installation?+
Through calculation schemas, such as TAXBRA, with conditions maintained in J1BTAX. According to an SAP product expert, this solution has been used for many years for sales and purchasing. The detail of the review is in Tax setup in SAP.
03What is an external tax calculation engine?+
It is a third-party service, specialized in tax legislation, that SAP calls to determine the taxes of each document, instead of depending only on tax codes configured in the ERP.
04Does S/4HANA Cloud Public Edition calculate Brazilian tax on its own?+
According to an SAP product expert's blog, in this edition SAP decided to leave the calculation to specialized partner companies, through a price condition called TXSC and integration via SAP Integration Suite. Checking in your scenario depends on the version and the contracted scope.
05What is scope item 43D?+
According to the same blog, it is the scope item for integration with an external calculation engine, used for Brazil and Canada. It should be part of the scope assessment in the discovery phase.
06Does RISE with SAP change the Brazilian tax rule?+
No. The tax rule is the one in the law. RISE with SAP, according to SAP, is an offer to migrate the ERP from own installation to the cloud. The effect is in how the rule is implemented and maintained: extension model, localization scope and the responsibility of each party.
07Does GROW with SAP have a localization for Brazil?+
SAP states that GROW brings pre-configured flows and practices, with regulatory logic validated in more than 190 countries. For Brazil, what is inside the standard and what depends on a partner must be confirmed in the scope of your contract.
08What is the relation to the tax reform?+
SAP's localization documentation already brings fields and tax situations for CBS and IBS, with adjustments in schemas such as TAXBRA and TAXBRJ. The calendar and the rules are in Tax reform CBS and IBS in SAP.
09Does changing the calculation engine eliminate tax setup?+
No. It changes where the rule lives. Master data, classification of the product and of the operations and checking of the result remain the company's responsibility.
10Who decides between native calculation and an external engine?+
The decision is one of architecture, for the integrator and the company, with SAP. The tax layer contributes criteria: coverage of the rules, traceability of the calculation, response time to a change in legislation and cost to maintain.
11Does DFSpro implement the calculation engine?+
In the tax layer of the project, DFSpro joins as support, without taking the integrator's place. On the license of GUEPARDO Tax, which belongs to NTT DATA: DFSpro sells it as an Authorized Channel. The choice of calculation solution starts from your scenario.
12How do you test the calculation before go-live?+
With real operation scenarios by state, product and type of operation, comparing the calculated value with the one expected from the tax rule, and not just checking that the document was generated without error.
13What is the difference between calculating tax on the inside and on the outside?+
In calculation on the inside, the tax is part of its own base: this is the case of ICMS (LC 87/1996, art. 13, par. 1, I). In calculation on the outside, the tax is not part of the base: this applies to IBS and CBS (LC 214/2025, art. 12, par. 2, I). The difference changes the arithmetic of the calculation schema or the external engine.
14Who calculates the withholding of PIS, COFINS and CSLL on services?+
Whoever pays. Law 10.833/2003, art. 30, subjects to withholding at source the payments between private-law legal entities for services such as cleaning, surveillance, labor leasing and professional services, except for companies under the Simples Nacional. The list and the percentages must be read in the law in force by the tax team.
15What does SAP say about the TAXBRA and TAXBRJ procedures?+
In the documentation consulted, from the SAP Library (Brazil section, old version AFS 6.4), SAP recommends TAXBRA, which uses the condition technique and allows the logic to be adapted to new legal requirements. TAXBRJ calculates taxes externally, through the function module J_1BCALCULATE_TAXES. Because it is from an old version, check the documentation for the version of your environment.
16Does the IBS and CBS base include ICMS during the transition?+
No. LC 214/2025, art. 12, par. 2, V, excludes from the IBS and CBS base the ICMS, ISS, COFINS and PIS/Pasep applying to the operation, from 01/01/2026 to 31/12/2032. IPI is also not part of the base (item II).
17What are the minimum and maximum ISS rates?+
Under LC 116/2003, the maximum rate is 5% (art. 8, II) and LC 157/2016 added the minimum of 2% (art. 8-A), with exceptions set out in the article itself. Within these limits, the rate for each service is the one in the municipal law.
18What is the IPI calculation base?+
For a domestic product, it is the total value of the outbound operation of the industrial establishment or equivalent (Decree 7.212/2010, RIPI, art. 190, II). The rate comes from the product classification in the TIPI, which ties the calculation to the NCM master data.
Find out where the calculation rule stands today
The SAP Tax Diagnostic maps the calculation rules, the data that feeds them and the result in the real scenarios of the operation.