<?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: single click on tree control navigation in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/single-click-on-tree-control-navigation/m-p/4851534#M1134609</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have used example report SIMPLE_TREE_CONTROL_DEMOI01 to create my tree control navigation.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Where do I have to use the HOTSPOT?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
TYPES: node_table_type LIKE STANDARD TABLE OF ztreenode
       WITH DEFAULT KEY.

CONSTANTS:
BEGIN OF c_nodekey,
 root   TYPE tv_nodekey VALUE 'Root',
 child1 TYPE tv_nodekey VALUE 'Child1',
 child2 TYPE tv_nodekey VALUE 'Child2',
 new1   TYPE tv_nodekey VALUE 'New1',
 new2   TYPE tv_nodekey VALUE 'New2',
 new3   TYPE tv_nodekey VALUE 'New3',
 new4   TYPE tv_nodekey VALUE 'New4',
END OF c_nodekey.

DATA: node_table TYPE node_table_type,
      events TYPE cntl_simple_events,
      event TYPE cntl_simple_event,
      g_tree TYPE REF TO cl_gui_simple_tree.

DATA: g_custom_container TYPE REF TO cl_gui_custom_container,
      g_ok_code TYPE sy-ucomm.

DATA: node       LIKE ztreenode,
      g_node_key TYPE tv_nodekey.


DATA: g_event(30).


CLASS lcl_event_tree DEFINITION DEFERRED.


CLASS lcl_event_tree DEFINITION.

  PUBLIC SECTION.
    CLASS-METHODS:

      handle_expand_no_children
                          FOR EVENT expand_no_children
                          OF cl_gui_simple_tree
                          IMPORTING node_key.

ENDCLASS.                    "lcl_event_tree DEFINITION

CLASS lcl_event_tree IMPLEMENTATION.

  METHOD handle_expand_no_children.

    DATA: node_table TYPE node_table_type,
          node TYPE ztreenode.

    g_event = 'EXPAND_NO_CHILDREN'.
    g_node_key = node_key.

    IF node_key = 'Child1'.

* Node with key 'New1'
      CLEAR node.
      node-node_key = c_nodekey-new1.
      node-relatkey = c_nodekey-child1.
      node-relatship = cl_gui_simple_tree=&amp;gt;relat_last_child.
*      node-isfolder = ' '.
      node-n_image = '@00@'.
      node-text = text-001.
      APPEND node TO node_table.
      CALL METHOD g_tree-&amp;gt;add_nodes
        EXPORTING
          table_structure_name           = 'ZTREENODE'
          node_table                     = node_table
        EXCEPTIONS
          failed                         = 1
          error_in_node_table            = 2
          dp_error                       = 3
          table_structure_name_not_found = 4
          OTHERS                         = 5.
      IF sy-subrc &amp;lt;&amp;gt; 0.

      ENDIF.
    ENDIF.
  ENDMETHOD.                    "handle_expand_no_children

ENDCLASS.                   "lcl_event_tree IMPLEMENTATION
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PBO&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
* create a container for the tree control
  CREATE OBJECT g_custom_container
    EXPORTING      " the container is linked to the custom control with the
          " name 'TREE_CONTAINER' on the dynpro
      container_name              = 'CONTAINER'
    EXCEPTIONS
      cntl_error                  = 1
      cntl_system_error           = 2
      create_error                = 3
      lifetime_error              = 4
      lifetime_dynpro_dynpro_link = 5.
  IF sy-subrc &amp;lt;&amp;gt; 0.

  ENDIF.

* create a tree control
  CREATE OBJECT g_tree
    EXPORTING
      parent                      = container_1_2
      node_selection_mode         = cl_gui_simple_tree=&amp;gt;node_sel_mode_single
    EXCEPTIONS
      lifetime_error              = 1
      cntl_system_error           = 2
      create_error                = 3
      failed                      = 4
      illegal_node_selection_mode = 5.
  IF sy-subrc &amp;lt;&amp;gt; 0.

  ENDIF.

***********************************************
  " expand no children
  event-eventid = cl_gui_simple_tree=&amp;gt;eventid_expand_no_children.
  event-appl_event = 'X'.
  APPEND event TO events.

  CALL METHOD g_tree-&amp;gt;set_registered_events
    EXPORTING
      events                    = events
    EXCEPTIONS
      cntl_error                = 1
      cntl_system_error         = 2
      illegal_event_combination = 3.
  IF sy-subrc &amp;lt;&amp;gt; 0.
*    MESSAGE A000.
  ENDIF.
************************************************

  SET HANDLER lcl_event_tree=&amp;gt;handle_expand_no_children FOR g_tree.


  PERFORM build_node_table USING node_table.

  CALL METHOD g_tree-&amp;gt;add_nodes
    EXPORTING
      table_structure_name           = 'ZTREENODE'
      node_table                     = node_table
    EXCEPTIONS
      failed                         = 1
      error_in_node_table            = 2
      dp_error                       = 3
      table_structure_name_not_found = 4
      OTHERS                         = 5.
  IF sy-subrc &amp;lt;&amp;gt; 0.

  ENDIF.

