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 conversion for hexadecimal to character

Former Member
0 Kudos

Hi,

Can anyone tell me how to convert the below one to avoid unicode check error.

DATA: V_G_BUFF(8008) TYPE X VALUE ''.

Thanks,

Ramya.

7 REPLIES 7

abhishek_shukla3
Explorer
0 Kudos

Use Class cl_abap_char_utilities in place of TYPE X.

Example is shown below for horizontal tab

DATA: l_sep type c value cl_abap_char_utilities=>HORIZONTAL_TAB.

Before unicode the same variable was declared as under :

DATA : l_sep type x value '09'.

0 Kudos

Horizontal_tab is used to convert if the value is '09'. But how to convert if the hexa decimal value is space.

former_member386202
Active Contributor
0 Kudos

Hi,,

Try like this

DATA: V_G_BUFF(8008) TYPE C.

Regards,

PRashant

P561888
Active Contributor
0 Kudos

Hi

Declare the Class cl_abap_char_utilities load.

data:Class cl_abap_char_utilities load.

and in the STD class we have different methods , use the Horizontal_tab method , so that it will convert it to '#'.

For example if u r downloading the excel file from non unicode it # value is going to be 09 and now for the unicode we need to use this class method .

DATA: l_sep type c value cl_abap_char_utilities=>Horizontal_tab.

Regards,

Bharani

abhishek_shukla3
Explorer
0 Kudos

Try

DATA: l_sep type c value cl_abap_char_utilities=>SPACE_STR.

abhishek_shukla3
Explorer
0 Kudos

or try

DATA: l_sep type c value cl_abap_char_utilities=>BACKSPACE

Former Member
0 Kudos

Hi Ramya,

I believe that you're looking for utility class CL_ABAP_CONV_IN_CE. You can check out the [wiki|http://wiki.sdn.sap.com/wiki/display/ABAP/CL_ABAP_CONV_IN_CE] for some examples.

Cheers, harald