0

BPC Currency Translation - Average value

May 08, 2017 at 11:27 AM

158

Former Member

Hi Experts,

We have a requirement where the user wants average currency rate translation. Taking example as below, in the Rates model, we have the following value:

Let's say we have a transaction with LC value 1000 on 2017.04 and it will look up for the rate above. We want to calculate the average rate from time 2017.01 to 2017.04 to get the average conversion rate on 2017.04. In this case ((2.1 + 2.2 + 2.2 + 2.1) / 4) = 2.15. The currency conversion rate used would be 2.15. So the currency conversion value would be 1000 * 2.15 = 2150.

The current script and business rules are looking up the rate on 2017.04 (which is 2.1) directly. I am not familiar with the business rules and I think we might need a BADI to perform this calculation. Appreciate your help to provide some insight on this.

Thank you.

image.jpg (23.5 kB)

Vadim Kalinin May 08, 2017 at 12:40 PM
0

You can use different rate entity and fill rates for this new rate entity calculating average of existing rates (using excel formulas or some script logic). Then use this new rate entity for currency conversion. Or you can use different category...

Show 1 Share
Former Member

Thanks for the suggestion. I actually tried to create a new rate type call A_AVG to store the average rate calculation value. In the business formula, I put formula [A_AVG] to look up for the rate however this does not work and it will give value 0 during currency translation.

I have done some reading. So we could only use the following standard one for the formula in business rule?

I also tried to create a new rate entity to store the average rate. I name the rate entity as "Average". By creating new rate entity, I could use rate type [AVG] and in the business rule formula, I could put it as [AVG]. However, when i tested, it also gives me value 0 during currency translation. There are related rates stored in Rates model. Following is the script that I have used. Things are working fine for the usual currency translation. It didn't work for me when I create a new rate entity "Average" or create a new rate type "A_AVG".

Do you have any idea on this? Appreciate your feedback on this.

Thank you.

logicscript.jpg (15.9 kB)
currency.jpg (66.4 kB)
Vadim Kalinin May 09, 2017 at 01:17 PM
0

Looks like you don't have rates in Average rate entity. By the way rate entity name is case sensitive.

Show 1 Share
Former Member