‎2010 Jun 11 11:22 AM
Hi Guys,
I have implemented a WS that recieves an XML serialized as a string.
Once i get this string i want to convert it to XML format.
Any idea?
Thanks
‎2010 Jun 11 11:27 AM
You have to parse the string into XML. Check the instance method PARSE_STRING of class CL_XML_DOCUMENT.
Check my reply in this thread:
Edited by: Suhas Saha on Jun 11, 2010 3:59 PM
‎2010 Jun 11 11:46 AM
‎2010 Jun 11 11:56 AM
When you parse the string the attribute M_DOCUMENT gets updated.
>
> Where i can see the xml that was created?
What do you mean by this ?
‎2010 Jun 11 12:03 PM
DATA: lv TYPE sysubrc.
*type-pools: ixml.
class CL_XML_DOCUMENT definition load.
DATA: OBJ type REF TO cl_xml_document.
CREATE OBJECT OBJ.
CALL METHOD OBJ->PARSE_STRING
EXPORTING
STREAM = '<?xml version="1.0" encoding="iso-8859-1" ?><ARTICULOS><ARTICULO><ACCION>D</ACCION></ARTICULO></ARTICULOS>'
RECEIVING
RETCODE = lv.this is my code, my string has XNL tabs and i want to know where is it parsed.
i want to know where is the xml generated
Edited by: Jon Azkorra Olano on Jun 11, 2010 1:10 PM
‎2010 Jun 11 12:26 PM
XML is not physically generated. In layman's language the XML is saved as the attribute M_DOCUMENT.
Just add the line obj->display( ) at the end of your code, you can see the XML document generated from the string
BR,
Suhas
‎2010 Jun 11 12:39 PM
Thanks and is any way to pass the generated xml to an internal table?
‎2010 Jun 11 1:18 PM
>
> Thanks and is any way to pass the generated xml to an internal table?
You want to convert the XML to internal table ? Check this wiki : [http://wiki.sdn.sap.com/wiki/display/ABAP/UploadXMLfiletointernal+table]
‎2010 Jun 15 12:29 PM
thanks again but i need to pass to the internal table the XML ( i see in obj->display()
‎2010 Jun 15 12:40 PM
‎2010 Sep 15 7:39 AM
‎2010 Sep 15 7:39 AM