ENDFORM.                    " ADD_TREE
*&amp;amp;---------------------------------------------------------------------*
*&amp;amp;      Form  BUILD_NODE_TABLE
*&amp;amp;---------------------------------------------------------------------*
FORM build_node_table
  USING
    node_table TYPE node_table_type.

* Build the node table.

* Caution: The nodes are inserted into the tree according to the order
* in which they occur in the table. In consequence, a node must not
* occur in the node table before its parent node.

* Node with key 'Root'
  node-node_key = c_nodekey-root.
  " Key of the node
  CLEAR node-relatkey.      " Special case: A root node has no parent
  CLEAR node-relatship.     " node.

  node-hidden = ' '.        " The node is visible,
  node-disabled = ' '.      " selectable,
  node-isfolder = 'X'.      " a folder.
  CLEAR node-n_image.       " Folder-/ Leaf-Symbol in state "closed":
  " use default.
  CLEAR node-exp_image.     " Folder-/ Leaf-Symbol in state "open":
  " use default
  CLEAR node-expander.      " see below.
  node-text = 'TEST'(roo).
  APPEND node TO node_table.


* Node with key 'Child1'
  node-node_key = c_nodekey-child1.
  " Key of the node
  " Node is inserted as child of the node with key 'Root'.
  node-relatkey = c_nodekey-root.
  node-relatship = cl_gui_simple_tree=&amp;gt;relat_last_child.

  node-hidden = ' '.
  node-disabled = ' '.
  node-isfolder = 'X'.
  CLEAR node-n_image.
  CLEAR node-exp_image.
  node-expander = 'X'. " The node is marked with a '+', although
  " it has no children. When the user clicks on the
  " + to open the node, the event
  " expand_no_children is fired. The programmer can
  " add the children of the
  " node within the event handler of the
  " expand_no_children event
  " (see method handle_expand_no_children
  " of class lcl_application)

  node-text = 'DISPLAY'.
*  node-style = cl_gui_simple_tree=&amp;gt;style_emphasized_positive.

  APPEND node TO node_table.

ENDFORM.                    " BUILD_NODE_TABLE
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 26 Nov 2008 11:21:09 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2008-11-26T11:21:09Z</dc:date>
    <item>
      <title>single click on tree control navigation</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/single-click-on-tree-control-navigation/m-p/4851532#M1134607</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello I have a tree control where I have include the navigation, I know that there is a method &lt;/P&gt;&lt;P&gt;HANDLE_NODE_DOUBLE_CLICK FOR G_TREE&lt;/P&gt;&lt;P&gt;but is there an method for only one click, I want to change my alv grid data when I click on several nodes in my tree control&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 26 Nov 2008 11:07:10 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/single-click-on-tree-control-navigation/m-p/4851532#M1134607</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-11-26T11:07:10Z</dc:date>
    </item>
    <item>
      <title>Re: single click on tree control navigation</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/single-click-on-tree-control-navigation/m-p/4851533#M1134608</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;PRE&gt;&lt;CODE&gt;Use HOT SPOT for single click

it_fieldcat-hotspot = 'X'.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Ranga&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 26 Nov 2008 11:15:37 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/single-click-on-tree-control-navigation/m-p/4851533#M1134608</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-11-26T11:15:37Z</dc:date>
    </item>
    <item>
      <title>Re: single click on tree control navigation</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/single-click-on-tree-control-navigation/m-p/4851534#M1134609</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have used example report SIMPLE_TREE_CONTROL_DEMOI01 to create my tree control navigation.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Where do I have to use the HOTSPOT?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
TYPES: node_table_type LIKE STANDARD TABLE OF ztreenode
       WITH DEFAULT KEY.

CONSTANTS:
BEGIN OF c_nodekey,
 root   TYPE tv_nodekey VALUE 'Root',
 child1 TYPE tv_nodekey VALUE 'Child1',
 child2 TYPE tv_nodekey VALUE 'Child2',
 new1   TYPE tv_nodekey VALUE 'New1',
 new2   TYPE tv_nodekey VALUE 'New2',
 new3   TYPE tv_nodekey VALUE 'New3',
 new4   TYPE tv_nodekey VALUE 'New4',
END OF c_nodekey.

DATA: node_table TYPE node_table_type,
      events TYPE cntl_simple_events,
      event TYPE cntl_simple_event,
      g_tree TYPE REF TO cl_gui_simple_tree.

DATA: g_custom_container TYPE REF TO cl_gui_custom_container,
      g_ok_code TYPE sy-ucomm.

DATA: node       LIKE ztreenode,
      g_node_key TYPE tv_nodekey.


DATA: g_event(30).


CLASS lcl_event_tree DEFINITION DEFERRED.


CLASS lcl_event_tree DEFINITION.

  PUBLIC SECTION.
    CLASS-METHODS:

      handle_expand_no_children
                          FOR EVENT expand_no_children
                          OF cl_gui_simple_tree
                          IMPORTING node_key.

