10-09-2007 9:38 AM
Hi Guys,
I am having problem with the syntax of the below statement
TRANSLATE itab TO CODE PAGE P_PCODE
*----
where
P_PCODE containscodepage value for UNIX file system I guess.
and ITAB is
DATA: BEGIN OF ITAB OCCURS 0,
RECTYP(1) TYPE C,
DATA(1000) TYPE C,
END OF ITAB.
*----
I found that it is obsolete in ECC 6.0 and I am supposed to use the class CL_ABAP_CONV_OUT_CE and the method CONVERT_STRUC
But when I import the signature of this method to pass the parameter I can not make out which parameter to pass.Can you suggest on this. Reward points guaranteed.
CALL METHOD me->CONVERT_STRUC
EXPORTING
DATA =
VIEW =
IMPORTING
BUFFER =
TRUNCATION_FLAG =
This is signature of this method ( I am avoiding the try n catch part)
If you have any alternate solution please suggests.
10-09-2007 2:32 PM
Hello Anid,
Did you read the documentation of the class cl_abap_conv_out_ce?
The usage of the method to convert codepages of structures is described including this code sample:
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_out_ce,
view TYPE REF TO cl_abap_view_offlen.
view = cl_abap_view_offlen=>create_legacy_view( struc ).
conv = cl_abap_conv_out_ce=>create(
encoding = '0120'
endian = 'B' ).
struc-text = 'Abc12'.
struc-int = 65538.
conv->convert_struc( EXPORTING data = struc
view = view
IMPORTING buffer = buffer ).
I think this should be adaptable to your question.
best regards,
Sven