Application Development 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: 

about xml

Former Member
0 Kudos
99

hi

is there any tools to build xml file except using interfaces like

if_ixml, if_ixml_document, if_ixml_element and so on?

1 ACCEPTED SOLUTION

GauthamV
Active Contributor
0 Kudos
67

hi,

check transaction SWXML - XML Document Selection.

also check SWF_XMP1 - XML Object Type Builder.

reward points if hlpful.

3 REPLIES 3

GauthamV
Active Contributor
0 Kudos
68

hi,

check transaction SWXML - XML Document Selection.

also check SWF_XMP1 - XML Object Type Builder.

reward points if hlpful.

Former Member
0 Kudos
67

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

Former Member
0 Kudos
67

Watch SIXML package. You can find examples of sap parser. You can convert a xml string in a XML document using OO