‎2009 Feb 09 6:39 AM
Hi Experts,
Can anybody tell me the function module or any other way to determine proper decimal places in amount ,depending upon currency?
Ex. If input is 100 inr it should take it as 100.00 ie 2 digits after decimal place.
‎2009 Feb 09 6:41 AM
Hi,
try this function module..
CONVERT_TO_FOREIGN_CURRENCY
It will convert from local to foriegn currency automatically.
CONVERT_TO_LOCAL_CURRENCY
dis will convert from foriegn to local currency..
Hope it will helpful in future also..
Regards
Kiran
Edited by: Kiran Saka on Feb 9, 2009 7:42 AM
‎2009 Feb 09 6:41 AM
Hi,
try this function module..
CONVERT_TO_FOREIGN_CURRENCY
It will convert from local to foriegn currency automatically.
CONVERT_TO_LOCAL_CURRENCY
dis will convert from foriegn to local currency..
Hope it will helpful in future also..
Regards
Kiran
Edited by: Kiran Saka on Feb 9, 2009 7:42 AM
‎2009 Feb 09 6:42 AM
‎2009 Feb 09 6:43 AM
hi...
prefer to use code in place of function module cause if you use function module in program it will unneccesserily load full function group in same internal session
take a data object w_char of type string like:::
data: w_char type string.
write curr_field to w_char.
write: w_char.
you ll get your work done.
Regards
Edited by: Mohit Kumar on Feb 9, 2009 7:44 AM
‎2009 Feb 09 6:45 AM
Hello Aisha,
If you declare the variable / field as a CURR data type it will have decimal places by default.
What exactly is your requirement, please be more clear ?
BR,
Suhas
‎2009 Feb 09 7:07 AM
I got vbrp-inetwr. Now I want to display it . But depending upon the currency decemal places in the field should be adjusted before display.
please help.
‎2009 Feb 09 6:48 AM
‎2009 Feb 09 6:49 AM
Hi ,
You can try it out---
data w_val type string.
CALL FUNCTION 'CONVERT_TO_FOREIGN_CURRENCY'
EXPORTING
CLIENT = SY-MANDT
date = sy-datum
foreign_currency = 'USD'
local_amount = 1
local_currency = 'INR'
RATE = 0
TYPE_OF_RATE = 'M'
READ_TCURR = 'X'
IMPORTING
EXCHANGE_RATE = w_val
FOREIGN_AMOUNT =
FOREIGN_FACTOR =
LOCAL_FACTOR =
EXCHANGE_RATEX =
DERIVED_RATE_TYPE =
FIXED_RATE =
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.
ENDIF.
Regards
Pinaki