Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

problem in understanding the code

Former Member
0 Likes
531

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 ).

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
496

Its the string 'ABC' in utf-8 to hexadeciaml conversion

3 REPLIES 3
Read only

Former Member
0 Likes
497

Its the string 'ABC' in utf-8 to hexadeciaml conversion

Read only

Former Member
0 Likes
496

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 ...

Read only

0 Likes
496

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 ).