Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Unicode error in command 'Contain String'

Former Member
0 Kudos

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.

3 REPLIES 3

former_member194669
Active Contributor
0 Kudos

Try to use


      call method cl_abap_container_utilities=>fill_container_c

Former Member
0 Kudos

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

rejish_balakrishnan
Contributor
0 Kudos

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.