<?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: SAP Tree order problem in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/sap-tree-order-problem/m-p/4205766#M1005114</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;l_nodekey     = object-&amp;gt;nodekey( ).&lt;/P&gt;&lt;P&gt;    l_node_name   = object-&amp;gt;name( ).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    call method object_tree-&amp;gt;add_node&lt;/P&gt;&lt;P&gt;      exporting&lt;/P&gt;&lt;P&gt;        node_key          = l_nodekey&lt;/P&gt;&lt;P&gt;        relative_node_key = root_node_title&lt;/P&gt;&lt;P&gt;        isfolder          = abap_false&lt;/P&gt;&lt;P&gt;        text              = l_node_name.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    l_object_ref_wa-name      = l_nodekey.&lt;/P&gt;&lt;P&gt;    l_object_ref_wa-reference = object.&lt;/P&gt;&lt;P&gt;    append l_object_ref_wa into table object_table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;are you using Append or Insert.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Use APPEND , instead of Insert. Append will add the nodes one by one. But in your case insert may be adding at the first. i m not sure. If you can show the add_node logic then i can tell you.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Vijay Babu Dudla&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 17 Jul 2008 13:10:38 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2008-07-17T13:10:38Z</dc:date>
    <item>
      <title>SAP Tree order problem</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/sap-tree-order-problem/m-p/4205765#M1005113</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi experts,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a SAP Tree made using the class cl_simple_tree_model.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I add nodes to it calling the method add_node.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;That is working, but the order of nodes of level one has been inverted. That is, the first node that is added appear in the last position of tree.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;That occurs only with the nodes of level one.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How can I solve this?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Charles&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 17 Jul 2008 13:02:57 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/sap-tree-order-problem/m-p/4205765#M1005113</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-07-17T13:02:57Z</dc:date>
    </item>
    <item>
      <title>Re: SAP Tree order problem</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/sap-tree-order-problem/m-p/4205766#M1005114</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;l_nodekey     = object-&amp;gt;nodekey( ).&lt;/P&gt;&lt;P&gt;    l_node_name   = object-&amp;gt;name( ).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    call method object_tree-&amp;gt;add_node&lt;/P&gt;&lt;P&gt;      exporting&lt;/P&gt;&lt;P&gt;        node_key          = l_nodekey&lt;/P&gt;&lt;P&gt;        relative_node_key = root_node_title&lt;/P&gt;&lt;P&gt;        isfolder          = abap_false&lt;/P&gt;&lt;P&gt;        text              = l_node_name.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    l_object_ref_wa-name      = l_nodekey.&lt;/P&gt;&lt;P&gt;    l_object_ref_wa-reference = object.&lt;/P&gt;&lt;P&gt;    append l_object_ref_wa into table object_table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;are you using Append or Insert.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Use APPEND , instead of Insert. Append will add the nodes one by one. But in your case insert may be adding at the first. i m not sure. If you can show the add_node logic then i can tell you.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Vijay Babu Dudla&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 17 Jul 2008 13:10:38 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/sap-tree-order-problem/m-p/4205766#M1005114</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-07-17T13:10:38Z</dc:date>
    </item>
    <item>
      <title>Re: SAP Tree order problem</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/sap-tree-order-problem/m-p/4205767#M1005115</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Vijay,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I´m using append. Although I´m sure that if I was using insert the result would be the same.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here is the logic:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
    IF v_relative_node_key = 0.
      CALL METHOD g_tree-&amp;gt;add_node
        EXPORTING
          node_key = l_node_key
          text     = l_text
          isfolder = l_isfolder
        EXCEPTIONS
          OTHERS   = 1.
    ELSE.
      CALL METHOD g_tree-&amp;gt;add_node
        EXPORTING
          node_key          = l_node_key
          text              = l_text
          relative_node_key = l_relative_node_key
          relationship      = l_relationship
          isfolder          = l_isfolder
        EXCEPTIONS
          OTHERS            = 1.
    ENDIF.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 17 Jul 2008 13:35:32 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/sap-tree-order-problem/m-p/4205767#M1005115</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-07-17T13:35:32Z</dc:date>
    </item>
    <item>
      <title>Re: SAP Tree order problem</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/sap-tree-order-problem/m-p/4205768#M1005116</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Charles, &lt;/P&gt;&lt;P&gt;can you supply a code extract?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Jon.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 17 Jul 2008 13:37:06 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/sap-tree-order-problem/m-p/4205768#M1005116</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-07-17T13:37:06Z</dc:date>
    </item>
    <item>
      <title>Re: SAP Tree order problem</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/sap-tree-order-problem/m-p/4205769#M1005117</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Sorry - we clearly cross-posted. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In your method call for the first level , you do not supply the parameter relationship. This means that its default value of zero is used. However, zero is also the value of the constant cl_simple_tree_model=&amp;gt;relat_first_child, which means that the last node inserted is at the top of the branch. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;To append a new node to the bottom of the current level, your method call should include the parameter&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;relationship = cl_simple_tree_model=&amp;gt;relat_last_sibling.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this helps&lt;/P&gt;&lt;P&gt;Jon.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 17 Jul 2008 13:47:39 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/sap-tree-order-problem/m-p/4205769#M1005117</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-07-17T13:47:39Z</dc:date>
    </item>
    <item>
      <title>Re: SAP Tree order problem</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/sap-tree-order-problem/m-p/4205770#M1005118</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Jonathan, that solve my problem.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 17 Jul 2008 13:52:29 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/sap-tree-order-problem/m-p/4205770#M1005118</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-07-17T13:52:29Z</dc:date>
    </item>
  </channel>
</rss>

