on 04-18-2007 6:14 AM
Hello all,
we are using the function module CONVERT_TO_LOCAL_CURRENCY to do currency conversion. we have a dump while using the function module in the SRM system. Has anybody encountered such situation.
we get this error
Short text
Unable to interpret "10 " as a number.
hello atul,
When i am running your code in my system, i am getting a message
"Enter rate CHF / EUR rate type for 18.04.2007 in the system settings"
i am passing these variables only
iv_exch_rate_date = sy-datum.
iv_amount = 10.
iv_foreign_currency = 'CHF'.
iv_local_currency = 'EUR'.
And my SRM system is
Component version SRM 5.00
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi
<u>Please try to maintain the configuartion setting in SPRO Transaction. Take help of Functional persons in this. (Valid from and valid to dates are not compatible for Currecy 'CHF' / 'EUR' in your case).</u>
<b>SPRO Path is ->
-
General Settings -> Currencies -> Enter Exchange Rates</b>
<u>Enter Exchange Rates</u>
Exchange rates are required to:
Translate foreign currency amounts when posting or clearing or to check an exchange rate entered manually
Determine the gain and loss from exchange rate differences
Evaluate open items in foreign currency and the foreign currency balance sheet accounts
The exchange rates are defined by period ("valid from").
Note
The function has been improved. Choose the activity Define Exchange Rate Input Worklist or Assign Exchange Rate to Worklist.
The system uses the type M exchange rates for foreign currency translation when posting and clearing documents in the activity Enter Exchange Rate. An entry must exist in the system for this exchange rate type. The exchange rates apply to all company codes.
The exchange rate relations for currency conversion are only displayed here. Read the chapter Define Translation Ratios for information about exchange rate relations maintenance.
Requirements
You define:
the rate types under which you want to store your exchange rates in the step "Check Exchange Rate Type"
the required currency keys in the step "Check Currency Codes"
the conversion factors for
the currency pair
the exchange rate type
the date
in the step "Define the Conversion Factors for Currency Conversion"
Standard settings
Sample exchange rates are already stored in the standard system.
Recommendation
You should delete the exchange rates you do not need.
Activities
1. Check whether the exchange rates you need are in the system.
2. Delete the entries you do not need.
Hi
Which SRM version are you using ?
<u>Sample Code of Function module -></u>
data: IV_EXCH_RATE_DATE TYPE CNVT_EXCH_RATE_DATE,
IV_EXCH_RATE_TYPE TYPE CNVT_EXCH_RATE_TYPE,
IV_EXCH_RATE TYPE CNVT_EXCH_RATE,
IV_FOREIGN_CURRENCY TYPE CNVT_FOREIGN_CURRENCY_UNIT,
IV_LOCAL_CURRENCY TYPE CNVT_LOCAL_CURRENCY_UNIT,
IV_AMOUNT TYPE CNVT_CURRENCY_AMOUNT.
perform check_convert_to_local using iv_exch_rate_date
iv_exch_rate_type
iv_exch_rate
iv_amount
iv_foreign_currency
iv_local_currency.
*&--------------------------------------------------------------------*
*& Form check_convert_to_local
*&--------------------------------------------------------------------*
* text
*---------------------------------------------------------------------*
form check_convert_to_local
using uv_exch_date type cnvt_exch_rate_date
uv_exch_type type cnvt_exch_rate_type
uv_exch_rate type cnvt_exch_rate
uv_foreign_amount type cnvt_foreign_currency_amount
uv_foreign_currency type cnvt_foreign_currency_unit
uv_local_currency type cnvt_local_currency_unit.
* variables for ABAP call
data: lv_local_amount_abap type cnvt_foreign_currency_amount,
lv_local_amount_abap2(16) type p decimals 3,
lv_local_amount_java type cnvt_local_currency_amount.
write: / text-101 color 7.
write: / text-009,
uv_foreign_amount,
text-010,
text-013,
uv_foreign_currency,
text-011,
text-012,
uv_local_currency.
* call ABAP
call function 'CONVERT_TO_LOCAL_CURRENCY'
exporting
* CLIENT = SY-MANDT
date = uv_exch_date
foreign_amount = uv_foreign_amount
foreign_currency = uv_foreign_currency
local_currency = uv_local_currency
rate = uv_exch_rate
type_of_rate = uv_exch_type
* READ_TCURR = 'X'
importing
* exchange_rate = lv_erate
* FOREIGN_FACTOR =
local_amount = lv_local_amount_abap
* LOCAL_FACTOR =
* EXCHANGE_RATEX =
* FIXED_RATE =
* DERIVED_RATE_TYPE =
exceptions
no_rate_found = 1
overflow = 2
no_factors_found = 3
no_spread_found = 4
derived_2_times = 5
others = 6.
if sy-subrc <> 0.
message id sy-msgid type sy-msgty number sy-msgno
with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4
into gv_message.
write: / gv_message.
endif.
lv_local_amount_abap2 = lv_local_amount_abap. "rounding
endform. "check_convert_to_local
<b><u>What about decimal "." instead of "," ? For the logon user, Check in the SU01 Transaction - default tab, for Decimal Places, Currency etc..</u></b>
<u>Please refer to this link for details.</u>
Regards
- Atul
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.