04-02-2009 2:15 PM
Hi All,
We get a unicode error in Contain String command.
var1 CS var2.
var1 is currency type(eg 23,456.45) and var2 is char type.
To avoid this error we need to convert var1 to cahr.
We have a problem in converting a currency value to character.
It would be a great help if you can suggest a class/FM for converting the currency value to character.
It should be noted that directly assigning the currency value to character will not suit our requirement,for example using write statement or move.
04-02-2009 2:34 PM
Try to use
call method cl_abap_container_utilities=>fill_container_c
a®
04-02-2009 2:36 PM
Hi Shobana,
Try this..
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
Regards,
Prabhudas
04-02-2009 3:01 PM
Hi,
Try with these to functional module.
HRCM_AMOUNT_TO_STRING_CONVERT'
WRF_PPW_GET_WAERS_TEXT'
Alternatively try to do reversly also.
PSSV_TEXT_INTO_FIELD_CURRENCY.