ENDCLASS.                    "lcl_event_tree DEFINITION

CLASS lcl_event_tree IMPLEMENTATION.

  METHOD handle_expand_no_children.

    DATA: node_table TYPE node_table_type,
          node TYPE ztreenode.

    g_event = 'EXPAND_NO_CHILDREN'.
    g_node_key = node_key.

    IF node_key = 'Child1'.

* Node with key 'New1'
      CLEAR node.
      node-node_key = c_nodekey-new1.
      node-relatkey = c_nodekey-child1.
      node-relatship = cl_gui_simple_tree=&amp;gt;relat_last_child.
*      node-isfolder = ' '.
      node-n_image = '@00@'.
      node-text = text-001.
      APPEND node TO node_table.
      CALL METHOD g_tree-&amp;gt;add_nodes
        EXPORTING
          table_structure_name           = 'ZTREENODE'
          node_table                     = node_table
        EXCEPTIONS
          failed                         = 1
          error_in_node_table            = 2
          dp_error                       = 3
          table_structure_name_not_found = 4
          OTHERS                         = 5.
      IF sy-subrc &amp;lt;&amp;gt; 0.

      ENDIF.
    ENDIF.
  ENDMETHOD.                    "handle_expand_no_children

ENDCLASS.                   "lcl_event_tree IMPLEMENTATION
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PBO&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
* create a container for the tree control
  CREATE OBJECT g_custom_container
    EXPORTING      " the container is linked to the custom control with the
          " name 'TREE_CONTAINER' on the dynpro
      container_name              = 'CONTAINER'
    EXCEPTIONS
      cntl_error                  = 1
      cntl_system_error           = 2
      create_error                = 3
      lifetime_error              = 4
      lifetime_dynpro_dynpro_link = 5.
  IF sy-subrc &amp;lt;&amp;gt; 0.

  ENDIF.

* create a tree control
  CREATE OBJECT g_tree
    EXPORTING
      parent                      = container_1_2
      node_selection_mode         = cl_gui_simple_tree=&amp;gt;node_sel_mode_single
    EXCEPTIONS
      lifetime_error              = 1
      cntl_system_error           = 2
      create_error                = 3
      failed                      = 4
      illegal_node_selection_mode = 5.
  IF sy-subrc &amp;lt;&amp;gt; 0.

  ENDIF.

***********************************************
  " expand no children
  event-eventid = cl_gui_simple_tree=&amp;gt;eventid_expand_no_children.
  event-appl_event = 'X'.
  APPEND event TO events.

  CALL METHOD g_tree-&amp;gt;set_registered_events
    EXPORTING
      events                    = events
    EXCEPTIONS
      cntl_error                = 1
      cntl_system_error         = 2
      illegal_event_combination = 3.
  IF sy-subrc &amp;lt;&amp;gt; 0.
*    MESSAGE A000.
  ENDIF.
************************************************

  SET HANDLER lcl_event_tree=&amp;gt;handle_expand_no_children FOR g_tree.


  PERFORM build_node_table USING node_table.

  CALL METHOD g_tree-&amp;gt;add_nodes
    EXPORTING
      table_structure_name           = 'ZTREENODE'
      node_table                     = node_table
    EXCEPTIONS
      failed                         = 1
      error_in_node_table            = 2
      dp_error                       = 3
      table_structure_name_not_found = 4
      OTHERS                         = 5.
  IF sy-subrc &amp;lt;&amp;gt; 0.

  ENDIF.

ENDFORM.                    " ADD_TREE
*&amp;amp;---------------------------------------------------------------------*
*&amp;amp;      Form  BUILD_NODE_TABLE
*&amp;amp;---------------------------------------------------------------------*
FORM build_node_table
  USING
    node_table TYPE node_table_type.

* Build the node table.

* Caution: The nodes are inserted into the tree according to the order
* in which they occur in the table. In consequence, a node must not
* occur in the node table before its parent node.

* Node with key 'Root'
  node-node_key = c_nodekey-root.
  " Key of the node
  CLEAR node-relatkey.      " Special case: A root node has no parent
  CLEAR node-relatship.     " node.

  node-hidden = ' '.        " The node is visible,
  node-disabled = ' '.      " selectable,
  node-isfolder = 'X'.      " a folder.
  CLEAR node-n_image.       " Folder-/ Leaf-Symbol in state "closed":
  " use default.
  CLEAR node-exp_image.     " Folder-/ Leaf-Symbol in state "open":
  " use default
  CLEAR node-expander.      " see below.
  node-text = 'TEST'(roo).
  APPEND node TO node_table.


* Node with key 'Child1'
  node-node_key = c_nodekey-child1.
  " Key of the node
  " Node is inserted as child of the node with key 'Root'.
  node-relatkey = c_nodekey-root.
  node-relatship = cl_gui_simple_tree=&amp;gt;relat_last_child.

  node-hidden = ' '.
  node-disabled = ' '.
  node-isfolder = 'X'.
  CLEAR node-n_image.
  CLEAR node-exp_image.
  node-expander = 'X'. " The node is marked with a '+', although
  " it has no children. When the user clicks on the
  " + to open the node, the event
  " expand_no_children is fired. The programmer can
  " add the children of the
  " node within the event handler of the
  " expand_no_children event
  " (see method handle_expand_no_children
  " of class lcl_application)

  node-text = 'DISPLAY'.
