‎2010 Jul 05 11:37 AM
this particular code is given as stadard example in sap unicode conversion
this particular code is replcement for 'translate code page syntax'
this code describes how to use particular cl_abap_conv_in_ce classs
i cannot understand the 'buffer' field in this code
can any one tell me what is the meaning of buffer = '41424320' from where did he get this value?
DATA:
text(100) TYPE c,
int TYPE i,
buffer(4) TYPE x,
conv TYPE REF TO cl_abap_conv_in_ce.
conv = cl_abap_conv_in_ce=>create(
encoding = 'UTF-8'
endian = 'L' ).
buffer = '41424320'.
conv->convert(
EXPORTING input = buffer
IMPORTING data = text ).
buffer = '02010000'.
conv->convert(
EXPORTING input = buffer
IMPORTING data = int ).
‎2010 Jul 05 11:58 AM
‎2010 Jul 05 11:58 AM
‎2010 Jul 05 11:59 AM
hi elinuk.
it is just sample string.
it is type x (hexadecimal) variable.indeed it is just "ABC"
run function "CACS_CONVERT_HEX_TO_STRING" and give it 41424320.
it will return ABC.
best regards
Mehmet
<removed by moderato>
Edited by: Thomas Zloch on Jul 5, 2010 1:37 PM - please do not ask for ...
‎2010 Jul 05 12:48 PM
thank you mahmet i also want to check weather i am doing the code correct or not
i have old syntax in my program like 'TRANSLATE header-id FROM CODE PAGE file_tab-codepage'.
i am replacing the above syntax with the follwing code and can u correct me if i am wrong
data:
buffer1 type xstring,
conv type ref to cl_abap_conv_in_ce,
int type i.
conv = cl_abap_conv_in_ce=>create(
encoding = 'file_tab-codepage'
endian = 'L' ).
buffer1 = '41424320'.
conv->convert(
exporting input = buffer1
importing data = header-id ).