cancel
Showing results for 
Search instead for 
Did you mean: 

"Rate in row should have matched document rate" error during AP Invoice Creation via DI API

former_member183373
Active Participant
0 Kudos

Hello All,

We are having a strange issue when creating Purchase Invoice Draft via DI API. This seemed like a bug to me and I wanted to get your opinion and ask for a possible workaround.

We are setting line Currency and Rate fields according to specific date and rate since all these lines contains employee expenses. However, in the cases we set “Currency” to “USD” and Rate to some “#.###” formatted value we are having an error that says “Rate in row should have matched the document rate”.

Here are the facts so far;

- We don’t have any issue with other currencies and it even does work if I set a new US American Dollar currency with different code.

- As I debugged the code I noticed that If I set Document Currency and Rate to the same value with Line Currency and Rate it works fine. But of course I can’t use this as a workaround because this doesn’t work when there are multiple lines records.

- Not giving any DocDate doesn't change the error. But if I enter the same date with currency it works fine since the rates are matching. But again it is not applicable as a workaround since this doesn’t work when there are multiple lines records.


- I tried different rounded values for line rate like 3.0, 3.01 but it also didn't change the outcome.

Obviously Document has "USD" as default currency and it is giving this error if a "USD" line rate doesn't match the document rate but the behavior didn't seemed normal to me. Since code works fine with other currencies I tried setting the document rate to some other currency at the beginning but it also didn't work.


I will also open a SR and share sample project that produces the error.

Please let me know if you have any idea about the issue since it is urgent for us.

Kind Regards,

Atilla

Accepted Solutions (1)

Accepted Solutions (1)

Johan_H
Active Contributor

Hi Atilla,

That support ticket is probably your best bet, but just out of curiosity, you said that with a newly established currency for USD (with a different code), it does work.

What is the code for the original USD currency and what for the new one ?

Regards,

Johan

former_member183373
Active Participant
0 Kudos

Hello Johan,

I found the root cause. It is because System Currency of the company is "USD". Even the Local Currency is "TRY" it doesn't matter. B1 is making the validation against "System Currency" and now I am unable to enter currency rate for rows. Also SAP Support verifies that it is part of the design.

As a workaround I created another US American Dollar currency with the short code "US$" and it seems working fine but the symbol doesn't look as beautiful as in here

Also here are the rates if you want to inspect.

Kind Regards,

Atilla

Johan_H
Active Contributor
0 Kudos

Hi Atilla,

Still a bit strange, if both the original and new USD currency have the same rate determined, then you should not get an error when you use the original.

That the system uses System Currency for calculation and validation should not matter at all.

Regards,

Johan

former_member183373
Active Participant
0 Kudos

Hello Johan,

I agree with you that it is a bit strange but here is the explanation I receive from SAP Support.

system design -> When the row currency is equal to system currency or local currency the row rate should be equal to header rate

Regards,

Atilla

Johan_H
Active Contributor
0 Kudos

Hi Atilla,

So can you confirm that the row rate is different from the header rate, when you use the original USD currency code ?

If yes, then why is the rate of USD different from the rate of US$ ?

If not, you may want to bounce the support message back to SAP, and ask them to explain. Point is, there may be inconsistency in your database, in that case.

Regards,

Johan

former_member183373
Active Participant
0 Kudos

Hello Johan,

The row rate is different from the header rate. Assume that it is a monthly expense form.


I don't know why it is treating US$ different than USD but I informed SAP Support that I will be using this workaround.


Thanks,

Atilla

edy_simon
Active Contributor
0 Kudos

Hi Atilla/Johan.

For us human, US$ and USD are 'perceived' as the same.

But for a machine, they are 2 completely different things. SAP will just treat US$ as another 'unknown/new' currency in the system.

I don't know the reasoning behind header and detail rate can not be different if the currency is the same,

But I can confirm that this is consistent by design and not just a bug.

Regards

Edy

Johan_H
Active Contributor
0 Kudos

Hi Edy,

That is my point. SAP should treat USD and US$ exactly the same. It should not see a difference between one and the other, if all their properties (for example rate) are otherwise the same.

In other words, if the system throws an error for USD, it should throw the same error for US$.

Regards,

Johan

edy_simon
Active Contributor
0 Kudos

Hi Johan,

How would the system know USD  is the same as US$?

The fact that you maintaned  2 currencies in your  currency table, 1 is USD and another US$

already speak for it self that they are 2 different currencies.

even if you maintain the rate as 1, it does not mean that the two currency refers to the same.

From a system point of view, it  is just not possible.

The question that we need to ask rather is :

Why header and detail must have the same rate if the currency is either system or local.

Correction :

Local does not have exchange rate, thus definitely can change.

Regards

Edy

former_member183373
Active Participant
0 Kudos

Hello Edy,

When you are configuring the System Currency, available options are "Currency Names" not the "Currency Codes". So in my case I have chosen "U.S. Dollar" as System Currency not "USD" or anything. Therefore logically system should treat "USD" and "US$" as the same currency as Johan proposed. This may be pointing that there is not a complete currency rate relationship across the application.

But anyway the real question is why it is validating row rate against header rate as you said.

Regards,

Atilla.

Johan_H
Active Contributor
0 Kudos

Hi Edy,

I do not mean that the system should somehow recognize that two different currencies are the same. What I mean is, if we get an error when we use USD, then why do we not get the error when we use another currency (any other currecny), that happens to have the exact same rate?

Why SAP requires that header and detail must have the same rate, is in my experience with SAP that it is for some reason very complicated to develop the software to allow for different rates, in this specific scenario.

It is simply easier and/or cheaper to call it "by design", than to develop the software to make it more flexible. (Although I must admit, I am sometimes a little cynical about SAP's development strategy)

Regards,

Johan

Answers (0)