<?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: About cl_gui_simple_tree in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/about-cl-gui-simple-tree/m-p/2886878#M678185</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm not 100% sure I understand the question, but the problem seems to be that the combined length of  i_mtree-swerk i_mtree-beber i_mtree-tplnr can exceed 12 characters... so instead you could set up a second internal table as follows:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;data:
  g_node_key(12)        type n,
  begin of gs_key_lookup,
    key_numc            like g_node_key,
    swerk               like iloa-swerk,
    beber               like iloa-beber,
    tplnr               like iloa-tplnr,
  end of gs_key_lookup,
  gt_key_lookup         like gs_key_lookup occurs 100.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;and in your logic to build "node-node_key" simply add an entry to the table above for each new element, and retrieve entries from the internal table when you need to decode a node_key... something like...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;data:
  ls_key_lookup              like gs_key_lookup.

* ///the key is only 12 charactors
move-corresponding i_mtree to ls_node_key.
add 1 to g_node_key.  "unique ID per node
ls_node_key-node_key = g_node_key.
append ls_node_key to gt_node_key. "for lookups to decode node-node_key

clear: node.
node-node_key = g_node_key. "unique key links into gt_node_key
*" etc etc&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Jonathan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 24 Sep 2007 02:08:02 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2007-09-24T02:08:02Z</dc:date>
    <item>
      <title>About cl_gui_simple_tree</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/about-cl-gui-simple-tree/m-p/2886877#M678184</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I want to build a tree that contained more than 5 nodes,   use the table mtreesnode-node_key to build the node_key ,but this fields only 12 characters long.&lt;/P&gt;&lt;P&gt;   Is there a good method to come true?&lt;/P&gt;&lt;P&gt; thanks&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; example: &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;CLEAR node.&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt; ///the key is only 12 charactors&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;   CONCATENATE  i_mtree-swerk i_mtree-beber i_mtree-tplnr&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;                                         INTO node-node_key.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;*&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;   CONCATENATE i_mtree-swerk i_mtree-beber INTO str1.&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;   node-relatkey = str1.&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;   node-relatship = cl_gui_simple_tree=&amp;gt;relat_last_child.&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;   node-hidden = ''.&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;   node-disabled = ''.&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;   node-isfolder = 'X'.&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;   CLEAR node-n_image.&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;   CLEAR node-exp_image.&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;   CLEAR node-expander.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;*&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;   node-text = i_mtree-pltxt.&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;   APPEND node TO node_table.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 20 Sep 2007 00:40:28 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/about-cl-gui-simple-tree/m-p/2886877#M678184</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-09-20T00:40:28Z</dc:date>
    </item>
    <item>
      <title>Re: About cl_gui_simple_tree</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/about-cl-gui-simple-tree/m-p/2886878#M678185</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm not 100% sure I understand the question, but the problem seems to be that the combined length of  i_mtree-swerk i_mtree-beber i_mtree-tplnr can exceed 12 characters... so instead you could set up a second internal table as follows:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;data:
  g_node_key(12)        type n,
  begin of gs_key_lookup,
    key_numc            like g_node_key,
    swerk               like iloa-swerk,
    beber               like iloa-beber,
    tplnr               like iloa-tplnr,
  end of gs_key_lookup,
  gt_key_lookup         like gs_key_lookup occurs 100.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;and in your logic to build "node-node_key" simply add an entry to the table above for each new element, and retrieve entries from the internal table when you need to decode a node_key... something like...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;data:
  ls_key_lookup              like gs_key_lookup.

* ///the key is only 12 charactors
move-corresponding i_mtree to ls_node_key.
add 1 to g_node_key.  "unique ID per node
ls_node_key-node_key = g_node_key.
append ls_node_key to gt_node_key. "for lookups to decode node-node_key

clear: node.
node-node_key = g_node_key. "unique key links into gt_node_key
*" etc etc&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Jonathan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 24 Sep 2007 02:08:02 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/about-cl-gui-simple-tree/m-p/2886878#M678185</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-09-24T02:08:02Z</dc:date>
    </item>
    <item>
      <title>Re: About cl_gui_simple_tree</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/about-cl-gui-simple-tree/m-p/2886879#M678186</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks very much. &lt;/P&gt;&lt;P&gt;i think this is the best answer to solve this problem now,&lt;/P&gt;&lt;P&gt;but it has a fault. if you want to add more  node_key, you have to build a temp table to  record the node_key.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The T-CODE IH01's source codes contain the answer ,but i can't understand.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 24 Sep 2007 06:55:08 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/about-cl-gui-simple-tree/m-p/2886879#M678186</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-09-24T06:55:08Z</dc:date>
    </item>
    <item>
      <title>Re: About cl_gui_simple_tree</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/about-cl-gui-simple-tree/m-p/2886880#M678187</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Actually I think they are using something quite similar (at first glance at least)... the gt_node_objects is of type gtype_node_objects which has node_key in it.. and "hier" is a parallel internal table i.e. the sy-tabix of hier = sy-tabix of the gt_node_objects... the result is the same as above ... the g_node_key counter defined in the example above is the equivalent of using sy-tabix - I just prefer to make my own key.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Jonathan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 24 Sep 2007 07:07:07 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/about-cl-gui-simple-tree/m-p/2886880#M678187</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-09-24T07:07:07Z</dc:date>
    </item>
  </channel>
</rss>