*  node-style = cl_gui_simple_tree=&amp;gt;style_emphasized_positive.

  APPEND node TO node_table.

ENDFORM.                    " BUILD_NODE_TABLE
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 26 Nov 2008 11:21:09 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/single-click-on-tree-control-navigation/m-p/4851534#M1134609</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-11-26T11:21:09Z</dc:date>
    </item>
    <item>
      <title>Re: single click on tree control navigation</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/single-click-on-tree-control-navigation/m-p/4851535#M1134610</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;for Single click use this &lt;STRONG&gt;handle_link_click for g_tree&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;event-eventid = cl_gui_column_tree=&amp;gt;eventid_link_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;&lt;/P&gt;&lt;P&gt;set handler g_application-&amp;gt;handle_link_click for g_tree.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and write the logic in the method handle_link_click&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Ranga&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 26 Nov 2008 11:38:32 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/single-click-on-tree-control-navigation/m-p/4851535#M1134610</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-11-26T11:38:32Z</dc:date>
    </item>
    <item>
      <title>Re: single click on tree control navigation</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/single-click-on-tree-control-navigation/m-p/4851536#M1134611</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I dont use cl_gui_column_tree I am using CL_GUI_SIMPLE_TREE.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is there another alternative? &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Actually I use the method &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;      handle_node_double_click&lt;/P&gt;&lt;P&gt;                           FOR EVENT node_double_click&lt;/P&gt;&lt;P&gt;                           OF cl_gui_simple_tree&lt;/P&gt;&lt;P&gt;                           IMPORTING node_key,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This method is running, the only issue is that it dont refresh my alv table when I double click on the tree control item, when I start the debugger the event starts and my table of the alv is also refreshed, but not the display of the alv , why?I dont understand &lt;SPAN __jive_emoticon_name="sad"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 26 Nov 2008 14:41:33 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/single-click-on-tree-control-navigation/m-p/4851536#M1134611</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-11-26T14:41:33Z</dc:date>
    </item>
    <item>
      <title>Re: single click on tree control navigation</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/single-click-on-tree-control-navigation/m-p/4851537#M1134612</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Muhammet&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;There is a specific event available for this purpose: &lt;STRONG&gt;SELECTION_CHANGED&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The SAP standard report RSEIDOC2 uses a different control (CL_GUI_COLUMN_TREE) but the logic is the same (see include RSEIDOC_TREE_CL):&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
***INCLUDE CLASS_TREE .
*===============================================================
* Klasse für die Eventbehandlung TREE
CLASS vh_event_class DEFINITION.
  PUBLIC SECTION.
   METHODS:
     handle_selection_changed
       for event selection_changed
       of cl_gui_column_tree
       importing node_key.
ENDCLASS.
*----------------------------------------------------------------------*
CLASS vh_event_class IMPLEMENTATION.
*----------------------------------------------------------------------*
*----------------------------------------------------------------------*
METHOD HANDLE_SELECTION_CHANGED.
   " this method handles the node double click event of the tree
   " control instance

  g_EVENT = 'NODE_DOUBLE_CLICK'.     "#EC NOTEXT
  G_NODE_KEY = NODE_KEY.
  perform fill_new_alv_list_table.  " NOTE: Change itab for ALV output !!! us

ENDMETHOD.

*----------------------------------------------------------------------*
endclass.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Within include RSEIDOC_F01 you can see that in this case the event is registered as application event:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
form init_tree.
...
* definieren der Ereignisse
  event-eventid = cl_gui_column_tree=&amp;gt;eventid_selection_changed.
  event-appl_event = 'X'.  " process PAI if event occurs
  append event to events.

* registrieren lassen der Ereignisse, auf die ich reagieren will
  call method vh_tree-&amp;gt;set_registered_events
    exporting
      events = events
    exceptions
      cntl_error         = 1
      cntl_system_error  = 2
      illegal_event_combination = 3.
  if sy-subrc ne 0.
    message id sy-msgid type 'A' number sy-msgno
           with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
  endif.

* assign event handlers
  set handler vh_event-&amp;gt;handle_selection_changed for vh_tree.
...
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And within the PBO module PBO you can see that they alwasy call method SET_TABLE_FOR_FIRST_DISPLAY to ensure the refreshing of the ALV list output.&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;  Uwe&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 26 Nov 2008 20:31:42 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/single-click-on-tree-control-navigation/m-p/4851537#M1134612</guid>
      <dc:creator>uwe_schieferstein</dc:creator>
      <dc:date>2008-11-26T20:31:42Z</dc:date>
    </item>
    <item>
      <title>Re: single click on tree control navigation</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/single-click-on-tree-control-navigation/m-p/4851538#M1134613</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Buddy,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  Use hot spot for single click..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Tks,&lt;/P&gt;&lt;P&gt;Krishna&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 27 Nov 2008 03:32:34 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/single-click-on-tree-control-navigation/m-p/4851538#M1134613</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-11-27T03:32:34Z</dc:date>
    </item>
    <item>
      <title>Re: single click on tree control navigation</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/single-click-on-tree-control-navigation/m-p/4851539#M1134614</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Muhammet&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have re-written my sample report ZUS_SDN_TWO_ALV_GRIDS into ZUS_SDN_TREE_AND_GRID_CONTROL which is now display a tree control together with the ALV grid.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When you analyze this new report you will see that every step of the program logic is as I described in my previous e-mails.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
