<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Access table node in a XML docuement using  cl_xml_document objects in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/access-table-node-in-a-xml-docuement-using-cl-xml-document-objects/m-p/10744379#M1875296</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello all,&lt;/P&gt;&lt;P&gt;Is there anyone who can help me out ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;BR&lt;/P&gt;&lt;P&gt;Nilesh&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 29 Dec 2014 14:57:51 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2014-12-29T14:57:51Z</dc:date>
    <item>
      <title>Access table node in a XML docuement using  cl_xml_document objects</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/access-table-node-in-a-xml-docuement-using-cl-xml-document-objects/m-p/10744378#M1875295</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello all,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am using CL_XML_document class to modify a deep complex structure.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I convert the structure into an XML representation using CALL TRANSFORMATION 'ID' and then access its fields using find_node () method of the CL_XML_DOCUMENT.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If i find a particular field(node) , i modify its contents with new values using Set_value() method of if_ixml_node.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This works fine if the complex structures has only simple structures inside it. But in 1 of the case, a field of a structure is an internal table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So when I reach this node , i need to add an entry into this table using set_value( ) but I am unable to do so.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For ex.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Input structure ZABC have 3 structure fields A, B , C.&amp;nbsp; Stucture C has a field ITAB which is an internal table.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;ZABC&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp; |- A &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; |_ fld1 TYPE&amp;nbsp; CHAR2&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; |_ fld2 TYPE CHAR2&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt; |- B &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; |_ fld1 TYPE CHAR2&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; |_ fld2 TYPE CHAR2&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt; |- C &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; |_ fld1 TYPE CHAR2&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; |_ &lt;SPAN style="color: #ff9900;"&gt;itab TYPE STANDARD TABLE OF TY_TABTYPE&amp;nbsp;&amp;nbsp;&amp;nbsp; " TY_TABTYPE has 2 fields /columns&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;My logic&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt; CALL TRANSFORMATION id&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;SOURCE struc = 'ZABC'&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;RESULT XML&amp;nbsp;&amp;nbsp; = xml_string&amp;nbsp;&amp;nbsp; &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt; xml_doc&lt;SPAN class="L0S70"&gt;-&amp;gt;&lt;/SPAN&gt;parse_string( stream = xml_String ). &lt;STRONG&gt; " XML_doc TYPE REF TO cl_xml_document&lt;/STRONG&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp; LOOP.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp; &amp;lt;&amp;lt; some code &amp;gt;&amp;gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; lv_node&amp;nbsp; = xml_doc-&amp;gt;find_node( "some input" )&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; lv_node-&amp;gt;set_value( "some value").&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp; ENDLOOP&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So when the lv_node is ITAB , how do i know if its of table type ? Then if there is a row in it then i need to modify. If it is empty then i need to add a new row into the node.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am totally stuck here as i don't understand how to proceed.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any one with any pointers on this ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Appreciate your quick replies.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Nilesh &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 22 Dec 2014 17:08:33 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/access-table-node-in-a-xml-docuement-using-cl-xml-document-objects/m-p/10744378#M1875295</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2014-12-22T17:08:33Z</dc:date>
    </item>
    <item>
      <title>Re: Access table node in a XML docuement using  cl_xml_document objects</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/access-table-node-in-a-xml-docuement-using-cl-xml-document-objects/m-p/10744379#M1875296</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello all,&lt;/P&gt;&lt;P&gt;Is there anyone who can help me out ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;BR&lt;/P&gt;&lt;P&gt;Nilesh&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 29 Dec 2014 14:57:51 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/access-table-node-in-a-xml-docuement-using-cl-xml-document-objects/m-p/10744379#M1875296</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2014-12-29T14:57:51Z</dc:date>
    </item>
  </channel>
</rss>

