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 error

Former Member
0 Kudos

Hi

I am upgrading version 4.6 to 6.0 . In one of my programs

i have a statement like

begin of quote

x type x value 39

end of quote

type x is no longer valid data type

the result of the statement is value of quote becomes '

wt should i replace it with

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi,

Check this out.

Error:

In case of TYPE X Error; ‘Variable must be of C, N, D, T or STRING type.’

Correction:

We need to change all the Type X (Hexadecimal) variables to Type C with their values unchanged.

So the method to be followed is:-

1. Load the definition of the class CL_ABAP_CONV_IN_CE or CL_ABAP_CHAR_UTILITIES.

2. Declare the variable as Type C, and use the method UCCP(‘XXXX’) of the class CL_ABAP_CONV_IN_CE where XXXX represents the 8-bit Hexadecimal value and incase the variable holds a Hex value for a Horizontal Tab , then the Attribute “HORIZONTAL_TAB” of the class CL_ABAP_CHAR_UTILITIES can be used directly instead of using the method UCCP.

E.g.:

i) *DATA: TAB TYPE X VALUE 09, “Tab character

CLASS: CL_ABAP_CHAR_UTILITIES DEFINITION LOAD.

DATA TAB TYPE C VALUE CL_ABAP_CHAR_UTILITIES=>HORIZONTAL_TAB.

ii) * DATA: CHAR TYPE X VALUE 160.

CLASS: CL_ABAP_CONV_IN_CE DEFINITION LOAD.

DATA CHAR TYPE C.

CHAR = CL_ABAP_CONV_IN_CE=>UCCP(‘00AO’).

(Here ‘00A0’ is the Hexadecimal equivalent of the decimal 160).

3. Incase the TYPE X Variable has a length more than 1, then an internal table must be created for the variable.

E.g.:

CLASS: CL_ABAP_CONV_IN_CE DEFINITION LOAD.

DATA : LF(2) TYPE X VALUE 'F5CD'.

DATA : BEGIN OF LF,

A1 TYPE C,

A2 TYPE C,

END OF LF.

LF-A1 = CL_ABAP_CONV_IN_CE=>UCCP('00F5').

LF-A2 = CL_ABAP_CONV_IN_CE=>UCCP('00CD').

Reward if helpful.

Regards,

Ramya

5 REPLIES 5

Former Member
0 Kudos

Hi,

Refer this.

Error:

Constants : c_tab type x value '09' .

Correct:

Constants : c_tab type abap_char1 value cl_abap_char_utilities=>horizontal_tab .

Reward if helpful.

Regards,

Ramya

0 Kudos

thanks 4 ur reply but i want statement for value 39 only

Former Member
0 Kudos

Hi,

check this

data: con_cret TYPE c VALUE cl_abap_char_utilities=>cr_lf.

Regards,

Raj.

former_member230674
Contributor
0 Kudos

hai

surbi dara,

For ur question, this is the correct way of representation

to get correct output in ECC6.0

data: begin of quote,

x type x value '39',

end of quote.

write quote-x.

Now, u got req. output.

If useful, reward points.

Thank you,

G.V.K.Prasad.

Edited by: PRASAD GVK on Apr 23, 2008 7:11 AM

Former Member
0 Kudos

Hi,

Check this out.

Error:

In case of TYPE X Error; ‘Variable must be of C, N, D, T or STRING type.’

Correction:

We need to change all the Type X (Hexadecimal) variables to Type C with their values unchanged.

So the method to be followed is:-

1. Load the definition of the class CL_ABAP_CONV_IN_CE or CL_ABAP_CHAR_UTILITIES.

2. Declare the variable as Type C, and use the method UCCP(‘XXXX’) of the class CL_ABAP_CONV_IN_CE where XXXX represents the 8-bit Hexadecimal value and incase the variable holds a Hex value for a Horizontal Tab , then the Attribute “HORIZONTAL_TAB” of the class CL_ABAP_CHAR_UTILITIES can be used directly instead of using the method UCCP.

E.g.:

i) *DATA: TAB TYPE X VALUE 09, “Tab character

CLASS: CL_ABAP_CHAR_UTILITIES DEFINITION LOAD.

DATA TAB TYPE C VALUE CL_ABAP_CHAR_UTILITIES=>HORIZONTAL_TAB.

ii) * DATA: CHAR TYPE X VALUE 160.

CLASS: CL_ABAP_CONV_IN_CE DEFINITION LOAD.

DATA CHAR TYPE C.

CHAR = CL_ABAP_CONV_IN_CE=>UCCP(‘00AO’).

(Here ‘00A0’ is the Hexadecimal equivalent of the decimal 160).

3. Incase the TYPE X Variable has a length more than 1, then an internal table must be created for the variable.

E.g.:

CLASS: CL_ABAP_CONV_IN_CE DEFINITION LOAD.

DATA : LF(2) TYPE X VALUE 'F5CD'.

DATA : BEGIN OF LF,

A1 TYPE C,

A2 TYPE C,

END OF LF.

LF-A1 = CL_ABAP_CONV_IN_CE=>UCCP('00F5').

LF-A2 = CL_ABAP_CONV_IN_CE=>UCCP('00CD').

Reward if helpful.

Regards,

Ramya