Thursday, August 27, 2009

Professional Dirt Bike Cake

Encoding

To change the encoding, the class is useful CL_ABAP_CONV_OBJ
(more information about the class documentation).
RSCP0032 The report can be used for testing and gathering information about
encoding. The function blocks and
ECATT_CONV_STRING_TO_XSTRING
ECATT_CONV_XSTRING_TO_STRING can be used for transformations.
The table lists the TCP00 code pages.

FORM USING decode_response pi_xstring type xstring CHANGING pie_string
type string
DATA: lo_eref TYPE REF TO cx_transformation_error,
string lv_errstr TYPE REF TO TYPE
lo_converter cl_abap_conv_obj.

* change the encoding to ISO-8859-1 (only understands the information rate)
CREATE OBJECT lo_converter
EXPORTING
incode = '1133' " ISO-8859-1
outcode = '4103' " UTF-8
EXCEPTIONS
invalid_codepage = 1
internal_error = 2
OTHERS = 3.

IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.

CALL METHOD lo_converter->convert
EXPORTING
inbuff = pi_xstring
outbufflg = 0
IMPORTING
outbuff = Pie_string
EXCEPTIONS
INTERNAL_ERROR
= 1 OTHERS = 2

IF sy-subrc \u0026lt;> 0 MESSAGE ID sy-msgid
TYPE NUMBER sy-sy-msgty msgno
msgv1 WITH sy-sy-sy-msgv2 msgv3 sy-MSGV4.
ENDIF.
ENDFORM.

0 comments:

Post a Comment