Application Development and Automation 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: 
Read only

Unicode conversion for hexadecimal to character

Former Member
0 Likes
2,134

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
Read only

abhishek_shukla3
Explorer
0 Likes
1,463

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'.

Read only

0 Likes
1,463

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

Read only

former_member386202
Active Contributor
0 Likes
1,463

Hi,,

Try like this

DATA: V_G_BUFF(8008) TYPE C.

Regards,

PRashant

Read only

BH2408
Active Contributor
0 Likes
1,463

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

Read only

abhishek_shukla3
Explorer
0 Likes
1,463

Try

DATA: l_sep type c value cl_abap_char_utilities=>SPACE_STR.

Read only

abhishek_shukla3
Explorer
0 Likes
1,463

or try

DATA: l_sep type c value cl_abap_char_utilities=>BACKSPACE

Read only

Former Member
0 Likes
1,463

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