Skip to Content
0
Former Member
Jul 11, 2013 at 10:44 AM

Getting incorrect value while converting to USD Currency.

400 Views

Hi All,

I am trying to convert HUF amount(Hungarian Currency Format) to USD Amount.While doing this calculation exchange rate is taken when the document is created i.e.Doc creation Date..But i want the exchange rate to be exchange rate for today(Day when report is run).

Please Help ASAP.

Code for Currency Conversion which i used is following -

CLEAR wa_po_curr_usd .

REFRESH it_po_curr_usd .

wa_ekko-netpr = wa_ekko-rlwrt.

IF is_cdhdr-udate IS NOT INITIAL. .

DATA : lcurr LIKE tcurc-waers .

IF wa_ekko-waers NE c_usd.

CALL FUNCTION 'CONVERT_TO_FOREIGN_CURRENCY'

EXPORTING

client = sy-mandt

date = is_cdhdr-udate

foreign_currency = c_usd

local_amount = wa_ekko-netpr

local_currency = wa_ekko-waers

type_of_rate = 'M'

read_tcurr = 'X'

IMPORTING

foreign_amount = wa_ekko-po_cur_usd.

ELSE.

wa_ekko-po_cur_usd = wa_ekko-rlwrt.

ENDIF.

ENDIF.