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: 

How to Convert a HEX value to CHAR value...Unicode Issue...

Former Member
0 Kudos
320

Hi,

How can I convert HEX value to CHAR value.

The Code in <b>non Unicode</b> system is:

DATA: t_text LIKE tline OCCURS 0 WITH HEADER LINE.

constants: c_hex_20a5(2) TYPE x VALUE '20A5'.

t_text-tdline = 'seller of the item so listed. A legend of the Seller Code(s) is as'.

TRANSLATE t_text-tdline USING c_hex_20a5.

The same code give error in <b>Uni-Code</b> system:

<b>error is "c_hex_20a5 must be an character type object (C, N, D, T or String type)."</b>

If anyone know, what is the solution, please let me know.

Thanks!

Puneet.

1 REPLY 1

Former Member
0 Kudos
115

Hi,

Try declaring the Hex chars using the ABAP char utilities. This is just a sample piece of code on how to declare and use:

CLASS cl_abap_char_utilities DEFINITION LOAD.

DATA: ws_lf TYPE c VALUE cl_abap_char_utilities=>cr_lf.

data: c_newline TYPE x VALUE '0D'. [ it is zero D, for carriage return ]

ws_lf = c_newline.

CONCATENATE it_tab-maktx

ws_lf

ws_template

INTO it_notificatn-template.

Hope this helps...

Regards

Subramanian