‎2009 May 14 12:52 PM
Hi ,
I am facing unicode error "ESCAPE_TRICK cannot be converted to a character-type field" for
the following syntax -
ESCAPE_TRICK-X1 = '1C'.
Where ESCAPE_TRICK is defined as -
DATA: BEGIN OF ESCAPE_TRICK,
X1(1) TYPE X,
END OF ESCAPE_TRICK.
Please suggest me the solution.
Thanks,
Narayan
‎2009 May 14 1:05 PM
Hi..
Check the class CL_ABAP_CHAR_UTILITIES if any values match 1C
or else use
cl_abap_container_utilities=>read_container_c oR
cl_abap_container_utilities=>fill_container_c
whicever is more appropriate
Regards,
Arun
‎2009 May 14 12:57 PM
HI,
DATA: BEGIN OF ESCAPE_TRICK,
X1(1) TYPE X,
END OF ESCAPE_TRICK.
Data: var(2) type c.
Var = '1C'.
move: var to ESCAPE_TRICK-X1.Thank
Sudheer
‎2009 May 14 1:04 PM
Hi,
As type X is obsolete.
you need to convert it to type c. But you should convert the hexadecimal value '1C' to its equivalent Char value. Replace your code with:
DATA: BEGIN OF ESCAPE_TRICK,
X1 TYPE STRING,
END OF ESCAPE_TRICK.
To convert Hex '1C' to type string
CALL FUNCTION 'CACS_CONVERT_HEX_TO_STRING'
EXPORTING
XSTRING = '1C'
IMPORTING
CSTRING = ESCAPE_TRICK-X1.
.
It should solve your purpose.
Alternatively, '1C' is "FILE SEPERATOR'. you can find its value in char and can use it.
howver, the first ,method should work..
revert back in case of further issue.
Thanks and Regards
Rishika
Edited by: Rishika Bawa on May 14, 2009 2:06 PM
‎2009 May 14 1:05 PM
Hi..
Check the class CL_ABAP_CHAR_UTILITIES if any values match 1C
or else use
cl_abap_container_utilities=>read_container_c oR
cl_abap_container_utilities=>fill_container_c
whicever is more appropriate
Regards,
Arun
‎2009 May 14 1:09 PM
What is your code all about.
You may want to define X1 as TYPE c.
Regards
Shital
‎2009 May 14 1:10 PM
Change the data type of X1 from X to string or Char,hope it works