<?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: set relation in cl_simple_tree_model for existing node in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/set-relation-in-cl-simple-tree-model-for-existing-node/m-p/589131#M23680</link>
    <description>&lt;P&gt;Thanks Domi! I would like to avoid a complete rebuild as we have thousands of nodes in the view... &lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt;&lt;/P&gt;
  &lt;P&gt;I will try to just update the "order node", delete all child nodes and add only the child nodes.&lt;/P&gt;</description>
    <pubDate>Thu, 08 Feb 2018 18:17:46 GMT</pubDate>
    <dc:creator>EnnoWulff</dc:creator>
    <dc:date>2018-02-08T18:17:46Z</dc:date>
    <item>
      <title>set relation in cl_simple_tree_model for existing node</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/set-relation-in-cl-simple-tree-model-for-existing-node/m-p/589129#M23678</link>
      <description>&lt;P&gt;Hi there!&lt;/P&gt;
  &lt;P&gt;I am struggeling with inserting a node at a specific position using the cl_simple_tree_model.&lt;/P&gt;
  &lt;P&gt;I build up a tree structure. No big deal. &lt;/P&gt;
  &lt;P&gt;Let's say I display customer orders and the order items as child nodes.&lt;/P&gt;
  &lt;P&gt;Then the user changes the customer order and changes, adds or deletes items. I don't want to make fuzz about every single item and check if it's still there, has been deleted or added or if the text has changed or status has changed and so on.&lt;/P&gt;
  &lt;P&gt;My idea was to simply delete the node of the customer order and rebuild it completely. That's also possible and I can add the new nodes using method ADD_NODES and ADD_ITEMS.&lt;/P&gt;
  &lt;P&gt;BUT: I can only add the nodes using the relationships &lt;/P&gt;
  &lt;UL&gt;
   &lt;LI&gt;First/ Next/ Last child&lt;/LI&gt;
   &lt;LI&gt;First/ Next/ Last sibling&lt;/LI&gt;
  &lt;/UL&gt;
  &lt;P&gt;So an order "in the middle" will be placed at the top (first child) or bottom (last child) of the structure.&lt;/P&gt;
  &lt;P&gt;How can I place the "updated" node at exactly the same position as before?&lt;/P&gt;
  &lt;P&gt;thanks for any idea!&lt;/P&gt;
  &lt;P&gt;Enno&lt;/P&gt;</description>
      <pubDate>Wed, 07 Feb 2018 09:16:24 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/set-relation-in-cl-simple-tree-model-for-existing-node/m-p/589129#M23678</guid>
      <dc:creator>EnnoWulff</dc:creator>
      <dc:date>2018-02-07T09:16:24Z</dc:date>
    </item>
    <item>
      <title>Re: set relation in cl_simple_tree_model for existing node</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/set-relation-in-cl-simple-tree-model-for-existing-node/m-p/589130#M23679</link>
      <description>&lt;P&gt;Hi&lt;/P&gt;
  &lt;P&gt;I always rebuild the tree completely on any change, so I only have to deal with inserts, updates, deletes, sortorder, ... in my ITab(s) and dont really care about this in Tree build methods.&lt;/P&gt;
  &lt;P&gt;And since the tree is UI (mostly with user interaction) I try to keep it short and readable and therefore had nevere any performance issues regarding tree rebuild or GUI transfer!&lt;/P&gt;
  &lt;P&gt;If anyone has a better (delta) solution - I would use it!&lt;/P&gt;
  &lt;P&gt;kr&lt;/P&gt;
  &lt;P&gt;Domi&lt;/P&gt;</description>
      <pubDate>Thu, 08 Feb 2018 17:43:25 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/set-relation-in-cl-simple-tree-model-for-existing-node/m-p/589130#M23679</guid>
      <dc:creator>Domi</dc:creator>
      <dc:date>2018-02-08T17:43:25Z</dc:date>
    </item>
    <item>
      <title>Re: set relation in cl_simple_tree_model for existing node</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/set-relation-in-cl-simple-tree-model-for-existing-node/m-p/589131#M23680</link>
      <description>&lt;P&gt;Thanks Domi! I would like to avoid a complete rebuild as we have thousands of nodes in the view... &lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt;&lt;/P&gt;
  &lt;P&gt;I will try to just update the "order node", delete all child nodes and add only the child nodes.&lt;/P&gt;</description>
      <pubDate>Thu, 08 Feb 2018 18:17:46 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/set-relation-in-cl-simple-tree-model-for-existing-node/m-p/589131#M23680</guid>
      <dc:creator>EnnoWulff</dc:creator>
      <dc:date>2018-02-08T18:17:46Z</dc:date>
    </item>
    <item>
      <title>Re: set relation in cl_simple_tree_model for existing node</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/set-relation-in-cl-simple-tree-model-for-existing-node/m-p/589132#M23681</link>
      <description>&lt;P&gt;Hi&lt;/P&gt;
  &lt;P&gt;Yea, I do understand - that's why I try to keep the tree "short and readable"&lt;/P&gt;
  &lt;P&gt;User only need 5, 10 maybe 20 orders on one screen, so you could add some filter or search criteria? &lt;/P&gt;
  &lt;P&gt;I often use a hyperlink in the 1st root item to add an filter via a popup.&lt;/P&gt;
  &lt;P&gt;regards &lt;/P&gt;
  &lt;P&gt;Domi&lt;/P&gt;</description>
      <pubDate>Thu, 08 Feb 2018 18:33:09 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/set-relation-in-cl-simple-tree-model-for-existing-node/m-p/589132#M23681</guid>
      <dc:creator>Domi</dc:creator>
      <dc:date>2018-02-08T18:33:09Z</dc:date>
    </item>
    <item>
      <title>Re: set relation in cl_simple_tree_model for existing node</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/set-relation-in-cl-simple-tree-model-for-existing-node/m-p/589133#M23682</link>
      <description>&lt;P&gt;It's so easy... *head-&amp;gt;table*&lt;/P&gt;
  &lt;P&gt;Method ADD_NODE and ADD_NODES have the importing parameter "RELATIVE_NODE_KEY".&lt;/P&gt;
  &lt;P&gt;If you want to "Update" the current node you just have to add the updated nodes with RELATIVE_NODE_KEY = new_node_key and RELATIONSHIP = next_sibling or prev_sibling. Then you delete the old node.&lt;/P&gt;
  &lt;P&gt;If you have unique node-keys, like order number, or material number, then you first have to check NODE_GET_PREV_SIBLING, then delete the old node and afterwards add the new nodes with RELATIVE_NODE_KEY = prev_sibling_of_old_node and RELATIONSHIP = next_sibling.&lt;/P&gt;
  &lt;P&gt;If there is no previous sibling, then you have to find out the parent NODE_GET_PARENT and set relationship to first_child.&lt;/P&gt;</description>
      <pubDate>Fri, 09 Feb 2018 14:56:25 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/set-relation-in-cl-simple-tree-model-for-existing-node/m-p/589133#M23682</guid>
      <dc:creator>EnnoWulff</dc:creator>
      <dc:date>2018-02-09T14:56:25Z</dc:date>
    </item>
  </channel>
</rss>

