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 --- translate error

Former Member
0 Likes
569

Hi,

Can anybody with following code. I am converting program to unicode and getting an error 'Null space must be a data type C N D T'. Here is the code.

DATA NULL_SPACE(2) TYPE x VALUE '0020'.

TRANSLATE BDCDATA-FVAL USING NULL_SPACE.

Regards,

venkat.

4 REPLIES 4
Read only

Former Member
0 Likes
510

First convert type x to type c using CLASS cl_abap_char_utilities. Then use it in the translate statement.

- Cheers

Read only

0 Likes
510

any idea which method to use to convert X to C in class CL_ABAP_CHAR_UTILITIES?

Regards,

Venkat.

Read only

0 Likes
510

Hi,

I think you need to find the display value of hexadecimal value of 20 first and then look for the replacement in char format.

LIke '09' in hexadeciamal is represnted as #.

I dont know if there is any method to convert in this CL_ABAP_CHAR_UTILITIES class.

Thanks,

Vamshi.

Read only

Former Member
0 Likes
510

Do something like below: -

data: left_content    type string,

      right_content   type string,

      xcontent   type xstring.

data: w_longchar(20).

constants: c_unknown(7) value 'Unknown'.

xcontent = '0020'.

data: conv   type ref to cl_abap_conv_in_ce.

conv = cl_abap_conv_in_ce=>create( input = xcontent ).

conv->read( importing data = left_content ).

- Cheers