SAPBR Technologies home

SAP in Brazil, explained

Jurisdiction Codes / Tax Jurisdiction

A reader’s comment last week prompted this post.

The question was about the Jurisdiction Code (Tax Jurisdiction), and specifically the combination of postal code and jurisdiction code. Both are mandatory for every customer, vendor and branch that issues or receives a Nota Fiscal in Brazil, and the code is used to calculate Brazilian taxes.

The Jurisdiction Code sits in the partner’s address data. In Brazil, each code represents one city (municipality), and there are over 5,000 of them.

These are the steps to have the field assigned correctly and automatically in partner master records.

1. Maintain regions

Regions should be delivered as standard when country version BR is activated. If they are missing, maintain them here:

SAP Customizing Implementation Guide > SAP NetWeaver > General Settings > Set Countries > Insert Regions (table/view V_T005S)

There are 27 regions:

SAP screen: 1. Maintain regions

2. Define Brazilian tax regions

Here you create the tax regions for Brazil and assign a geographical region to each one. The system uses this to determine the tax region automatically when you maintain customers, vendors, plants and other master records. A geographical region can be assigned to more than one tax region, which is very useful for the Free Trade Zone.

SAP Customizing Implementation Guide > Financial Accounting (New) > Financial Accounting Global Settings (New) > Tax on Sales/Purchases > Basic Settings > Brazil > Define Brazilian Tax Regions and Assign to Geograph. Regions (table/view J_1BTREGV)

An example:

SAP screen: 2. Define Brazilian tax regions

3. Maintain the structure for the tax jurisdiction code

The Jurisdiction Code has two levels:

  • Level 1, 3 characters: the legal region.
  • Level 2, 7 characters: the code that identifies the municipality within that region.

The lengths must be 3 and 7 because SPED Fiscal reads 10 characters in this structure, for example SP 3550308 (São Paulo):

  • SP = region/state (note: SP followed by a space)
  • 35 = São Paulo state code according to IBGE
  • 50308 = São Paulo city (Município de São Paulo)

Maintain the structure here:

SAP Customizing Implementation Guide > Financial Accounting (New) > Financial Accounting Global Settings (New) > Tax on Sales/Purchases > Basic Settings > Specify Structure for Tax Jurisdiction Code (table/view V_TTXD)

Add this entry: Scheme TAXBRA, Length 1 3, Length 2 7, Length 3 empty, Length 4 empty, Taxes line by line X.

SAP screen: 3. Maintain the structure for the tax jurisdiction code

4. Activate external tax calculation

This activates access to the external tax system for the tax calculation procedure and links the procedure to the external events. You also choose what happens when the jurisdiction code doesn’t match the address data. Turn on the TC flag to have the system re-determine wrong codes automatically, or leave it off to get an error message instead.

SAP Customizing Implementation Guide > Financial Accounting (New) > Financial Accounting Global Settings (New) > Tax on Sales/Purchases > Basic Settings > External Tax Calculation > Activate External Tax Calculation (table/view V_TXD_E)

Create this entry: Scheme TAXBRA, External system C, all other fields empty.

SAP screen: 4. Activate external tax calculation

5. Define the logical destination

The logical destination is used for jurisdiction code determination and for classic tax calculation (TAXBRJ). If you use TAXBRA, you only need the entry for event JUR. The functions are called automatically by event. For example, when you create a vendor and fill in the region and postal code, J_1BTAXJUR_DETERMINE_NEW determines the right jurisdiction code.

SAP Customizing Implementation Guide > Financial Accounting (New) > Financial Accounting Global Settings (New) > Tax on Sales/Purchases > Basic Settings > External Tax Calculation > Define Logical Destination (table/view TTXC)

Create this entry for external system C:

  • Event: JUR
  • Function module: J_1BTAXJUR_DETERMINE_NEW
  • RFC destination: empty
SAP screen: 5. Define the logical destination

6. Define tax jurisdiction codes

The Brazilian tax jurisdiction code has two parts, the state code and the municipal code. It determines tax rates and which tax authorities are paid for a transaction. The municipal part is required to calculate ISS and for SPED reporting. For ICMS and SubTrib, the tax region is enough.

