2008 Jun 20 5:42 AM
hi
is there any tools to build xml file except using interfaces like
if_ixml, if_ixml_document, if_ixml_element and so on?
2008 Jun 20 5:53 AM
hi,
check transaction SWXML - XML Document Selection.
also check SWF_XMP1 - XML Object Type Builder.
reward points if hlpful.
2008 Jun 20 5:53 AM
hi,
check transaction SWXML - XML Document Selection.
also check SWF_XMP1 - XML Object Type Builder.
reward points if hlpful.
2008 Jun 20 6:02 AM
Hi Abdul,
use CL_IXML class..
code:
REPORT Zabdul .
Definizione oggetti e variabili:
class cl_ixml definition load.
data: g_ixml type ref to if_ixml,
document type ref to if_ixml_document,
element type ref to if_ixml_element,
element1 type ref to if_ixml_element,
text type ref to if_ixml_text,
streamfactory type ref to if_ixml_stream_factory,
stream type ref to if_ixml_ostream,
z type xstring,
renderer type ref to if_ixml_renderer,
rc type i,
node type string,
value type string.
Inizio programma:
start-of-selection.
Creazione l'oggetto 'main factory for the iXML library':
g_ixml = cl_ixml=>create( ).
Creazione documento XML:
document = g_ixml->create_document( ).
Aggiunge elementi:
node = 'person'.
element = document->create_element( name = node ).
rc = document->append_child( element ).
node = 'andrea'.
value = 'ponzio'.
element1 = document->create_element( name = node ).
text = document->create_text( value ).
rc = element->append_child( text ).
rc = document->append_child( element ).
Salva il documento XML:
streamfactory = g_ixml->create_stream_factory( ).
stream = streamfactory->create_ostream_uri(
system_id = 'file://c:\sap.xml' ).
renderer = g_ixml->create_renderer(
document = document ostream = stream ).
rc = renderer->render( ).
write: / rc.
end-of-selection.
see these
links
http://help.sap.com/saphelp_nwpi71/helpdata/en/ba/e18b1a0fc14f1faf884ae50cece51b/content.htm
http://help.sap.com/saphelp_nw04/helpdata/en/ba/e18b1a0fc14f1faf884ae50cece51b/content.htm
thanks
abdul
2008 Sep 12 1:29 PM
Watch SIXML package. You can find examples of sap parser. You can convert a xml string in a XML document using OO