‎2008 Feb 12 9:20 AM
I am presently working in Unicode conversion .
There is a statement in sap 4.6C as mentioned below .
Character are converted from HP character format to IBM format
TRANSLATE I_OUTPUT_DATASET FROM CODE PAGE V_FROM_CODEPAGE TO CODE PAGE V_TO_CODEPAGE
V_FROM_CODEPAGE = 1100
V_TO_CODEPAGE = 0199
But when I tried to execute in the Unicode enviornment the above statement is obsolete .
So please send how to change the present text to this format .
‎2008 Feb 13 2:19 PM
Why dont you use the online help to figure out on howto replace the TRANSLATE statement?
‎2008 Feb 20 6:54 AM
Hi ,
Thank you for the suggestion .
But I didn't find any such help from the online .
‎2008 Feb 22 4:40 AM
Hi Bhaskar,
Translate is Obsolete now . You need to use Classes
CL_ABAP_CONV_IN_CE - External to System Format
CL_ABAP_CONV_OUT_CE - System Format to External Format.
Thanks,
Rema.
‎2008 Feb 25 8:27 AM
Position the cursor on TRANSLATE, press F1. Read. There is a paragraf saying translate is obsolet and what do use instead.
‎2008 Feb 25 8:38 AM
Hi,
Thank you .But this only gives the syntax i.e
To UPPER /LOWER case .
Using Pattern .
But it is solving my present problem
‎2008 Feb 25 12:38 PM
Hi Bhaskar,
Try the below code.
report znk_sdn.
data : in_buffer type xstring,
out_buffer type xstring,
conv type ref to cl_abap_conv_x2x_ce,
str1 type string value '?',
x type xstring.
convert text str1 into sortable code x.
write: x, ' '.
convert text '-' into sortable code x.
write x.
in_buffer = '414220C3B602010000'.
conv = cl_abap_conv_x2x_ce=>create( in_encoding = 'UTF-8'
in_endian = 'L'
out_encoding = '1100'
out_endian = 'B'
input = in_buffer ).
call method conv->convert_c( n = 5 ).
out_buffer = conv->get_out_buffer( ).
write out_buffer.
In the same way you can use below classes.
CL_ABAP_CONV_IN_CE
Reading data from a byte-like data object and converting from an external format to the system format.
CL_ABAP_CONV_OUT_CE
Converting data from the system format to an external format and writing in a byte-like data object.
CL_ABAP_CONV_X2X_CE
Converting data from an external format to another external format.