‎2008 Jan 30 7:04 AM
Hi,
Is there any functional module to convert char number to currency text like below example.
x = 12345678.00 change to 12,345,678.00
Regards
‎2008 Jan 30 7:10 AM
Hi,
Use FM HRCM_STRING_TO_AMOUNT_CONVERT
pass the char(amount) and decimal separator, thousand separator.
you get the char converted to amount/currency.
Regards,
Satish
‎2008 Jan 30 1:03 PM
Hi Satish,
I used the function module but it is giving the same value what i passed in the string. can you kindly tell how to use this function module or is there any other function module which ll change da value from 211881.00 to 211,881.00.
regards
Ram
‎2008 Jan 30 2:09 PM
hi,
here are few function modules related to currency:
CURRENCY_AMOUNT_SAP_TO_IDOC - Convert currency to IDOC format
CONVERT_TO_LOCAL_CURRENCY - Conversion of currency
CLOI_PUT_SIGN_IN_FRONT Move the negative sign from the left hand side of a number, to the right hand side of the number. Note that The result will be left justified (like all
character fields), not right justifed as numbers normally are.
CONVERT_TO_FOREIGN_CURRENCY Convert local currency to foreign currency.
CONVERT_TO_LOCAL_CURRENCY Convert from foreign currency to local currency
Example 1: Convert amount to/from string
Amount to string:
CALL FUNCTION 'HRCM_AMOUNT_TO_STRING_CONVERT'
EXPORTING
betrg = 3000
WAERS = 'DKK'
NEW_DECIMAL_SEPARATOR =
NEW_THOUSANDS_SEPARATOR =
IMPORTING
STRING = slam
.
String to amount:
CALL FUNCTION 'HRCM_STRING_TO_AMOUNT_CONVERT'
EXPORTING
string = slam2
DECIMAL_SEPARATOR = '.'
THOUSANDS_SEPARATOR =
WAERS = 'HUF'
IMPORTING
BETRG = b2
EXCEPTIONS
CONVERT_ERROR = 1
OTHERS = 2
plz reward if useful..
‎2008 Jan 30 7:12 AM
You can use the FM ISM_CONVERT_CHAR_TO_CURR or BAPI BAPI_CURRENCY_CONV_TO_INTERNAL.
‎2008 Jan 30 7:14 AM
Hi,
U can use this code
CALL FUNCTION 'CONVERT_TO_LOCAL_CURRENCY'
EXPORTING DATE = BKPF-WWERT
FOREIGN_CURRENCY = BKPF-WAERS
LOCAL_CURRENCY = T001-WAERS
FOREIGN_AMOUNT = BSEG-WRBTR
RATE = BKPF-KURSF
TYPE_OF_RATE = 'M'
IMPORTING EXCHANGE_RATE = KURS
LOCAL_AMOUNT = BSEG-DMBTR
FOREIGN_FACTOR = FAKTOR-F
LOCAL_FACTOR = FAKTOR-L
FIXED_RATE = FIXKURS
EXCEPTIONS NO_RATE_FOUND = 4
NO_FACTORS_FOUND = 8.
Plzz reward points if it helps.