*&amp;amp;---------------------------------------------------------------------*
*&amp;amp; Report  ZUS_SDN_TWO_ALV_GRIDS
*&amp;amp;
*&amp;amp;---------------------------------------------------------------------*
*&amp;amp; Screen '0100' contains no elements.
*&amp;amp; ok_code -&amp;gt; assigned to GD_OKCODE
*&amp;amp;
*&amp;amp; Flow logic:
*  PROCESS BEFORE OUTPUT.
*    MODULE STATUS_0100.
**
*  PROCESS AFTER INPUT.
*    MODULE USER_COMMAND_0100.
*&amp;amp;
*&amp;amp;---------------------------------------------------------------------*
*&amp;amp; Thread: single click on tree control navigation
*&amp;amp; &amp;lt;a class="jive_macro jive_macro_thread" href="" __jive_macro_name="thread" modifiedtitle="true" __default_attr="1143770"&amp;gt;&amp;lt;/a&amp;gt;
*&amp;amp;---------------------------------------------------------------------*
REPORT  zus_sdn_tree_and_grid_control.

TYPE-POOLS: abap, cntl.

TYPES: node_table_type LIKE STANDARD TABLE OF mtreesnode
         WITH DEFAULT KEY.
* CAUTION: MTREESNODE is the name of the node structure which must
* be defined by the programmer. DO NOT USE MTREESNODE!

CONSTANTS:
  BEGIN OF c_nodekey,
    root   TYPE tv_nodekey VALUE 'Root',                    "#EC NOTEXT
    child1 TYPE tv_nodekey VALUE 'Child1',                  "#EC NOTEXT
*    child2 type tv_nodekey value 'Child2',                  "#EC NOTEXT
    new1   TYPE tv_nodekey VALUE 'New1',                    "#EC NOTEXT
    new2   TYPE tv_nodekey VALUE 'New2',                    "#EC NOTEXT
*    new3   type tv_nodekey value 'New3',                    "#EC NOTEXT
*    new4   type tv_nodekey value 'New4',                    "#EC NOTEXT
  END OF c_nodekey.


DATA:
  gd_okcode        TYPE ui_func,
  gd_repid         TYPE syst-repid,
*
  go_docking       TYPE REF TO cl_gui_docking_container,
  go_splitter      TYPE REF TO cl_gui_splitter_container,
  go_cell_left     TYPE REF TO cl_gui_container,
  go_cell_right    TYPE REF TO cl_gui_container,
  go_tree          TYPE REF TO cl_gui_simple_tree,
  go_grid1         TYPE REF TO cl_gui_alv_grid,
**  go_grid2         TYPE REF TO cl_gui_alv_grid,
  gs_layout        TYPE lvc_s_layo.


DATA:
  gt_knb1          TYPE STANDARD TABLE OF knb1,
  gt_knvv          TYPE STANDARD TABLE OF knvv.





*---------------------------------------------------------------------*
*       CLASS lcl_eventhandler DEFINITION
*---------------------------------------------------------------------*
*
*---------------------------------------------------------------------*
CLASS lcl_eventhandler DEFINITION.

  PUBLIC SECTION.
    CLASS-METHODS:
      handle_double_click FOR EVENT double_click OF cl_gui_alv_grid
        IMPORTING
          e_row
          e_column
          es_row_no
          sender.


ENDCLASS.                    "lcl_eventhandler DEFINITION



*---------------------------------------------------------------------*
*       CLASS lcl_eventhandler IMPLEMENTATION
*---------------------------------------------------------------------*
*
*---------------------------------------------------------------------*
CLASS lcl_eventhandler IMPLEMENTATION.

  METHOD handle_double_click.
*   define local data
    DATA:
      ls_knb1      TYPE knb1.

    CHECK ( sender = go_grid1 ).

    READ TABLE gt_knb1 INTO ls_knb1 INDEX e_row-index.
    CHECK ( ls_knb1-kunnr IS NOT INITIAL ).

**    CALL METHOD go_grid1-&amp;gt;set_current_cell_via_id
**      EXPORTING
***        IS_ROW_ID    =
***        IS_COLUMN_ID =
**        is_row_no    = es_row_no.


*   Triggers PAI of the dynpro with the specified ok-code
    CALL METHOD cl_gui_cfw=&amp;gt;set_new_ok_code( 'DETAIL' ).



  ENDMETHOD.                    "handle_double_click

