Skip to Content
0
Former Member
Feb 19, 2009 at 08:34 PM

cl_abap_conv_in_ce

991 Views

We have a more complex problem but i've tried to reduce it down here. Keep in mind, i am a developer and not a basis guy. Why would this code work in our sandbox system but not our development system:

&----


*& Report ZTEST13

&----


REPORT ztest13.

DATA: gobj_conv_in TYPE REF TO cl_abap_conv_in_ce.

DATA: l_xstring TYPE xstring,

l_string TYPE string.

START-OF-SELECTION.

  • This works

l_xstring = '0000000000000038350C'.

gobj_conv_in = cl_abap_conv_in_ce=>create( input = l_xstring ).

gobj_conv_in->read( IMPORTING data = l_string ).

WRITE: / l_string.

FREE: gobj_conv_in.

  • This abends due to conversion error in dev but is ok in sbx

l_xstring = '0000000000000038358C'.

gobj_conv_in = cl_abap_conv_in_ce=>create( input = l_xstring ).

gobj_conv_in->read( IMPORTING data = l_string ).

WRITE: / l_string.

In dev, we get ...

What happened?

At the conversion of a text from codepage '4110' to codepage '4103':

- a character was found that cannot be displayed in one of the two codepages;

- or it was detected that this conversion is not supported

The two Xstrings are identical except for an 8 in the 2nd to last position. As you can see, there are 8s in other positions that do not cause an issue.