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 issue with TRANSLATE statement

Former Member
0 Likes
852

TRANSLATE w_extr_string FROM CODE PAGE '1103' TO CODE PAGE '1100'.

This syntax is now obsolete in UNICODE environment.

I've tried to correct it using :

DATA:conv type ref to cl_abap_conv_x2x_ce.

DATA: w_extr_string TYPE XSTRING.

conv = cl_abap_conv_x2x_ce=>create( in_encoding = '1103'

in_endian = 'L'

out_encoding = '1100'

out_endian = 'B'

input = w_extr_string).

But datatype XSTRING is now obsolete in ECC6.0

can anyone plz suggest me a way out...???

7 REPLIES 7
Read only

former_member194669
Active Contributor
0 Likes
768

> But datatype XSTRING is now obsolete in ECC6.0

>

XSTRING is not obsolate in ECC 6.

a®

Read only

0 Likes
768

w_extr_string is of char type.

so first i ve converted w_extr_string into conv_string (XSTRING) type so that it can be passed as parameter in cl_abap_conv_x2x_ce=>create()

conv_out->convert( exporting data = w_extr_string
                                 importing buffer = conv_string ).
              conv = cl_abap_conv_x2x_ce=>create( in_encoding = '1103'
                                                  in_endian = 'L'
                                                  out_encoding = '1100'
                                                  out_endian = 'B'
                                                  input = conv_string ).

Now i want the translated value into w_extr_string.

I'm able to fetch the converted value.

I've tried

conv->CONVERT_X( n = 1044 ).

bUt it didn't worked....

what can be done to fetch the translated value?????

Read only

Former Member
0 Likes
768

Hi,

Please check this link:

DATA : 
  in_buffer  TYPE xstring,
  out_buffer TYPE xstring,
  conv       TYPE REF TO cl_abap_conv_x2x_ce.

in_buffer = '414220C3B602010000'.

conv = cl_abap_conv_x2x_ce=>create( in_encoding = 'UTF-8'
in_endian = 'L'
out_encoding = '1100'
out_endian = 'B'
input = in_buffer ).

CALL METHOD conv->convert_c( n = 5 ).
out_buffer = conv->get_out_buffer( ).

WRITE out_buffer.

Regards

Adil

Read only

0 Likes
768

Hey Adil,

Thanks a lotttt.....its working bt I/m left with one pblm...now i want this out_buffer in char datatype....

hw to convert Xstring to Chr/string???????

Read only

0 Likes
768

i gt d sol.....

THanks a lottt guys........

Read only

Former Member
0 Likes
768

pblm solved

Read only

Former Member
0 Likes
768

Hi can u explain how u r the class with those parameters...

i need to convert some junk data(which actually need to be in korean) into korean