‎2009 Jan 14 5:02 PM
Hi,
I am doing some email attachment from web dynpro. I get a xstring parameter from front end (which is a text file). I need to convert it (back) into human readable. AS far as I've seen code page 1100 is latin1 so that is what I want
I use 4.6C --> I didn't find a xstring to string function module.
is it done be command TRANSLATE?
thanks in advance
Stefan
‎2009 Jan 14 6:47 PM
see this sap help for CALL TRANSFORMATION
http://help.sap.com/abapdocu/en/ABAPCALL_TRANSFORMATION.htm
check if it exists for 4.6c and can help u or not.
‎2009 Jan 15 9:38 AM
Hi
@ Tarla: this is xslt transformation
@ Rossi not in Release 4.6 C
@ Tarla: not in 4.6 C
‎2009 Jan 15 3:25 PM
Do something like this and adapt it if needed :
REPORT ZZYSRO_XSTRING_TO_STRING.
* This program works only if 1 character occupies 1 byte (4.6c?)
data string type string.
data xstring type xstring.
constants buffsize type i value 2. "here set a large buffer, maximum 65535 or 65536 if I remember well
data xxx type x length buffsize.
field-symbols <ccc> type c.
data max type i.
data len type i.
data pos type i.
data temp type i.
xstring = '414243'.
pos = 0.
len = buffsize.
max = strlen( xstring ). "xstrlen is not available in 4.6c if I remember well, strlen should work
do.
if pos >= max.
exit.
endif.
temp = pos + buffsize.
if temp >= max.
len = max - pos.
endif.
xxx = xstring+pos(len).
assign xxx(len) to <ccc> casting.
concatenate string <ccc> into string.
add buffsize to pos.
enddo.
* Assertion :
if string <> 'ABC'. message x001(00). endif.
‎2009 Jan 14 7:36 PM
Just search the forum for "xstring to string", you'll get the answer (cl_abap_conv_in_ce)
‎2009 Jan 14 7:37 PM
use this FM's
CALL FUNCTION 'ECATT_CONV_XSTRING_TO_STRING'
EXPORTING
im_xstring = xsd
im_encoding = 'UTF-8'
IMPORTING
ex_string = e_xsd.
ENDFUNCTION.
also look at the fm 'HR_KR_XSTRING_TO_STRING'
Also look at the code
data: conv type ref to cl_abap_conv_in_ce ,
xcontent type xstring,
content type string .
conv = cl_abap_conv_in_ce=>create( input = xcontent ).
conv->read( importing data = content ).
source:- /people/sravya.talanki2/blog/2005/12/21/convert-any-r3-structure-to-xsd-made-easy-was-60
Edited by: kartik tarla on Jan 15, 2009 1:07 AM