SAP Customizing Implementation Guide > Financial Accounting (New) > Financial Accounting Global Settings (New) > Tax on Sales/Purchases > Basic Settings > Brazil > Define Tax Jurisdiction Codes (table/view J_1BTXJURV)

There are more than 5,000 entries, one per municipality. If the business can’t give you a list, email me and I’ll send one. IBGE and Correios also publish the data, but the free versions take work to assemble record by record. They sell it as a single file too, though you don’t really need to pay for it.

Enter the codes as in this example:

SAP screen: 6. Define tax jurisdiction codes

7. Assign jurisdiction codes to postal code ranges

Each geographical region contains several tax jurisdictions, and each jurisdiction is defined by its postal codes. For every jurisdiction code, assign the geographical region and the first and last postal code of its range. From then on, when you enter a postal code and region in Brazilian address data (master records or transactions), the system assigns the right jurisdiction code automatically.

SAP Customizing Implementation Guide > Financial Accounting (New) > Financial Accounting Global Settings (New) > Tax on Sales/Purchases > Basic Settings > Brazil > Assign Postal Codes to Tax Jurisdiction Codes (table/view J_1BTREG_CITYV)

An example:

SAP screen: 7. Assign jurisdiction codes to postal code ranges

If the business can’t provide a reasonably current list, email me or leave a comment and I can send one you can mass upload.

The ranges do change, but not often. New streets or neighborhoods sometimes extend a city’s postal code range, and you simply update the existing entry. I wouldn’t track these changes actively. You’ll know when someone creates a record and the jurisdiction code isn’t assigned, which means the range is out of date. Ask the business to check the city’s correct range on the Correios website. (Correios is the government postal service, similar to USPS in the US.)

If you still want to buy the official data, it’s sold at shopping.correios.com.br as “Base de CEP”. Download a sample first to check the format and content meet your needs.

If anything is unclear, contact me. No more headaches on this one.

Frustrated child holding head

Comments