ENDCLASS.                    "lcl_eventhandler IMPLEMENTATION



*----------------------------------------------------------------------*
*       CLASS LCL_APPLICATION DEFINITION
*----------------------------------------------------------------------*
*
*----------------------------------------------------------------------*
CLASS lcl_application DEFINITION.

  PUBLIC SECTION.
    CLASS-DATA:
      md_event       TYPE string     READ-ONLY,
      md_node_key    TYPE tv_nodekey READ-ONLY.

    CLASS-METHODS:
      handle_node_double_click
        FOR EVENT node_double_click
        OF cl_gui_simple_tree
        IMPORTING node_key,
      handle_expand_no_children
        FOR EVENT expand_no_children
        OF cl_gui_simple_tree
        IMPORTING node_key.
ENDCLASS.                    "LCL_APPLICATION DEFINITION


*----------------------------------------------------------------------*
*       CLASS LCL_APPLICATION IMPLEMENTATION
*----------------------------------------------------------------------*
*
*----------------------------------------------------------------------*
CLASS lcl_application IMPLEMENTATION.

  METHOD  handle_node_double_click.
    " this method handles the node double click event of the tree
    " control instance

    " show the key of the double clicked node in a dynpro field
    md_event = 'NODE_DOUBLE_CLICK'.
    md_node_key = node_key.

    " Trigger PAI and set ok-code = 'DETAIL'
    CALL METHOD cl_gui_cfw=&amp;gt;set_new_ok_code
      EXPORTING
        new_code = 'DETAIL'
*      IMPORTING
*        rc       =
        .

    MESSAGE md_node_key TYPE 'I'.

  ENDMETHOD.                    "HANDLE_NODE_DOUBLE_CLICK

  METHOD handle_expand_no_children.
    " this method handles the expand no children event of the tree
    " control instance
    DATA: node_table TYPE node_table_type,
          node TYPE mtreesnode.

    " show the key of the double clicked node in a dynpro field
    md_event = 'EXPAND_NO_CHILDREN'.
    md_node_key = node_key.

    IF node_key = 'Child1'.
* add two nodes to the tree control (the children of 'Child1')

* Node with key 'New1'
      CLEAR node.
      node-node_key = c_nodekey-new1.
      node-relatkey = c_nodekey-child1.
      node-relatship = cl_gui_simple_tree=&amp;gt;relat_last_child.
      node-isfolder = ' '.
      node-text = 'New1'(ne1).
      APPEND node TO node_table.

* Node with key 'New2'
      CLEAR node.
      node-node_key = c_nodekey-new2.
      node-relatkey = c_nodekey-child1.
      node-relatship = cl_gui_simple_tree=&amp;gt;relat_last_child.
      node-n_image = '@10@'.
      node-expander = ' '.
      node-text = 'New2'(ne2).
      APPEND node TO node_table.

      CALL METHOD go_tree-&amp;gt;add_nodes
        EXPORTING
          table_structure_name           = 'MTREESNODE'
          node_table                     = node_table
        EXCEPTIONS
          failed                         = 1
          error_in_node_table            = 2
          dp_error                       = 3
          table_structure_name_not_found = 4
          OTHERS                         = 5.
      IF sy-subrc &amp;lt;&amp;gt; 0.
**        MESSAGE A000.
      ENDIF.
    ENDIF.
  ENDMETHOD.                    "HANDLE_EXPAND_NO_CHILDREN

ENDCLASS.                    "LCL_APPLICATION IMPLEMENTATION



START-OF-SELECTION.

  SELECT        * FROM  knb1 INTO TABLE gt_knb1 UP TO 100 ROWS
         WHERE  bukrs  = '1000'.


  PERFORM init_controls.



* Display data
  gs_layout-grid_title = 'Customers: Sales Areas'.
  CALL METHOD go_grid1-&amp;gt;set_table_for_first_display
    EXPORTING
      i_structure_name = 'KNVV'
      is_layout        = gs_layout
    CHANGING
      it_outtab        = gt_knvv
    EXCEPTIONS
      OTHERS           = 4.
  IF sy-subrc &amp;lt;&amp;gt; 0.
*   MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
*              WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
  ENDIF.




* Link the docking container to the target dynpro
  gd_repid = syst-repid.
  CALL METHOD go_docking-&amp;gt;link
    EXPORTING
      repid                       = gd_repid
      dynnr                       = '0100'
*      CONTAINER                   =
    EXCEPTIONS
      OTHERS                      = 4.
  IF sy-subrc &amp;lt;&amp;gt; 0.
*   MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
*              WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
  ENDIF.


* NOTE: dynpro does not contain any elements
  CALL SCREEN '0100'.
* Flow logic of dynpro (does not contain any dynpro elements):
*
*PROCESS BEFORE OUTPUT.
*  MODULE STATUS_0100.
**
*PROCESS AFTER INPUT.
*  MODULE USER_COMMAND_0100.



END-OF-SELECTION.

