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

convert xstring into human readable string

Former Member
0 Likes
1,726

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

5 REPLIES 5
Read only

Former Member
0 Likes
1,112

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.

Read only

0 Likes
1,112

Hi

@ Tarla: this is xslt transformation

@ Rossi not in Release 4.6 C

@ Tarla: not in 4.6 C

Read only

0 Likes
1,112

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.

Read only

Sandra_Rossi
Active Contributor
0 Likes
1,112

Just search the forum for "xstring to string", you'll get the answer (cl_abap_conv_in_ce)

Read only

Former Member
0 Likes
1,112

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