47 responses to “Jurisdiction Codes / Tax Jurisdiction”

  1. Sonia Maheshwari Avatar
    Sonia Maheshwari

    Hi Leandropia, Your article is quite useful. Thanks for sharing this information.
    I also need to update the Table T7BRCITY in SAP, Can you plz provide me the complete list of all the Muncipalities with their Jurs codes and postal code ranges so that I can use the same for my uploads?

    Looking for your support!
    Thanks,
    Sonia

    Like

  2. Daniel Curalov Avatar
    Daniel Curalov

    Oi Leandro Boa tarde

    Muito bom seu blog obrigado pelas dicas.
    Tem sido muito util a leitura dos topicos muito bem organizados.
    Vc poderia me fornecer o arquivo de relacionamento zipcodes x tax jurisdiction codes
    A versão que o cliente forneceu esta inconsistente.

    Grato Daniel

    Like

    1. leandropia Avatar

      Oi Daniel! Obrigado por vir visitar o blog 🙂 Eu mandei os arquivos no seu gmail. Abs

      Like

      1. VENKATRAMAN Avatar

        Sir , Your Blog on SAP customizing on Brazil is really great and am almost visiting every day. Can i request you to send me the Postal codes and tax jurisdiction that you had mentioned on the blog above. I would like to get the Brazilian postal codes and tax jurisdiction codes

        Liked by 1 person

  3. Andras Simonfai Avatar
    Andras Simonfai

    Oi Leandro,

    I need also a list for current tax jurisdictions linked to postal codes in BR. Can you pls. send it to wotan77 at gmail?

    Like

  4. Augusto Escobar Avatar
    Augusto Escobar

    Hi Leandro,

    Please, could you send me the file with the Brazilian postal code?

    Thak you in advance.

    Best regards.

    Augusto

    Like

  5. Jonny Black Avatar
    Jonny Black

    Hi Leandro,

    Thanks for this really useful information.

    Can you please provide me the complete list of all the Municipalities with their Jurisdiction codes and postal code ranges?

    Thanks,
    Jonny

    Like

    1. leandropia Avatar

      Sure Jonny! Reach me out on my gmail (leandropia) and I will send you the files!

      Like

      1. Jonah Grace Soriano Avatar
        Jonah Grace Soriano

        can you send the list as well? jgracesoriano@gmail.com

        Like

  6. Guido Avatar
    Guido

    Dear Leandropia,
    can you also provide the complete list of all the Municipalities with their Jurisdiction codes and postal code ranges for Brasil ? Not found any OSS Note so far for this.
    Thx a lot
    Guido

    Like

    1. leandropia Avatar

      I sent them to you via email. Good Luck!

      Like

      1. Aaron Avatar

        Dear Leandropia,
        Can you also provide the complete list of all the Municipalities with their Jurisdiction codes and postal code ranges for Brazil ?

        Unfortunately not found any OSS Note as others have mentioned
        Thx a lot
        Guido

        Like

      2. leandropia Avatar

        pls, email me so I can send the files to you.

        Like

  7. Kali Avatar
    Kali

    Hi Leandro,

    Can you please provide me the complete list of all the Municipalities with their Jurisdiction codes and postal code ranges? I have sent you an email.

    Thanks
    Kali

    Like

    1. leandropia Avatar

      Sorry, I missed that. Do you still need it?

      Like

  8. Maini Febriyanti Avatar
    Maini Febriyanti

    Hi Leandropia,

    Just sent you the email requesting for the list of Brazil – Tax Jurisdiction Codes and the corresponding postal codes.

    Thanks very much in advance.
    Maini Febriyanti

    Like

    1. leandropia Avatar

      Sorry, I missed that, do you still need it? if so, email me or provide an email address please.

      Like

  9. Lana Avatar
    Lana

    Hello Leandropia,

    Thank you very much for your explanation of the subject.

    Could you please provide me the complete list of all the municipalities with their Jurisdiction code and postal code range ? Here is my email Lanaprincesse@hotmail.fr

    I have a question : For some BPs I had the postal code range and region information but the tax jurisdiction is not provided automatically (i checked in the table if the postal code range existed and if a jurisdiction code was linked to. It was the case). When I change the BP manually, it seems that the change/update the BPs retrigger something so the Jurisdiction code is provided it. I don’t know what happens exactly on the system. Do you encounter this kind of issue ?

    Thank you vey much for your help ! It will help me a lot 🙂

    Lana

    Like

    1. leandropia Avatar

      Lana, I sent you the files via email. The beahvior you described is odd. The 3 things I can think of are the settings in the views V_TTXD, V_TXD_E and TTXC. If you want to do a screen sharing and show me that, maybe we can troubleshoot it together.

      Like

    2. leandropia Avatar

      Lana, I got an ündelivered mail” message to the files I sent you 😦

      Like

  10. Cecile Avatar
    Cecile

    Bonjour Leandropia,

    Thank you for this article, it’s very helpful.
    Could you please provide the complete list of all the Municipalities with their Jurisdiction codes and postal code ranges for Brazil ?

    Here is my adress email cecile-pham@outlook.com

    Thank you,

    Like

    1. leandropia Avatar

      I emailed them to you 😉

      Like

      1. Cecile Avatar
        Cecile

        Thank you very much.

        Additional question : do you know if a rule for a derivation of region exists ? I heard that some region could be derived from the Postal Code. Is it correct ?

        Like

      2. leandropia Avatar

        There is if you are using EIM (DQM), but I haven’t seen on ECC. I will investigate and let you know. But for now, the Postal Code AND the Region are the 2 required information to drive the Jurisdiction Code lookup (and auto-populate it in the master records).

        Like

  11. Suyash Pawar Avatar
    Suyash Pawar

    Hi leandropi, it was great blog. Currently we are facing issue while creating customer in brazil. No tax jurisdiction code are maintained, TXJCD field is picked according to the Tax region this was working but now suddenly TXJCD field is not updated and we are facing error No unique jurisdiction code could be determined. can you please help me

    Like

  12. Suyash Pawar Avatar
    Suyash Pawar

    Hello Leondropia, it is a great blog. Now I am facing with customer two errors, one is No unique tax jurisdiction code could not be determined. They have not maintained any jurisdiction code but only one “01” for AM region. This error comes only when region is AM. Second is for other region TXJCD field is not updated in KNA1

    Like

  13. Carlotta Gorrasi Avatar
    Carlotta Gorrasi

    Hi Leandro,

    Thanks for this really useful information.

    Can you please provide me the complete list of all the Municipalities with their Jurisdiction codes and postal code ranges?

    Thanks,
    Carlotta

    Like

    1. leandropia Avatar

      Sure I can, but you will have to email me or give me an email address for that 😉

      Like

      1. Carlotta Gorrasi Avatar
        Carlotta Gorrasi

        Here is my adress email carlygorrasi@gmail.com

        Like

  14. Mariah Avatar
    Mariah

    Hello Leandropia!
    Could you please share to me the list of Jurisdiction codes and postal code ranges?
    Thank you verymuch! mariahjimenez@outlook.com

    Like

  15. Rene Delle Avatar
    Rene Delle

    Hey Leandropia! Thank you very much for your awesome blog. May you please share the list of Jurisdiction codes and postal code ranges with me? Would help me a lot. Thank you very much! rialitaet@gmail.com

    Like

  16. Olga Avatar
    Olga

    Oi Leando
    nos nos temos toda essa configuracao no sistema e ate agora nao tivemos problemas em criar clients Brasileiros aqui no UK, mas de repente comecamos a ter este problema: “Error in length of tax jurisdiction SP” .
    Sabe se houve alteracao recente na legislacao?
    Obrigada
    Olga

    Like

  17. Michele Staropoli Avatar
    Michele Staropoli

    Dear Leandropia,
    can you also provide to me the complete list of all the Municipalities with their Jurisdiction codes and postal code ranges for Brazil?
    Thx a lot,
    Michele mi.sta328@gmail.com

    Like

  18. Javier Avatar
    Javier

    Hello Leandropia,
    can you also provide to me the complete list of all the Municipalities with their Jurisdiction codes and postal code ranges for Brazil?

    Thank so much!!!

    Javier: jjrrmm1974@gmail.com

    Like

  19. Javier Avatar
    Javier

    Hello Leandropia !!
    can you also provide to me the complete list of all the Municipalities with their Jurisdiction codes and postal code ranges for Brazil?

    Thanks so much!!!!

    Javier: jjrrmm1974@gmail.com

    Like

  20. Javier Avatar
    Javier

    Thank you very much Leandro !!!

    Like

  21. kovurukarthik nagakarthik Avatar
    kovurukarthik nagakarthik

    Hello Leandropia !!
    can you also provide to me the complete list of all the Municipalities with their Jurisdiction codes and postal code ranges for Brazil?
    kovurukarthik@gmail.com
    Thanks so much!!!!

    Like

  22. Alderley Avatar
    Alderley

    Hi Leandropia,

    If feasible, could you please send me the complete list of CEP + CEP ranges per city + IBGE codes for cities in Brazil?

    Like

    1. leandropia Avatar

      You will have to email me 🙂

      Like

  23. Kim A Avatar
    Kim A

    Hi Leandropia – We currently need to expand a range of postal codes for a particular jurisdiction code. You indicated if that happens, to just change the existing range. That is not possible even while in change mode. Should I copy existing entry, modify the range and delete the old range? Please confirm.

    Like

    1. leandropia Avatar

      Kim, you will have to delete the existing range, “save”, create the new range, and then transport it.

      Like

  24. Nili Avatar
    Nili

    Hello LEANDROPIA, could you also Email the list with the jurisdiction codes?

    Like

  25. Julie CONNAN Avatar
    Julie CONNAN

    Hello Leandropia thank you sooo much for this very interesting post. I’m starting to work on the Brazilian data maintenance for some of our BPs in SAP S4.

    Would you please be so kind as to email me the list of postal codes ranges & juridisction codes available as of today?

    Obrigada!

    Julie

    Like

    1. leandropia Avatar

      Let me know to what email address send it to.

      Like

Leave a Reply