*&amp;amp;---------------------------------------------------------------------*
*&amp;amp;      Module  STATUS_0100  OUTPUT
*&amp;amp;---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
MODULE status_0100 OUTPUT.
  SET PF-STATUS 'STATUS_0100'.  " contains push button "DETAIL"
*  SET TITLEBAR 'xxx'.


* Refresh display of detail ALV list
  CALL METHOD go_grid1-&amp;gt;refresh_table_display
*    EXPORTING
*      IS_STABLE      =
*      I_SOFT_REFRESH =
    EXCEPTIONS
      OTHERS         = 2.
  IF sy-subrc &amp;lt;&amp;gt; 0.
*   MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
*              WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
  ENDIF.


ENDMODULE.                 " STATUS_0100  OUTPUT

*&amp;amp;---------------------------------------------------------------------*
*&amp;amp;      Module  USER_COMMAND_0100  INPUT
*&amp;amp;---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
MODULE user_command_0100 INPUT.

  TRANSLATE gd_okcode TO UPPER CASE.

  CASE gd_okcode.
    WHEN 'BACK' OR
         'END'  OR
         'CANC'.
      SET SCREEN 0. LEAVE SCREEN.

*   User has pushed button "Display Details"
    WHEN 'DETAIL'.
      MESSAGE gd_okcode TYPE 'I'.
      PERFORM entry_show_details.

    WHEN OTHERS.
  ENDCASE.

  CLEAR: gd_okcode.

ENDMODULE.                 " USER_COMMAND_0100  INPUT

*&amp;amp;---------------------------------------------------------------------*
*&amp;amp;      Form  ENTRY_SHOW_DETAILS
*&amp;amp;---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
*  --&amp;gt;  p1        text
*  &amp;lt;--  p2        text
*----------------------------------------------------------------------*
FORM entry_show_details .
* define local data
  DATA:
    ld_row      TYPE i,
    ls_knb1     TYPE knb1.


  IF ( gt_knvv IS INITIAL ).
    SELECT        * FROM  knvv INTO TABLE gt_knvv
    FOR ALL ENTRIES IN gt_knb1
       WHERE  kunnr  = gt_knb1-kunnr.
  ELSE.
    REFRESH: gt_knvv.
  ENDIF.

ENDFORM.                    " ENTRY_SHOW_DETAILS



*&amp;amp;---------------------------------------------------------------------*
*&amp;amp;      Form  INIT_CONTROLS
*&amp;amp;---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
*  --&amp;gt;  p1        text
*  &amp;lt;--  p2        text
*----------------------------------------------------------------------*
FORM init_controls .

* Create docking container
  CREATE OBJECT go_docking
    EXPORTING
      parent = cl_gui_container=&amp;gt;screen0
      ratio  = 90
    EXCEPTIONS
      OTHERS = 6.
  IF sy-subrc &amp;lt;&amp;gt; 0.
*   MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
*              WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
  ENDIF.


* Create splitter container
  CREATE OBJECT go_splitter
    EXPORTING
      parent            = go_docking
      rows              = 1
      columns           = 2
*      NO_AUTODEF_PROGID_DYNNR =
*      NAME              =
    EXCEPTIONS
      cntl_error        = 1
      cntl_system_error = 2
      OTHERS            = 3.
  IF sy-subrc &amp;lt;&amp;gt; 0.
*   MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
*              WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
  ENDIF.

* Get cell container
  CALL METHOD go_splitter-&amp;gt;get_container
    EXPORTING
      row       = 1
      column    = 1
    RECEIVING
      container = go_cell_left.
  CALL METHOD go_splitter-&amp;gt;get_container
    EXPORTING
      row       = 1
      column    = 2
    RECEIVING
      container = go_cell_right.

* Create ALV grids
  CREATE OBJECT go_grid1
    EXPORTING
      i_parent = go_cell_right
    EXCEPTIONS
      OTHERS   = 5.
  IF sy-subrc &amp;lt;&amp;gt; 0.
*   MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
*              WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
  ENDIF.

* Set event handler
  SET HANDLER:
    lcl_eventhandler=&amp;gt;handle_double_click FOR go_grid1.

  PERFORM create_and_init_tree.

ENDFORM.                    " INIT_CONTROLS


*&amp;amp;---------------------------------------------------------------------*
*&amp;amp;      Form  CREATE_AND_INIT_TREE
*&amp;amp;---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
*  --&amp;gt;  p1        text
*  &amp;lt;--  p2        text
*----------------------------------------------------------------------*
FORM create_and_init_tree .
  DATA: lt_node_table TYPE node_table_type,
        lt_events TYPE cntl_simple_events,
        ls_event TYPE cntl_simple_event.

* create a tree control
  CREATE OBJECT go_tree
    EXPORTING
      parent                      = go_cell_left
      node_selection_mode         = cl_gui_simple_tree=&amp;gt;node_sel_mode_single      " single node selection is used
    EXCEPTIONS
      lifetime_error              = 1
      cntl_system_error           = 2
      create_error                = 3
      failed                      = 4
      illegal_node_selection_mode = 5.
  IF sy-subrc &amp;lt;&amp;gt; 0.
