05-11-2020 11:41 AM
Hello Expert,
I am importing the list of currency exchange values from the flat file and after some clean-ups, passing the file data to the BAPI
BAPI_EXCHRATE_CREATEMULTIPLE.
To pass the exchange rate, the data-type used by BAPI is UKURSP (length 9, decimal 5). So i am assigning my CHAR values to the bapi-data type to get he 5 decimal value.
It is working correctly if exchange value from the CSV file is, for eg, 0007.6269000 --> getting converted to 7.62690
but i am getting dump when the value is 15973.900000. This is not getting converted to 5 decimal required for BAPI;s field UKURSP.
How to solve the problem?
Kindly advise.
05-11-2020 12:32 PM
Please post the error message next time.
The value cannot be casted into the currency field, as it is too big:
What currencies are involved in the exchange rate? Have you looked at the current "Currency Exchange Rates (V_TCURR)" to see how this exchange rate pair has been stored in the past?
=> So inorder to save 'that' exchange rate in your system, you will definitly have to use to set the correct ratio factors and maybe use the inverse value instead in your BAPI, you should check your customizing and current values
BAPI value and ratios for direct quoted exchange rate:
BAPI value and ratios for indirect quoted exchange rate:
05-11-2020 12:32 PM
Please post the error message next time.
The value cannot be casted into the currency field, as it is too big:
What currencies are involved in the exchange rate? Have you looked at the current "Currency Exchange Rates (V_TCURR)" to see how this exchange rate pair has been stored in the past?
=> So inorder to save 'that' exchange rate in your system, you will definitly have to use to set the correct ratio factors and maybe use the inverse value instead in your BAPI, you should check your customizing and current values
BAPI value and ratios for direct quoted exchange rate:
BAPI value and ratios for indirect quoted exchange rate:
05-11-2020 1:09 PM
Dear Michael,
Thank you very much for your response and suggestion.
I will definitely check this one.
Btw, the requirement is to update the TCURR table with the exchange rates present in CSV file.
and here i am getting the dump to convert currency IDR --> EUR.
I checked the TCURF table, and there the ratio is maintained as 'Ratio from' = 10000 and 'Ratio to' = 1 for IDR-->EUR.
05-11-2020 1:34 PM
05-12-2020 4:44 AM
EXCHRATE_LIST-RATE_TYPE = 'M'. " just an example. what rate-type are you using?
EXCHRATE_LIST-FROM_CURR = 'IDR'.
EXCHRATE_LIST-TO_CURRNCY = 'EUR'.
EXCHRATE_LIST-VALID_FROM = yourvalidfromdate.
EXCHRATE_LIST-EXCH_RATE = '1.59739'.
EXCHRATE_LIST-FROM_FACTOR = 10000.
EXCHRATE_LIST-TO_FACTOR = 1.
EXCHRATE_LIST-EXCH_RATE_V = 0.
EXCHRATE_LIST-FROM_FACTOR_V = 0.
EXCHRATE_LIST-TO_FACTOR_V = 0.
05-12-2020 6:34 AM
Hey Michael,
Thank you so much for new info.
I am passing below data (in this case eg. GBP) to my BAPI.
I checked the the V_TURF table for IDR-->EUR, there 'ratio-from' (FFACT) is maintained as 10000 and similarly value maintained as 1 for GBP-->EUR conversion.
So is it required to divide by the 'ratio-from' value maintained in TCURF table before filling out the structure for BAPI?
eg. For IDR, 15973.900000/10000 = 1.59739
Below data i am passing to the BAPI structure EXCHRATE_LIST.
EXCHRATE_LIST-RATE_TYPE ='M'."
EXCHRATE_LIST-FROM_CURR ='GBP'.
EXCHRATE_LIST-TO_CURRNCY ='EUR'.
EXCHRATE_LIST-VALID_FROM = 20200614.
EXCHRATE_LIST-EXCH_RATE ='0.97485'.
EXCHRATE_LIST-FROM_FACTOR = 1.
EXCHRATE_LIST-TO_FACTOR = 1.
EXCHRATE_LIST-EXCH_RATE_V =0.00000.
EXCHRATE_LIST-FROM_FACTOR_V =0.
EXCHRATE_LIST-TO_FACTOR_V =0.
05-12-2020 10:15 AM
ajay.vyavahare
It always helps to read the documentation of the BAPI and that for the parameters:
* Import: List of Exchange Rates To Be Generated
* Description
* The individual rows (field strings) in this table have the following meaning:
* Before the BAPI can be called up, the field string must contain all information about the exchange rate to be created. You must use the exchange rate types and currencies used in the SAP system (value ranges: see list of exchange rates / currency codes).
* By entering a date, you decide whether to insert a current exchange rate or a historical exchange rate. If you leave the date blank, the system uses today's date. Dates must always be entered with the format YYYYMMDD.
* The exchange rate itself must be greater than zero and less than 9999.99999. Up to five decimal places are permitted after the decimal point.
* The exchange rate relation (or exchange rate factors) is used for entering exchange rates smaller than 0.00001 or greater than 10000. You can only make entries in the form '1 : scaling' or 'scaling : 1'. Scaling means one of the figures 1, 10, 100, ..., 100000000.
*Example: On 1st June 1999, the relation between the two currencies CURA and CURB is 1 CURA = 12173.8000 CURB. The entry is to be made at the middle rate M. The field string might then look like this:
* Exch.Rate Type From Curr. To Curr. Exch. Rate From factor To factor
* M CURA CURB 1.21738 1 10000
* When writing the exchange rate to the SAP tables, the system compares the relations defined there with the ones you have requested. Where it finds discrepancies, a reconciliation is made with the system settings. If, in the example above, the system was working with the factors 1 : 1000, an exchange rate of 12.17380 would be entered in the table.
* In order to prevent inaccuracies in calculation, however it is always advisable to keep the exchange rate numbers in a range from 0.1 to 10.0.
* Value range
* To fill the key fields, you can display the list of exchange rate types and currency codes.
05-13-2020 9:06 AM
ajay.vyavahare, please follow up on your open question.
05-13-2020 9:19 AM
05-11-2020 1:59 PM
sandra.rossi unfortunately the target field is having 4 digits before the decimal and 5 after the decimal (length 9), therefore conversion is not happening in this case.
05-11-2020 2:03 PM
Sorry, I had deleted my original comment.
But as I say in my last comment, I think that the exchange rate should be 1.59739 if the factor is 10000 IDR for 1 EUR (means 15973.9 IDR for 1 EUR)
05-12-2020 6:35 AM
Hi Sandra,
You are right. The value i need to pass will be 1.59739, and for that i need to divide the original value by its 'Ratio-to' value.
Thanks.