2010 Mar 31 7:30 AM
Hi Experts,
I'm having issue with currency conversion. Default report output values are displaying in 'EURO' and I had created a toolabar with currency conversion buttons. When this button is selected, values has to be changed into user select currency like INR, USD, AUD. Here im triggering with issues, all the values are converted into 0's. Total value is only converting for first time. From next time. its not converting. I'm using FM's CONVERT_FOREIGN_TO_FOREIGN_CUR,CONVERT_TO_LOCAL_CURRENCY,READ_EXCHANGE_RATE.
Please provide ur solutions to solve the issue.
Thanks and Regards,
Bharat
Hi Experts,
I'm having issue with currency conversion. Default report output values are displaying in 'EURO' and I had created a toolabar with currency conversion buttons. When this button is selected, values has to be changed into user select currency like INR, USD, AUD. Here im triggering with issues, all the values are converted into 0's. Total value is only converting for first time. From next time. its not converting. I'm using FM's CONVERT_FOREIGN_TO_FOREIGN_CUR,CONVERT_TO_LOCAL_CURRENCY,READ_EXCHANGE_RATE.
Please provide ur solutions to solve the issue.
Thanks and Regards,
Bharat
2010 Mar 31 7:37 AM
Check this wiki : https://wiki.sdn.sap.com/wiki/display/Snippets/FMCurrencyConversion
2010 Apr 09 9:51 AM
2010 Apr 09 9:57 AM
Hi ,
You can use this block of code..It is used in our project.
data : l_rate type ukurs_curr, "Exchange rate
l_rate_type type kurst_curr, "Type of rate
l_l_fact type i, "Local factor
l_f_fact type i. "Foreign factor
check local currency ,foreign currency local amount are not initial
check foreign_currency is not initial and
local_currency is not initial and
local_amount is not initial.
Calculate exchange rate
if local_currency = 'MXN' and foreign_currency = 'USD'.
l_rate_type = 'MXNT'.
else.
l_rate_type = 'M'.
endif.
*Call FUNCTION module to get exchange rate
call function 'READ_EXCHANGE_RATE'
exporting
date = sy-datum
foreign_currency = local_currency
local_currency = foreign_currency
type_of_rate = l_rate_type
importing
exchange_rate = l_rate
foreign_factor = l_f_fact
local_factor = l_l_fact
exceptions
no_rate_found = 1
no_factors_found = 2
no_spread_found = 3
derived_2_times = 4
overflow = 5
zero_rate = 6
others = 7
.
if sy-subrc eq 0.
if l_rate le 0.
l_rate = l_rate * -1.
endif.
Foreign amount
if l_rate_type = 'MXNT'.
foreign_amount = local_amount / l_rate .
else.
foreign_amount = local_amount * l_rate .
endif.
endif.
2010 Apr 09 9:58 AM
As per my understanding, when the button is pressed the amounts in all the line items will be converted to the desired currency. Are you getting the 0s for all line items? Could you describe the issue more precisely or share the code?
2010 Apr 09 11:12 AM
Hi,
Initial report output values are displaying in 'EUR'. In the output,when i'm click currency conversion button. all the values are displaying in 0's.
Br,
Bharat
2010 Apr 09 11:21 AM
erm, well most obviously there is something not working as intended in your coding. Tho we cant approve that or pinpoint the part of coding which **** up unless we see the coding.
2010 Apr 09 11:24 AM
What he said.
As long as we don;t see your coding we can only guess: maybe you're calling the functions improperly? Maybe there's no exchange rate set up? Maybe there are but not valid? Maybe you're using the wrong currency units?
2010 Apr 09 12:10 PM
Hello Barat,
Could you share the code, which gets executed when you press the currency conversion button?
2010 Apr 09 10:09 AM
2010 Apr 09 11:20 AM
Please clarify whether it's a problem with conversion. Check the internal table in debugging mode after pressing the currency conversion button to confirm the prices have been converted to the required currency.
2011 Feb 21 5:22 AM
| User | Count |
|---|---|
| 3 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |