[abap]exchange rate

 

0. Introductions

when the document currency and the local currency are different , we need to convert the foreign amount to the local amount. We usually use these funcitons

·         READ_EXCHANGE_RATE

·         CONVERT_TO_LOCAL_CURRENCY or CONVERT_TO_LOCAL_CURRENCY_N

Anyway, when we call these functions. We have something to attention.

1           If there is no exchange rate entried in the date we input. funciton will find the latest exchange rate according the import conditions. So these function can not deem is the exchange date existed in the input date

2           Before calculate the exchange rate. The foreign amount has already been calculated with its currency factor.
Ex:  we found the amount “JPY  100.00” from database. In actually, the real amount is JPY 10,000. because the currency factor of JPY is 100.

3           hese functions will export 2 factors with currencu unit

These 2 factors is different from the factor with currency.
If we set the exchange ratio(from) and ratio(to) in the SPRO. Like this: 100 JPY to 1 USD. It means the value of exchange rate is using 100 jpy to change 1 usd.
EX: if we set 100 * JPY  =  0.7795  USD * 1 …  1 JPY is 0.007795 for 1 usd.

 

So, we calculate the foreign amount only using exchange rate. Maybe is not the right result we want.

The right fomula is :

foreign amount * currency factor (foreign) * ( exchange rate / currency unit factor (foreign) *

currency unit factor (local))  / currency factor (local) = local amount

ps. The return LOCAL_AMOUNT when called the
CONVERT_TO_LOCAL_CURRENCY. Also need to calculate with the factor of currency units. Local amount = local amount / foreign factor * local factor

 
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值