Skip to Content
avatar image
Former Member

Unicode problem for converting raw data type to string

Hello all,

I am facing the problem in Unicode.

Before Unicode in version 4.7 we can able to convert the data from string to raw (ssfbin data type) and vise versa. But after Unicode check it is giving error as Unicode not compatible to pass to string .How can I over come to this problem could u please do me needful.

Thanking you,

Suman

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

4 Answers

  • Best Answer
    avatar image
    Former Member
    Apr 14, 2009 at 07:16 AM

    unicode doesnt allow assignment of string to raw type as the data length for char type and X type differ in 6.0 version.

    You can try using field-symbols for assignin string to raw as shown .....

    field-symbols: <fs> type x.

    assign str to <fs> casting.

    raw = <fs>.

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      Hi suman ,

      You need to follow the procedure given below

      1) You need to load the class as mentioned below.

      syntax : class CL_ABAP_CONTAINER_UTILITIES definition load.

      2) Then call the method read_container_c

      J_2IEXTRCT-EXTRCTDATA and I_RG23PART1-I_PART1_TYP are the 2 incompatable variables.

      Syntax:

      call method cl_abap_container_utilities=>read_container_c

      exporting IM_CONTAINER = J_2IEXTRCT-EXTRCTDATA

      importing EX_VALUE = I_RG23PART1-I_PART1_TYP

      exceptions ILLEGAL_PARAMETER_TYPE = 1

      others = 2.

  • avatar image
    Former Member
    Apr 14, 2009 at 09:12 AM

    Hi there.... .you can try MOVE command to move raw data into string. ..... if this does not help, please revert back....

    best regards

    Prem Sharma

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Apr 14, 2009 at 10:37 AM

    Hi Suman,

    The RAW datatype cannot be converted to a string type,As RAW type consists of sequence of bytes, so only numerical values can be converted , but in case of char it is not like that.

    For any other datatype , u could have easily used MOVE statement.

    Cheers,

    Laveen

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Aug 19, 2009 at 04:27 PM

    Hi Suman,

    Could you please let us know how did u resolve this issue as even i face a similar issue.

    Thank You,

    Divaker

    Add comment
    10|10000 characters needed characters exceeded