Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

Problem in Unicode Conversion

Hello Experts,

As TRANSLATE is obsolate in Unicode version(4.7).. I am using following code to translate.

But The data is not getting translated. Please help.

TYPES: BEGIN OF g_ty_packed,

ttnr(10) TYPE c,

zuord(2) TYPE c,

fuel1(18) TYPE c,

prozent(7) TYPE c,

fuel2(20) TYPE c,

werk(3) TYPE c,

fuel3(20) TYPE c,

END OF g_ty_packed.

DATA: l_view TYPE REF TO cl_abap_view_offlen.

DATA: g_s_packed TYPE g_ty_packed.

DATA: lf_len_x TYPE i,

lo_conv TYPE REF TO cl_abap_conv_in_ce,

l_buffer TYPE xstring.

DATA: lr_conv TYPE REF TO cl_abap_conv_in_ce,

l_xfeld TYPE xstring,

l_encoding TYPE abap_encoding.

FIELD-SYMBOLS: <xfeld>.

ASSIGN g_s_packed TO <xfeld> TYPE 'X'.

l_xfeld = <xfeld>.

lr_conv = cl_abap_conv_in_ce=>create(

encoding = '1610'

input = l_xfeld ).

l_view = cl_abap_view_offlen=>create_unicode16_view(

g_s_packed ).

CALL METHOD lr_conv->read

EXPORTING

view = l_view

IMPORTING

data = g_s_packed.

Here the data has not converted to ASCII, its still displaying in Some different format(####) only

Pls tell me what's wrong in this code..

Not what you were looking for? View more on this topic or Ask a question