We have added search box. Key in SAP issue keyword to search
TopBottom

Announcement: wanna exchange links? contact me at sapchatroom@gmail.com.

Re: [sap-dev] xstring to string

Posted by Admin at
Share this post:
Ma.gnolia DiggIt! Del.icio.us Yahoo Furl Technorati Reddit

Reply from R. N. Wilhite on Apr 25 at 10:29 AM
If I happened to find an FM or OO module to do it, then I'd rather that.
But not knowing one. Proceeding down the byte wise path seems to make
sense.

How is the testing of your new code coming? I don't have an application
that I want to test it with, so I can't be sure how it will run.

Neal

---------------Original Message---------------
From: Stefan Vermeulen
Sent: Thursday, April 25, 2013 5:15 AM
Subject: xstring to string

Hi HBK_SINGH,

I used ff. coding for reading the XML:

???
" create an instance of the Ixml Processor   lr-ixml = cl_ixml=>create( ).   " Create the Stream Factory   lr-Stream_Factory = lr-ixml->Create_Stream_Factory( ).   " Create an Encoding and Byte Orde   lr-Encoding = lr-ixml->create_encoding(   Character_Set = gc-Encoding   byte_order = 0 ).   " set encoding fr iStream   lr-iStream = lr-Stream_Factory->Create_iStream_CString(   string = Input ).      lr-iStream->set_encoding( encoding = lr-Encoding ).      clear: "INS SV150812   sy-SubRC. "INS SV150812   call transformation (xTransformation)  """ source XML input   source XML lr-iStream   result root = iSO. " SalesOrder  "" options xml_header = 'WITHOUT_ENCODING' .  "" catch xs_xslt_exception ino xslt_err.  "" lv-s = xslt_Err->get_Text( ).   catch cx_sy_Conversion_Data_Loss "INS SV150812   into lr-xslt_Err. "INS SV150812   lv-err_text = lr-xslt_Err->get_text( ). "INS SV150812   message i799(f9) "INS SV150812   with lv-err_text. "INS SV150812  * f?r Error-Mail vorbereiten "INS SV150812   clear: "INS SV150812   iError. "INS SV150812   iError-Port = xPortOrd. "INS SV150812   iError-Dir = xDirIn. "INS SV150812   iError-File = xFileIn. "INS SV150812   iError-Text = lv-err_text. "INS SV150812   iError-Purch_No_C = ''. "INS SV150812   iError-Datum = sy-Datum. "INS SV150812   iError-UZeit = sy-UZeit. "INS SV150812   append iError. "INS SV150812   sy-SubRC = 4. "INS SV150812   catch CX_ROOT "INS SV150812   into lr-CX_Root. "INS SV150812   lv-err_text = lr-CX_Root->get_text( ). "INS SV150812   message i799(f9) "INS SV150812   with lv-err_text. "INS SV150812  * f?r Error-Mail vorbereiten "INS SV150812   clear: "INS SV150812   iError. "INS SV150812   iError-Port = xPortOrd. "INS SV150812   iError-Dir = xDirIn. "INS SV150812   iError-File = xFileIn. "INS SV150812   iError-Text = lv-err_text. "INS SV150812   iError-Purch_No_C = ''. "INS SV150812   iError-Datum = sy-Datum. "INS SV150812   iError-UZeit = sy-UZeit. "INS SV150812   append iError. "INS SV150812   sy-SubRC = 4. "INS SV150812         endtry.


However, when I'm setting ?gc-Encoding to utf-8, it's working. When trying utf-16 (and handling over the data in "Input" as 2-Byte-Unicode), then I only get errors in conversion.

Neal: Thank you very much for the tip. What do you think, bytewise conversion in a way
char = charx
or do I need a conversion Function / Library?
Will prepare for bytewise translation now.

 
Reply to this email to post your response.
 
__.____._
Manage Settings | Unsubscribe | Create FAQ | Send Feedback
  
Copyright © 2013 Ziff Davis, Inc. and message author.
Ziff Davis, Inc. 28 E 28th Street New York, NY 10016
R. N. Wilhite  

Senior Project Manager
34 achievements
 
Mark as helpful
View this online
Ask a new question
 
In the Spotlight
Become a blogger at Toolbox.com and share your expertise with the community. Start today.

_.____.__

0 comments:

Post a Comment

T r a n s l a t e to your language