**    MESSAGE a000.
  ENDIF.


* define the events which will be passed to the backend
  " node double click
  ls_event-eventid = cl_gui_simple_tree=&amp;gt;eventid_node_double_click.
**  ls_event-appl_event = 'X'. " process PAI if event occurs
  " NOTE: Do NOT register as application event !!!!!
  APPEND ls_event TO lt_events.


  CALL METHOD go_tree-&amp;gt;set_registered_events
    EXPORTING
      events                    = lt_events
    EXCEPTIONS
      cntl_error                = 1
      cntl_system_error         = 2
      illegal_event_combination = 3.
  IF sy-subrc &amp;lt;&amp;gt; 0.
**    MESSAGE a000.
  ENDIF.

  SET HANDLER:
    lcl_application=&amp;gt;handle_node_double_click   FOR go_tree,
    lcl_application=&amp;gt;handle_expand_no_children  FOR go_tree.


* add some nodes to the tree control
* NOTE: the tree control does not store data at the backend. If an
* application wants to access tree data later, it must store the
* tree data itself.

  PERFORM build_node_table USING lt_node_table.

* node_table_structure_name     = 'MTREESNODE'
*   A programmer using the tree control must create a structure in the
*   dictionary. This structure must include the structure TREEV_NODE
*   and must contain a character field with the name 'TEXT'.

  CALL METHOD go_tree-&amp;gt;add_nodes
    EXPORTING
      table_structure_name           = 'MTREESNODE'
      node_table                     = lt_node_table
    EXCEPTIONS
      failed                         = 1
      error_in_node_table            = 2
      dp_error                       = 3
      table_structure_name_not_found = 4
      OTHERS                         = 5.
  IF sy-subrc &amp;lt;&amp;gt; 0.
**    MESSAGE a000.
  ENDIF.

ENDFORM.                    " CREATE_AND_INIT_TREE


*&amp;amp;---------------------------------------------------------------------*
*&amp;amp;      Form  build_node_table
*&amp;amp;---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
*  --&amp;gt;  p1        text
*  &amp;lt;--  p2        text
*----------------------------------------------------------------------*

FORM build_node_table
  USING
    node_table TYPE node_table_type.

  DATA: node LIKE mtreesnode.

* Build the node table.

* Caution: The nodes are inserted into the tree according to the order
* in which they occur in the table. In consequence, a node must not
* occur in the node table before its parent node.

* Node with key 'Root'
  node-node_key = c_nodekey-root.
  " Key of the node
  CLEAR node-relatkey.      " Special case: A root node has no parent
  CLEAR node-relatship.     " node.

  node-hidden = ' '.        " The node is visible,
  node-disabled = ' '.      " selectable,
  node-isfolder = 'X'.      " a folder.
  CLEAR node-n_image.       " Folder-/ Leaf-Symbol in state "closed":
  " use default.
  CLEAR node-exp_image.     " Folder-/ Leaf-Symbol in state "open":
  " use default
  CLEAR node-expander.      " see below.
  node-text = 'Root'(roo).
  APPEND node TO node_table.

* Node with key 'Child1'
  node-node_key = c_nodekey-child1.
  " Key of the node
  " Node is inserted as child of the node with key 'Root'.
  node-relatkey = c_nodekey-root.
  node-relatship = cl_gui_simple_tree=&amp;gt;relat_last_child.

  node-hidden = ' '.
  node-disabled = ' '.
  node-isfolder = 'X'.
  CLEAR node-n_image.
  CLEAR node-exp_image.
  node-expander = 'X'. " The node is marked with a '+', although
  " it has no children. When the user clicks on the
  " + to open the node, the event
  " expand_no_children is fired. The programmer can
  " add the children of the
  " node within the event handler of the
  " expand_no_children event
  " (see method handle_expand_no_children
  " of class lcl_application)

  node-text = 'Child1'(ch1).
  node-style = cl_gui_simple_tree=&amp;gt;style_emphasized_positive.
  APPEND node TO node_table.

ENDFORM.                    " build_node_table
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;  Uwe&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 27 Nov 2008 16:57:47 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/single-click-on-tree-control-navigation/m-p/4851539#M1134614</guid>
      <dc:creator>uwe_schieferstein</dc:creator>
      <dc:date>2008-11-27T16:57:47Z</dc:date>
    </item>
    <item>
      <title>Re: single click on tree control navigation</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/single-click-on-tree-control-navigation/m-p/4851540#M1134615</link>
      <description>&lt;P&gt;For CL_GUI_ALV_TREE set also these two attributes:&lt;BR /&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;    CREATE OBJECT gr_alv_tree
      EXPORTING

        ....
        node_selection_mode         = cl_tree_control_base=&amp;gt;node_sel_mode_single
        item_selection              = abap_false&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sat, 15 Jan 2022 10:19:13 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/single-click-on-tree-control-navigation/m-p/4851540#M1134615</guid>
      <dc:creator>former_member788947</dc:creator>
      <dc:date>2022-01-15T10:19:13Z</dc:date>
    </item>
  </channel>
</rss>

