<?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: problem with ALV tree in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-alv-tree/m-p/1994293#M405282</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Jorge,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;go through the following Code&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;class: lcl_application definition deferred.&lt;/P&gt;&lt;P&gt;tables : vbrk.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data : it_vbrk like vbrk occurs 0 with header line.&lt;/P&gt;&lt;P&gt;data : it_vbrp like vbrp occurs 0.&lt;/P&gt;&lt;P&gt;data : it_dir  like vbrk.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data : g_application      type ref to lcl_application,&lt;/P&gt;&lt;P&gt;       g_custom_container type ref to cl_gui_custom_container,&lt;/P&gt;&lt;P&gt;       g_tree             type ref to cl_gui_simple_tree,&lt;/P&gt;&lt;P&gt;       o_cont             type ref to cl_gui_custom_container,&lt;/P&gt;&lt;P&gt;       o_grid             type ref to cl_gui_alv_grid.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*--Declaration for Tree View&lt;/P&gt;&lt;P&gt;data : g_node_key type tv_nodekey, " Holds Node Key Value&lt;/P&gt;&lt;P&gt;       node_nb type i. "for Node key&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Types : node_table_type like standard table of mtreesnode with default key.&lt;/P&gt;&lt;P&gt;select-options : s_vbeln for vbrk-vbeln.&lt;/P&gt;&lt;P&gt;select-options : s_fkart for vbrk-fkart.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;class lcl_application definition.&lt;/P&gt;&lt;P&gt;  public section.&lt;/P&gt;&lt;P&gt;*--Event Handler method, this will be executed when&lt;/P&gt;&lt;P&gt;*--node_double click event is triggered.&lt;/P&gt;&lt;P&gt;*--Node_key is passed as an input to this method to&lt;/P&gt;&lt;P&gt;*--know which node was clicked&lt;/P&gt;&lt;P&gt;  methods : handle_node_double_click for event&lt;/P&gt;&lt;P&gt;                  node_double_click of cl_gui_simple_tree&lt;/P&gt;&lt;P&gt;                  importing node_key,&lt;/P&gt;&lt;P&gt;            handle_expand_no_children for event&lt;/P&gt;&lt;P&gt;                  expand_no_children of cl_gui_simple_tree&lt;/P&gt;&lt;P&gt;                  importing node_key.&lt;/P&gt;&lt;P&gt;endclass.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;class lcl_application implementation.&lt;/P&gt;&lt;P&gt;  method handle_node_double_click.&lt;/P&gt;&lt;P&gt;    g_node_key = node_key.&lt;/P&gt;&lt;P&gt;    refresh it_vbrp.&lt;/P&gt;&lt;P&gt;    read table it_vbrk into it_dir index g_node_key.&lt;/P&gt;&lt;P&gt;    select * from vbrp into table it_vbrp&lt;/P&gt;&lt;P&gt;                       where vbeln = it_dir-vbeln.&lt;/P&gt;&lt;P&gt;    CALL METHOD O_GRID-&amp;gt;SET_TABLE_FOR_FIRST_DISPLAY&lt;/P&gt;&lt;P&gt;       EXPORTING&lt;/P&gt;&lt;P&gt;         I_STRUCTURE_NAME    = 'VBRP'&lt;/P&gt;&lt;P&gt;       CHANGING&lt;/P&gt;&lt;P&gt;         IT_OUTTAB           = it_vbrp.&lt;/P&gt;&lt;P&gt;    CALL METHOD O_GRID-&amp;gt;REFRESH_TABLE_DISPLAY.&lt;/P&gt;&lt;P&gt;  endmethod.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  method handle_expand_no_children.&lt;/P&gt;&lt;P&gt;    data : g_node_table type node_table_type,&lt;/P&gt;&lt;P&gt;           node type mtreesnode,&lt;/P&gt;&lt;P&gt;           node_chemin(255) type c,&lt;/P&gt;&lt;P&gt;           it_dir type vbrk.&lt;/P&gt;&lt;P&gt;    g_node_key = node_key.&lt;/P&gt;&lt;P&gt;    read table it_vbrk into it_dir index g_node_key.&lt;/P&gt;&lt;P&gt;    if sy-subrc = 0.&lt;/P&gt;&lt;P&gt;      node_chemin = it_dir-vbeln.&lt;/P&gt;&lt;P&gt;    else.&lt;/P&gt;&lt;P&gt;      exit.&lt;/P&gt;&lt;P&gt;    endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    loop at it_vbrk into it_dir.&lt;/P&gt;&lt;P&gt;      clear : node.&lt;/P&gt;&lt;P&gt;      node-node_key  = node_nb.&lt;/P&gt;&lt;P&gt;      node-relatkey  = node_key.&lt;/P&gt;&lt;P&gt;      node-relatship = cl_gui_simple_tree=&amp;gt;relat_last_child.&lt;/P&gt;&lt;P&gt;      node-text      = it_vbrk-vbeln.&lt;/P&gt;&lt;P&gt;      node-isfolder  = 'X'.&lt;/P&gt;&lt;P&gt;      node-expander  = 'X'.&lt;/P&gt;&lt;P&gt;      if not it_dir-vbeln is initial.&lt;/P&gt;&lt;P&gt;        append node to g_node_table.&lt;/P&gt;&lt;P&gt;        node_nb = node_nb + 1.&lt;/P&gt;&lt;P&gt;      endif.&lt;/P&gt;&lt;P&gt;    endloop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    loop at it_vbrk into it_dir.&lt;/P&gt;&lt;P&gt;      at new fkart.&lt;/P&gt;&lt;P&gt;        clear : node.&lt;/P&gt;&lt;P&gt;        node-node_key  = node_nb.&lt;/P&gt;&lt;P&gt;        node-relatkey  = node_key.&lt;/P&gt;&lt;P&gt;        node-relatship = cl_gui_simple_tree=&amp;gt;relat_last_child.&lt;/P&gt;&lt;P&gt;        node-text      = it_vbrk-vbeln.&lt;/P&gt;&lt;P&gt;        node-isfolder  = 'X'.&lt;/P&gt;&lt;P&gt;        node-expander  = 'X'.&lt;/P&gt;&lt;P&gt;        if not it_dir-vbeln is initial.&lt;/P&gt;&lt;P&gt;          append node to g_node_table.&lt;/P&gt;&lt;P&gt;          node_nb = node_nb + 1.&lt;/P&gt;&lt;P&gt;        endif.&lt;/P&gt;&lt;P&gt;      endat.&lt;/P&gt;&lt;P&gt;    endloop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    if sy-subrc = 0.&lt;/P&gt;&lt;P&gt;      CALL METHOD G_TREE-&amp;gt;ADD_NODES&lt;/P&gt;&lt;P&gt;        EXPORTING&lt;/P&gt;&lt;P&gt;          TABLE_STRUCTURE_NAME  = 'MTREESNODE'&lt;/P&gt;&lt;P&gt;          NODE_TABLE            =  g_node_table.&lt;/P&gt;&lt;P&gt;    endif.&lt;/P&gt;&lt;P&gt;  endmethod.&lt;/P&gt;&lt;P&gt;endclass.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;start-of-selection.&lt;/P&gt;&lt;P&gt;  perform get_data.&lt;/P&gt;&lt;P&gt;  create object g_application.&lt;/P&gt;&lt;P&gt;  set screen 100.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;amp;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*&amp;amp;      Form  get_data&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;amp;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;      text&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;STRONG&gt;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="-----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FORM get_data .&lt;/P&gt;&lt;P&gt;  select vbeln from vbrk&lt;/P&gt;&lt;P&gt;               into corresponding fields of table it_vbrk&lt;/P&gt;&lt;P&gt;               where vbeln in s_vbeln.&lt;/P&gt;&lt;P&gt;  if sy-subrc = 0.&lt;/P&gt;&lt;P&gt;    sort it_vbrk by fkart.&lt;/P&gt;&lt;P&gt;  endif.&lt;/P&gt;&lt;P&gt;ENDFORM.                    " get_data&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;amp;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*&amp;amp;      Module  STATUS_0100  OUTPUT&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;amp;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;      text&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;STRONG&gt;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="-----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;MODULE STATUS_0100 OUTPUT.&lt;/P&gt;&lt;P&gt;  SET PF-STATUS 'MENU'.&lt;/P&gt;&lt;P&gt;  if g_tree is initial.&lt;/P&gt;&lt;P&gt;    perform create_and_init_tree.&lt;/P&gt;&lt;P&gt;  endif.&lt;/P&gt;&lt;P&gt;ENDMODULE.                 " STATUS_0100  OUTPUT&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;amp;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*&amp;amp;      Module  USER_COMMAND_0100  INPUT&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;amp;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;      text&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;STRONG&gt;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="-----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;MODULE USER_COMMAND_0100 INPUT.&lt;/P&gt;&lt;P&gt;  case sy-ucomm.&lt;/P&gt;&lt;P&gt;    when 'BACK'.&lt;/P&gt;&lt;P&gt;      leave program.&lt;/P&gt;&lt;P&gt;  endcase.&lt;/P&gt;&lt;P&gt;ENDMODULE.                 " USER_COMMAND_0100  INPUT&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;amp;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*&amp;amp;      Form  create_and_init_tree&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;amp;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;      text&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;STRONG&gt;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="-----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FORM create_and_init_tree .&lt;/P&gt;&lt;P&gt;  data : events type cntl_simple_events,&lt;/P&gt;&lt;P&gt;         event  type cntl_simple_event.&lt;/P&gt;&lt;P&gt;*--Creating Custom Container class object and passing&lt;/P&gt;&lt;P&gt;*--custom control to it to link.&lt;/P&gt;&lt;P&gt;  CREATE OBJECT G_CUSTOM_CONTAINER&lt;/P&gt;&lt;P&gt;    EXPORTING&lt;/P&gt;&lt;P&gt;      CONTAINER_NAME      = 'TREE_CONT'.&lt;/P&gt;&lt;P&gt;*--Linking Tree View class object to Custom Container class object&lt;/P&gt;&lt;P&gt;*--so that Tree View control will sit on Custom control of the&lt;/P&gt;&lt;P&gt;*--graphical screen.&lt;/P&gt;&lt;P&gt;  CREATE OBJECT G_TREE&lt;/P&gt;&lt;P&gt;    EXPORTING&lt;/P&gt;&lt;P&gt;      PARENT                = g_custom_container&lt;/P&gt;&lt;P&gt;      NODE_SELECTION_MODE   = cl_gui_simple_tree=&amp;gt;node_sel_mode_single.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*--Registering the event id for Tree View which system&lt;/P&gt;&lt;P&gt;*--uses internal purpose.&lt;/P&gt;&lt;P&gt;  event-eventid    = cl_gui_simple_tree=&amp;gt;eventid_node_double_click.&lt;/P&gt;&lt;P&gt;  event-appl_event = 'X'.&lt;/P&gt;&lt;P&gt;  append event to events.&lt;/P&gt;&lt;P&gt;*--Registering the eventId for Tree View.&lt;/P&gt;&lt;P&gt;  CALL METHOD G_TREE-&amp;gt;SET_REGISTERED_EVENTS&lt;/P&gt;&lt;P&gt;    EXPORTING&lt;/P&gt;&lt;P&gt;      EVENTS       = EVENTS.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;assign event handlers in the application class to each desired event&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  SET HANDLER G_APPLICATION-&amp;gt;HANDLE_NODE_DOUBLE_CLICK FOR G_TREE.&lt;/P&gt;&lt;P&gt;  SET HANDLER G_APPLICATION-&amp;gt;HANDLE_EXPAND_NO_CHILDREN FOR G_TREE.&lt;/P&gt;&lt;P&gt;  perform build_node_table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ENDFORM.                    " create_and_init_tree&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;amp;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*&amp;amp;      Form  build_node_table&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;amp;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FORM build_node_table..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  data : g_node_table type node_table_type,&lt;/P&gt;&lt;P&gt;         it_dir like vbrk,&lt;/P&gt;&lt;P&gt;         node type mtreesnode.&lt;/P&gt;&lt;P&gt;*--Creating the first Root node of the Tree View Control.&lt;/P&gt;&lt;P&gt;  clear : node,&lt;/P&gt;&lt;P&gt;          node_nb.&lt;/P&gt;&lt;P&gt;  node-node_key  = '0'.&lt;/P&gt;&lt;P&gt;  node-isfolder = 'X'.&lt;/P&gt;&lt;P&gt;  node-text      = 'Sales Orders'.&lt;/P&gt;&lt;P&gt;  append node to g_node_table.&lt;/P&gt;&lt;P&gt;  node_nb = node_nb + 1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*--Creating the Child Node and adding that to the root node.&lt;/P&gt;&lt;P&gt;  loop at it_vbrk into it_dir.&lt;/P&gt;&lt;P&gt;    clear node.&lt;/P&gt;&lt;P&gt;    node-node_key  = node_nb.&lt;/P&gt;&lt;P&gt;*--Adding the Child node to the root node(Sales Order Folder)&lt;/P&gt;&lt;P&gt;    node-relatkey  = '0'.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;   node-relatkey  = node_nb.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;*--Adding the New Child node, Next to last Child Node&lt;/P&gt;&lt;P&gt;    node-relatship = cl_gui_simple_tree=&amp;gt;relat_last_child.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;   append node to g_node_table.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;*--Showing the sales order no as a text to the node.&lt;/P&gt;&lt;P&gt;    node-text     = it_dir-vbeln.&lt;/P&gt;&lt;UL&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;   node-expander = 'X'.&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;   node-n_image  = '@1Z@'.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;    if not it_dir-vbeln is initial.&lt;/P&gt;&lt;P&gt;      append node to g_node_table.&lt;/P&gt;&lt;P&gt;      node_nb = node_nb + 1.&lt;/P&gt;&lt;P&gt;    endif.&lt;/P&gt;&lt;P&gt;  endloop.&lt;/P&gt;&lt;P&gt;*--Loading the Nodes into tree view control.&lt;/P&gt;&lt;P&gt;  if sy-subrc = 0.&lt;/P&gt;&lt;P&gt;      CALL METHOD G_TREE-&amp;gt;ADD_NODES&lt;/P&gt;&lt;P&gt;        EXPORTING&lt;/P&gt;&lt;P&gt;          TABLE_STRUCTURE_NAME  = 'MTREESNODE'&lt;/P&gt;&lt;P&gt;          NODE_TABLE            =  g_node_table.&lt;/P&gt;&lt;P&gt;  endif.&lt;/P&gt;&lt;P&gt;    CREATE OBJECT O_CONT&lt;/P&gt;&lt;P&gt;      EXPORTING&lt;/P&gt;&lt;P&gt;        CONTAINER_NAME            = 'CUST_CONT'.&lt;/P&gt;&lt;P&gt;    if sy-subrc = 0.&lt;/P&gt;&lt;P&gt;      CREATE OBJECT O_GRID&lt;/P&gt;&lt;P&gt;        EXPORTING&lt;/P&gt;&lt;P&gt;          I_PARENT                  = O_CONT.&lt;/P&gt;&lt;P&gt;    endif.&lt;/P&gt;&lt;P&gt;ENDFORM.                    " build_node_table&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;  set screen 100.&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;here you just double click on this screen Number 100.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and place two subscreen here.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;one for :  TREE_CONT and other for CUST_CONT&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks &amp;amp; regards&lt;/P&gt;&lt;P&gt;Sreeni&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 19 Mar 2007 12:38:36 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2007-03-19T12:38:36Z</dc:date>
    <item>
      <title>problem with ALV tree</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-alv-tree/m-p/1994286#M405275</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi experts, I have a problem with a ALV tree. When I execute the report i cant see nothing, th tree is empty and no data appears.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  can you help me??&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 19 Mar 2007 11:37:24 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-alv-tree/m-p/1994286#M405275</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-03-19T11:37:24Z</dc:date>
    </item>
    <item>
      <title>Re: problem with ALV tree</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-alv-tree/m-p/1994287#M405276</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Have u called method SET_TABLE_FOR_FIRST_DISPLAY&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this helps&lt;/P&gt;&lt;P&gt;Regds,&lt;/P&gt;&lt;P&gt;Seema&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 19 Mar 2007 11:40:20 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-alv-tree/m-p/1994287#M405276</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-03-19T11:40:20Z</dc:date>
    </item>
    <item>
      <title>Re: problem with ALV tree</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-alv-tree/m-p/1994288#M405277</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yes I called this method but nothing appears, neither th title of th repot.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 19 Mar 2007 11:41:47 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-alv-tree/m-p/1994288#M405277</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-03-19T11:41:47Z</dc:date>
    </item>
    <item>
      <title>Re: problem with ALV tree</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-alv-tree/m-p/1994289#M405278</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;did u use it?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data:G_TREE TYPE REF TO CL_GUI_LIST_TREE.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  CALL METHOD G_TREE-&amp;gt;ADD_NODES_AND_ITEMS&lt;/P&gt;&lt;P&gt;    EXPORTING&lt;/P&gt;&lt;P&gt;      NODE_TABLE = NODE_TABLE&lt;/P&gt;&lt;P&gt;      ITEM_TABLE = ITEM_TABLE&lt;/P&gt;&lt;P&gt;      ITEM_TABLE_STRUCTURE_NAME = 'MTREEITM'&lt;/P&gt;&lt;P&gt;    EXCEPTIONS&lt;/P&gt;&lt;P&gt;      FAILED = 1&lt;/P&gt;&lt;P&gt;      CNTL_SYSTEM_ERROR = 3&lt;/P&gt;&lt;P&gt;      ERROR_IN_TABLES = 4&lt;/P&gt;&lt;P&gt;      DP_ERROR = 5&lt;/P&gt;&lt;P&gt;      TABLE_STRUCTURE_NAME_NOT_FOUND = 6.&lt;/P&gt;&lt;P&gt;  IF SY-SUBRC &amp;lt;&amp;gt; 0.&lt;/P&gt;&lt;P&gt;    MESSAGE A000.&lt;/P&gt;&lt;P&gt;  ENDIF.&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;bharat.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 19 Mar 2007 12:22:01 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-alv-tree/m-p/1994289#M405278</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-03-19T12:22:01Z</dc:date>
    </item>
    <item>
      <title>Re: problem with ALV tree</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-alv-tree/m-p/1994290#M405279</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;No, i use this  CALL METHOD cr_arbol-&amp;gt;add_node&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 19 Mar 2007 12:30:02 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-alv-tree/m-p/1994290#M405279</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-03-19T12:30:02Z</dc:date>
    </item>
    <item>
      <title>Re: problem with ALV tree</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-alv-tree/m-p/1994291#M405280</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;which type of tree u r using?&lt;/P&gt;&lt;P&gt;list/simple/column tree.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regard,&lt;/P&gt;&lt;P&gt;bharat.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 19 Mar 2007 12:33:41 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-alv-tree/m-p/1994291#M405280</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-03-19T12:33:41Z</dc:date>
    </item>
    <item>
      <title>Re: problem with ALV tree</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-alv-tree/m-p/1994292#M405281</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This type cl_gui_alv_tree&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 19 Mar 2007 12:36:55 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-alv-tree/m-p/1994292#M405281</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-03-19T12:36:55Z</dc:date>
    </item>
    <item>
      <title>Re: problem with ALV tree</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-alv-tree/m-p/1994293#M405282</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Jorge,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;go through the following Code&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;class: lcl_application definition deferred.&lt;/P&gt;&lt;P&gt;tables : vbrk.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data : it_vbrk like vbrk occurs 0 with header line.&lt;/P&gt;&lt;P&gt;data : it_vbrp like vbrp occurs 0.&lt;/P&gt;&lt;P&gt;data : it_dir  like vbrk.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data : g_application      type ref to lcl_application,&lt;/P&gt;&lt;P&gt;       g_custom_container type ref to cl_gui_custom_container,&lt;/P&gt;&lt;P&gt;       g_tree             type ref to cl_gui_simple_tree,&lt;/P&gt;&lt;P&gt;       o_cont             type ref to cl_gui_custom_container,&lt;/P&gt;&lt;P&gt;       o_grid             type ref to cl_gui_alv_grid.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*--Declaration for Tree View&lt;/P&gt;&lt;P&gt;data : g_node_key type tv_nodekey, " Holds Node Key Value&lt;/P&gt;&lt;P&gt;       node_nb type i. "for Node key&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Types : node_table_type like standard table of mtreesnode with default key.&lt;/P&gt;&lt;P&gt;select-options : s_vbeln for vbrk-vbeln.&lt;/P&gt;&lt;P&gt;select-options : s_fkart for vbrk-fkart.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;class lcl_application definition.&lt;/P&gt;&lt;P&gt;  public section.&lt;/P&gt;&lt;P&gt;*--Event Handler method, this will be executed when&lt;/P&gt;&lt;P&gt;*--node_double click event is triggered.&lt;/P&gt;&lt;P&gt;*--Node_key is passed as an input to this method to&lt;/P&gt;&lt;P&gt;*--know which node was clicked&lt;/P&gt;&lt;P&gt;  methods : handle_node_double_click for event&lt;/P&gt;&lt;P&gt;                  node_double_click of cl_gui_simple_tree&lt;/P&gt;&lt;P&gt;                  importing node_key,&lt;/P&gt;&lt;P&gt;            handle_expand_no_children for event&lt;/P&gt;&lt;P&gt;                  expand_no_children of cl_gui_simple_tree&lt;/P&gt;&lt;P&gt;                  importing node_key.&lt;/P&gt;&lt;P&gt;endclass.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;class lcl_application implementation.&lt;/P&gt;&lt;P&gt;  method handle_node_double_click.&lt;/P&gt;&lt;P&gt;    g_node_key = node_key.&lt;/P&gt;&lt;P&gt;    refresh it_vbrp.&lt;/P&gt;&lt;P&gt;    read table it_vbrk into it_dir index g_node_key.&lt;/P&gt;&lt;P&gt;    select * from vbrp into table it_vbrp&lt;/P&gt;&lt;P&gt;                       where vbeln = it_dir-vbeln.&lt;/P&gt;&lt;P&gt;    CALL METHOD O_GRID-&amp;gt;SET_TABLE_FOR_FIRST_DISPLAY&lt;/P&gt;&lt;P&gt;       EXPORTING&lt;/P&gt;&lt;P&gt;         I_STRUCTURE_NAME    = 'VBRP'&lt;/P&gt;&lt;P&gt;       CHANGING&lt;/P&gt;&lt;P&gt;         IT_OUTTAB           = it_vbrp.&lt;/P&gt;&lt;P&gt;    CALL METHOD O_GRID-&amp;gt;REFRESH_TABLE_DISPLAY.&lt;/P&gt;&lt;P&gt;  endmethod.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  method handle_expand_no_children.&lt;/P&gt;&lt;P&gt;    data : g_node_table type node_table_type,&lt;/P&gt;&lt;P&gt;           node type mtreesnode,&lt;/P&gt;&lt;P&gt;           node_chemin(255) type c,&lt;/P&gt;&lt;P&gt;           it_dir type vbrk.&lt;/P&gt;&lt;P&gt;    g_node_key = node_key.&lt;/P&gt;&lt;P&gt;    read table it_vbrk into it_dir index g_node_key.&lt;/P&gt;&lt;P&gt;    if sy-subrc = 0.&lt;/P&gt;&lt;P&gt;      node_chemin = it_dir-vbeln.&lt;/P&gt;&lt;P&gt;    else.&lt;/P&gt;&lt;P&gt;      exit.&lt;/P&gt;&lt;P&gt;    endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    loop at it_vbrk into it_dir.&lt;/P&gt;&lt;P&gt;      clear : node.&lt;/P&gt;&lt;P&gt;      node-node_key  = node_nb.&lt;/P&gt;&lt;P&gt;      node-relatkey  = node_key.&lt;/P&gt;&lt;P&gt;      node-relatship = cl_gui_simple_tree=&amp;gt;relat_last_child.&lt;/P&gt;&lt;P&gt;      node-text      = it_vbrk-vbeln.&lt;/P&gt;&lt;P&gt;      node-isfolder  = 'X'.&lt;/P&gt;&lt;P&gt;      node-expander  = 'X'.&lt;/P&gt;&lt;P&gt;      if not it_dir-vbeln is initial.&lt;/P&gt;&lt;P&gt;        append node to g_node_table.&lt;/P&gt;&lt;P&gt;        node_nb = node_nb + 1.&lt;/P&gt;&lt;P&gt;      endif.&lt;/P&gt;&lt;P&gt;    endloop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    loop at it_vbrk into it_dir.&lt;/P&gt;&lt;P&gt;      at new fkart.&lt;/P&gt;&lt;P&gt;        clear : node.&lt;/P&gt;&lt;P&gt;        node-node_key  = node_nb.&lt;/P&gt;&lt;P&gt;        node-relatkey  = node_key.&lt;/P&gt;&lt;P&gt;        node-relatship = cl_gui_simple_tree=&amp;gt;relat_last_child.&lt;/P&gt;&lt;P&gt;        node-text      = it_vbrk-vbeln.&lt;/P&gt;&lt;P&gt;        node-isfolder  = 'X'.&lt;/P&gt;&lt;P&gt;        node-expander  = 'X'.&lt;/P&gt;&lt;P&gt;        if not it_dir-vbeln is initial.&lt;/P&gt;&lt;P&gt;          append node to g_node_table.&lt;/P&gt;&lt;P&gt;          node_nb = node_nb + 1.&lt;/P&gt;&lt;P&gt;        endif.&lt;/P&gt;&lt;P&gt;      endat.&lt;/P&gt;&lt;P&gt;    endloop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    if sy-subrc = 0.&lt;/P&gt;&lt;P&gt;      CALL METHOD G_TREE-&amp;gt;ADD_NODES&lt;/P&gt;&lt;P&gt;        EXPORTING&lt;/P&gt;&lt;P&gt;          TABLE_STRUCTURE_NAME  = 'MTREESNODE'&lt;/P&gt;&lt;P&gt;          NODE_TABLE            =  g_node_table.&lt;/P&gt;&lt;P&gt;    endif.&lt;/P&gt;&lt;P&gt;  endmethod.&lt;/P&gt;&lt;P&gt;endclass.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;start-of-selection.&lt;/P&gt;&lt;P&gt;  perform get_data.&lt;/P&gt;&lt;P&gt;  create object g_application.&lt;/P&gt;&lt;P&gt;  set screen 100.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;amp;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*&amp;amp;      Form  get_data&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;amp;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;      text&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;STRONG&gt;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="-----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FORM get_data .&lt;/P&gt;&lt;P&gt;  select vbeln from vbrk&lt;/P&gt;&lt;P&gt;               into corresponding fields of table it_vbrk&lt;/P&gt;&lt;P&gt;               where vbeln in s_vbeln.&lt;/P&gt;&lt;P&gt;  if sy-subrc = 0.&lt;/P&gt;&lt;P&gt;    sort it_vbrk by fkart.&lt;/P&gt;&lt;P&gt;  endif.&lt;/P&gt;&lt;P&gt;ENDFORM.                    " get_data&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;amp;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*&amp;amp;      Module  STATUS_0100  OUTPUT&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;amp;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;      text&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;STRONG&gt;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="-----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;MODULE STATUS_0100 OUTPUT.&lt;/P&gt;&lt;P&gt;  SET PF-STATUS 'MENU'.&lt;/P&gt;&lt;P&gt;  if g_tree is initial.&lt;/P&gt;&lt;P&gt;    perform create_and_init_tree.&lt;/P&gt;&lt;P&gt;  endif.&lt;/P&gt;&lt;P&gt;ENDMODULE.                 " STATUS_0100  OUTPUT&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;amp;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*&amp;amp;      Module  USER_COMMAND_0100  INPUT&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;amp;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;      text&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;STRONG&gt;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="-----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;MODULE USER_COMMAND_0100 INPUT.&lt;/P&gt;&lt;P&gt;  case sy-ucomm.&lt;/P&gt;&lt;P&gt;    when 'BACK'.&lt;/P&gt;&lt;P&gt;      leave program.&lt;/P&gt;&lt;P&gt;  endcase.&lt;/P&gt;&lt;P&gt;ENDMODULE.                 " USER_COMMAND_0100  INPUT&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;amp;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*&amp;amp;      Form  create_and_init_tree&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;amp;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;      text&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;STRONG&gt;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="-----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FORM create_and_init_tree .&lt;/P&gt;&lt;P&gt;  data : events type cntl_simple_events,&lt;/P&gt;&lt;P&gt;         event  type cntl_simple_event.&lt;/P&gt;&lt;P&gt;*--Creating Custom Container class object and passing&lt;/P&gt;&lt;P&gt;*--custom control to it to link.&lt;/P&gt;&lt;P&gt;  CREATE OBJECT G_CUSTOM_CONTAINER&lt;/P&gt;&lt;P&gt;    EXPORTING&lt;/P&gt;&lt;P&gt;      CONTAINER_NAME      = 'TREE_CONT'.&lt;/P&gt;&lt;P&gt;*--Linking Tree View class object to Custom Container class object&lt;/P&gt;&lt;P&gt;*--so that Tree View control will sit on Custom control of the&lt;/P&gt;&lt;P&gt;*--graphical screen.&lt;/P&gt;&lt;P&gt;  CREATE OBJECT G_TREE&lt;/P&gt;&lt;P&gt;    EXPORTING&lt;/P&gt;&lt;P&gt;      PARENT                = g_custom_container&lt;/P&gt;&lt;P&gt;      NODE_SELECTION_MODE   = cl_gui_simple_tree=&amp;gt;node_sel_mode_single.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*--Registering the event id for Tree View which system&lt;/P&gt;&lt;P&gt;*--uses internal purpose.&lt;/P&gt;&lt;P&gt;  event-eventid    = cl_gui_simple_tree=&amp;gt;eventid_node_double_click.&lt;/P&gt;&lt;P&gt;  event-appl_event = 'X'.&lt;/P&gt;&lt;P&gt;  append event to events.&lt;/P&gt;&lt;P&gt;*--Registering the eventId for Tree View.&lt;/P&gt;&lt;P&gt;  CALL METHOD G_TREE-&amp;gt;SET_REGISTERED_EVENTS&lt;/P&gt;&lt;P&gt;    EXPORTING&lt;/P&gt;&lt;P&gt;      EVENTS       = EVENTS.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;assign event handlers in the application class to each desired event&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  SET HANDLER G_APPLICATION-&amp;gt;HANDLE_NODE_DOUBLE_CLICK FOR G_TREE.&lt;/P&gt;&lt;P&gt;  SET HANDLER G_APPLICATION-&amp;gt;HANDLE_EXPAND_NO_CHILDREN FOR G_TREE.&lt;/P&gt;&lt;P&gt;  perform build_node_table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ENDFORM.                    " create_and_init_tree&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;amp;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*&amp;amp;      Form  build_node_table&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;amp;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FORM build_node_table..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  data : g_node_table type node_table_type,&lt;/P&gt;&lt;P&gt;         it_dir like vbrk,&lt;/P&gt;&lt;P&gt;         node type mtreesnode.&lt;/P&gt;&lt;P&gt;*--Creating the first Root node of the Tree View Control.&lt;/P&gt;&lt;P&gt;  clear : node,&lt;/P&gt;&lt;P&gt;          node_nb.&lt;/P&gt;&lt;P&gt;  node-node_key  = '0'.&lt;/P&gt;&lt;P&gt;  node-isfolder = 'X'.&lt;/P&gt;&lt;P&gt;  node-text      = 'Sales Orders'.&lt;/P&gt;&lt;P&gt;  append node to g_node_table.&lt;/P&gt;&lt;P&gt;  node_nb = node_nb + 1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*--Creating the Child Node and adding that to the root node.&lt;/P&gt;&lt;P&gt;  loop at it_vbrk into it_dir.&lt;/P&gt;&lt;P&gt;    clear node.&lt;/P&gt;&lt;P&gt;    node-node_key  = node_nb.&lt;/P&gt;&lt;P&gt;*--Adding the Child node to the root node(Sales Order Folder)&lt;/P&gt;&lt;P&gt;    node-relatkey  = '0'.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;   node-relatkey  = node_nb.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;*--Adding the New Child node, Next to last Child Node&lt;/P&gt;&lt;P&gt;    node-relatship = cl_gui_simple_tree=&amp;gt;relat_last_child.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;   append node to g_node_table.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;*--Showing the sales order no as a text to the node.&lt;/P&gt;&lt;P&gt;    node-text     = it_dir-vbeln.&lt;/P&gt;&lt;UL&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;   node-expander = 'X'.&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;   node-n_image  = '@1Z@'.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;    if not it_dir-vbeln is initial.&lt;/P&gt;&lt;P&gt;      append node to g_node_table.&lt;/P&gt;&lt;P&gt;      node_nb = node_nb + 1.&lt;/P&gt;&lt;P&gt;    endif.&lt;/P&gt;&lt;P&gt;  endloop.&lt;/P&gt;&lt;P&gt;*--Loading the Nodes into tree view control.&lt;/P&gt;&lt;P&gt;  if sy-subrc = 0.&lt;/P&gt;&lt;P&gt;      CALL METHOD G_TREE-&amp;gt;ADD_NODES&lt;/P&gt;&lt;P&gt;        EXPORTING&lt;/P&gt;&lt;P&gt;          TABLE_STRUCTURE_NAME  = 'MTREESNODE'&lt;/P&gt;&lt;P&gt;          NODE_TABLE            =  g_node_table.&lt;/P&gt;&lt;P&gt;  endif.&lt;/P&gt;&lt;P&gt;    CREATE OBJECT O_CONT&lt;/P&gt;&lt;P&gt;      EXPORTING&lt;/P&gt;&lt;P&gt;        CONTAINER_NAME            = 'CUST_CONT'.&lt;/P&gt;&lt;P&gt;    if sy-subrc = 0.&lt;/P&gt;&lt;P&gt;      CREATE OBJECT O_GRID&lt;/P&gt;&lt;P&gt;        EXPORTING&lt;/P&gt;&lt;P&gt;          I_PARENT                  = O_CONT.&lt;/P&gt;&lt;P&gt;    endif.&lt;/P&gt;&lt;P&gt;ENDFORM.                    " build_node_table&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;  set screen 100.&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;here you just double click on this screen Number 100.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and place two subscreen here.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;one for :  TREE_CONT and other for CUST_CONT&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks &amp;amp; regards&lt;/P&gt;&lt;P&gt;Sreeni&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 19 Mar 2007 12:38:36 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-alv-tree/m-p/1994293#M405282</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-03-19T12:38:36Z</dc:date>
    </item>
    <item>
      <title>Re: problem with ALV tree</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-alv-tree/m-p/1994294#M405283</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks but i have made yhe report and I can´t change it. i need to know why a ALV tree can´t be displayed.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  Thanks.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 19 Mar 2007 12:43:09 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-alv-tree/m-p/1994294#M405283</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-03-19T12:43:09Z</dc:date>
    </item>
    <item>
      <title>Re: problem with ALV tree</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-alv-tree/m-p/1994295#M405284</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi,&lt;/P&gt;&lt;P&gt;did u create a container.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data:G_CUSTOM_CONTAINER TYPE REF TO CL_GUI_CUSTOM_CONTAINER,&lt;/P&gt;&lt;P&gt;(this becomes the parent of ur tree)&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;create a container for the tree control&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  CREATE OBJECT G_CUSTOM_CONTAINER&lt;/P&gt;&lt;P&gt;    EXPORTING&lt;/P&gt;&lt;P&gt;      CONTAINER_NAME = 'TREE_CONTAINER'(the name of the container u've created on the screen)&lt;/P&gt;&lt;P&gt;    EXCEPTIONS&lt;/P&gt;&lt;P&gt;      CNTL_ERROR = 1&lt;/P&gt;&lt;P&gt;      CNTL_SYSTEM_ERROR = 2&lt;/P&gt;&lt;P&gt;      CREATE_ERROR = 3&lt;/P&gt;&lt;P&gt;      LIFETIME_ERROR = 4&lt;/P&gt;&lt;P&gt;      LIFETIME_DYNPRO_DYNPRO_LINK = 5.&lt;/P&gt;&lt;P&gt;  IF SY-SUBRC &amp;lt;&amp;gt; 0.&lt;/P&gt;&lt;P&gt;    MESSAGE A000.&lt;/P&gt;&lt;P&gt;  ENDIF.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 19 Mar 2007 12:43:34 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-alv-tree/m-p/1994295#M405284</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-03-19T12:43:34Z</dc:date>
    </item>
    <item>
      <title>Re: problem with ALV tree</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-alv-tree/m-p/1994296#M405285</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Bharat!!! I have wrong the name of the container!!! I had the name 'CR_ARBOL' and the containers name was 'C_ARBOL'.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 19 Mar 2007 12:48:29 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-alv-tree/m-p/1994296#M405285</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-03-19T12:48:29Z</dc:date>
    </item>
    <item>
      <title>Re: problem with ALV tree</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-alv-tree/m-p/1994297#M405286</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;i think u r writing all the code in the program.&lt;/P&gt;&lt;P&gt;you have to write all the code to create the tree in one of the module of PBO.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;confirm whether u r doing so are not.&lt;/P&gt;&lt;P&gt;&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;bharat.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 19 Mar 2007 12:50:28 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-alv-tree/m-p/1994297#M405286</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-03-19T12:50:28Z</dc:date>
    </item>
    <item>
      <title>Re: problem with ALV tree</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-alv-tree/m-p/1994298#M405287</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Sreenivasulu, &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    Thanks for your program, its really useful. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks &lt;/P&gt;&lt;P&gt;Satya&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 19 Mar 2007 13:20:37 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-alv-tree/m-p/1994298#M405287</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-03-19T13:20:37Z</dc:date>
    </item>
  </channel>
</rss>

