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

Former Member
0 Likes
942

Hi ALL

I have a constant declared as follows:

data : c_single_quote type x value '27'.

While doing an UCCHECK for the program im getting an error saying:

c_single_quote should be of type c,n,d,t or string.

I have tried using the class <b>cl_abap_char_utilities</b> for the conversion but I dont know the corresponding attribute in the class for

<b>value '27'</b>

Kindly help me ...

Regards

Navaneeth

7 REPLIES 7
Read only

Former Member
0 Likes
914

try to declare it as below.

data : c_single_quote type(2) x value '27'.

rgds,

TM.

Please mark if your problem got solved.

Read only

Former Member
0 Likes
914

Hai Murali

Check the following Code

data v_var1 type x value '09'.

data v_len(5) type n.

constants:

c_ecc6_tab(1) type c value cl_abap_char_utilities=>horizontal_tab.

constants:

c1(3) type c value 333.

data: begin of itab occurs 0,

line(20) type c,

end of itab.

data: begin of itab1 occurs 0,

line1(20) type c,

line2(20) type c,

line3(20) type c,

end of itab1.

concatenate c1 c_ecc6_tab c1 c_ecc6_tab c1 c_ecc6_tab c1

into itab-line.

concatenate c1 v_var1 c1

into itab-line.

open dataset c1 for input in text mode encoding default.

describe field c1 length v_len in character mode.

do 5 times.

append itab.

enddo.

data xtab1 like itab1.

data v_newvar like itab1-line1.

do 10 times.

itab1-line1 = 'abc'.

itab1-line2 = 'def'.

itab1-line3 = 'ghi'.

append itab1.

clear itab1.

enddo.

v_tabix = sy-tabix.

Thanks & regards

Sreenivasulu P

Read only

0 Likes
914

Hi Sreenivasulu,

like <b>09</b> corresponds to <b>horizontal_tab</b>

I would like to know the corresponding attribute for <b>27</b>

Regards

Navaneeth

Read only

0 Likes
914

hexa decimal value <b>27</b> repersents character <b>'</b>

Read only

0 Likes
914

Hi Thomas,

If u go to class <b>cl_abap_char_utilities</b> ull find a list of <b>attributes</b>.I want to know which attribute corresponds to hexa decimal value 27(').

Regards

Navaneeth

Read only

Former Member
0 Likes
914

Hi,

Try using the below:

cl_abap_conv_in_ce=>uccp('0027')

This will convert a hexadecimal or decimal unicode value into a single character in the current code page.

If its useful, award points pls...

Regards,

Bharadwaj

Read only

0 Likes
914

Hi Murali. Do you can resolved you problem?