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: 

Translate string to code page '9902' in ecc6.0

Former Member
0 Kudos

Hi,

All,

I am facing a problem with Transalte statement

'Translate string to code page '9902' in ecc6.0'. Translate is obsolote statement in ECC6.0 .

I tried with a class CL_ABAP_CONV_IN_CE with method CONVERT_STRUC mentioned in F1 help .

Please help regarding this issue.

2 REPLIES 2

Former Member
0 Kudos

What problem are you experiencing?

Example code from the documentation for class CL_ABAP_CONV_IN_CE is


  DATA:
    BEGIN OF struc,
      text(5) TYPE c,
      int TYPE i,
    END OF struc.

  DATA:
    buffer TYPE xstring,
    conv TYPE REF TO cl_abap_conv_in_ce,
    view TYPE REF TO cl_abap_view_offlen.

  conv = cl_abap_conv_in_ce=>create(
            encoding = '0120'
            endian = 'B' ).

  view = cl_abap_view_offlen=>create_legacy_view( struc ).
  buffer = 'C18283F1F250505000010002'.

  conv->convert_struc(
        EXPORTING input = buffer
                  view = view
        IMPORTING data = struc ).

Regards,

Steve.

0 Kudos

Hi,

Just see the below code . I am facing a problem with the statement transalete code page statement.

I used whatever you have given that code . I didn't understand that buffer concept.

*"----


""Local Interface:

*" IMPORTING

*" REFERENCE(IN_STRING)

*" EXPORTING

*" REFERENCE(OUT_STRING)

*" EXCEPTIONS

*" ERROR

*"----


*DATA: str type ZCHAR60. "D49K900158 (IBM INIDA)

DATA: str type ZCHAR60.

str = in_string.

translate str to upper case.

translate str to code page '9902'. "D49K900158 (IBM INIDA)

out_string = str.

ENDFUNCTION.