cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

The value of the 'Tax' output parameter of the formula is missing

CarlosSantos
Explorer
0 Kudos
1,365

Hi, 

I created a new formula for Tax (Brazil TAX), IPI with ICMS calculation base, but it has an error due to the lack of tax output parameters.

How do I identify where to fix this error?

CarlosSantos_0-1719927141204.png

CarlosSantos_1-1719927191394.png

 

 

Accepted Solutions (0)

Answers (2)

Answers (2)

msundararaja_perumal
Active Contributor
0 Kudos

Dear @CarlosSantos ,

The tax formula is incorrect. You obtain the knowledge of using the tax formula, please refer the default demo database, the examples available there, will give you an idea on how to use the tax parameters in the tax formula.

Thanks.

CarlosSantos
Explorer
0 Kudos

Dear @msundararaja_perumal,

Thanks, fyi.

 

But the formula default found out is:
TotalB = Total;
BaseAmt= TotalB * Base;
ExcAmt= TotalB * Isento;
OthAmt= TotalB * Outros;
TaxAmt= Rate * BaseAmt;

Tks

 

Felipe_Lima
Active Participant
0 Kudos

Hi @CarlosSantos ,

Where are you using the input variable ICMS_TaxAmt? It's not in your formula.

Regards,
Felipe

 

 

CarlosSantos
Explorer
0 Kudos

Hi, @Felipe_Lima,

It was a test, but it didn't work

Felipe_Lima
Active Participant
0 Kudos

Hi @CarlosSantos ,

I don't know exactly what your goal is, but in any case, I tested it and I could replicate your tax formula without any errors

Felipe_Lima_0-1719953386567.png

If you can share what you're trying to achieve, we may reach a solution.

Regards,
Felipe

CarlosSantos
Explorer
0 Kudos

Hi, @Felipe_Lima,

Thanks for helping me.

I try to create NF, and when I change the Tax Code, it generates an error, as shown in the image.

CarlosSantos_0-1719956361809.png

 

I'm using this configuration.

CarlosSantos_1-1719956490230.png

I has this values to NF

Total value: 54.197,33

ICMS ST: 7903,78 (18%, profit margin: 34,3%)

Total Value: 46.293,55

ICMS BC IPI: 1.851,74 (4%)

 

Original value: 40.255,26

IPI BC ICMS: 6.038,29 (15%)

 

It has to generate automatic calculation, but error occurs

CarlosSantos_2-1719956568262.png

 

Regards,

Carlos Santos

Felipe_Lima
Active Participant
0 Kudos

Hi @CarlosSantos ,

Looks like you have a circular reference in your tax combination.

Your ICMS has IPI in its BC, which means you must have IPI first in your combination (without IPI tax amount calculated, you cannot pass it to ICMS), but, at the same time, your IPI has ICMS in the BC, meaning you'll need ICMS calculated first, which obviously would end up failing considering the whole logic.

I suggest you create an external "memoria de calculo" using Excel/Google Sheets and after reaching the correct base amounts, rates and tax amounts per tax type, you may transport it to SAP or even share it here, then we can solve this together.

Best regards,
Felipe

CarlosSantos
Explorer
0 Kudos

Hi, @Felipe_Lima,

 

When using another tax code that uses the same IPI BC ICMS formula, it worked correctly.

I looked for a very similar tax code, which uses the same formulas and it worked.

The only difference is PIS and COFINS.

In green tax code, with formula IPI BC ICMS error, and in red tax code with formula worked.

Have you had any experience with this type of situation?

CarlosSantos_0-1720112029188.png

Regards,

 

Carlos Santos

Felipe_Lima
Active Participant
0 Kudos

Hi @CarlosSantos ,

As your screenshot does not contain the formula details, it's hard to tell 100%, but according to your screenshot I presume the red combination works because:

  • ICMS - Apparently, it has no IPI dependency;
  • IPI BC ICMS - Apparently, it has ICMS dependency, but this is not a problem as ICMS is being calculated first in the combination;
  • PIS - No apparent issues;
  • COFINS - No apparent issues;
  • ICMS-ST-ALIQ IPI - I assume it has IPI dependency taking into account the formula code. Again, not an issue as IPI is calculated before ST.

Whereas delving into the issues of the green one:

  • ICMS BC com IPI - Has an apparent IPI dependency (this is an issue, as IPI comes after ICMS in the combination, it won't get calculated)
  • ICMS-ST AL IPI - Has an apparent IPI dependency (this is an issue, as IPI comes after ICMS in the combination, it won't get calculated)
  • IPI - Has an apparent ICMS dependency, but this is not a problem as ICMS is being calculated first in the combination;
  • PIS - No apparent issues;
  • COFINS - No apparent issues;

You can confirm with the accountants, but as far as I remember IPI's base amount is price (which already includes ICMS) + Freight + Insurance + Additional Expenses, so unless I'm missing any particularity of your case, you wouldn't need ICMS in your IPI formula as it is already there indirectly.

I would run a test doing the following:

  1. Removing ICMS from the IPI formula or use an existing IPI formula without ICMS;
  2. Create a new combination, placing IPI as the first component of the combination;
  3. Create a new Tax Code based on this combination described above an assign it to a new document

With this scenario, you would get respectively:

  • IPI (without ICMS)
  • ICMS (with IPI, but that's fine as it's calculated prior to it)
  • ICMS-ST AL - IPI (same as above)
  • PIS EXCLUSAO (no issues, as ICMS is calculated first in the sequence)
  • COFINS EXCLUSAO (same as above)

I hope it makes sense

BR,
Felipe