<?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: ALV Tree - Event Handler in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/alv-tree-event-handler/m-p/1724246#M315863</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;One of the parameters of the event double click is the node_key (IMPORTING node_key), so i guess you should be able to read the data and figure what row has been clicked, right?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Using that you should be able to navigate to IL03.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Ravi&lt;/P&gt;&lt;P&gt;Note - Please mark all the helpful answers&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sun, 19 Nov 2006 09:35:20 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2006-11-19T09:35:20Z</dc:date>
    <item>
      <title>ALV Tree - Event Handler</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/alv-tree-event-handler/m-p/1724245#M315862</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I amd currently developing an ALV tree program to capture the hierarchy of functional location. I managed to display the hierarchy in ALV Tree using cl_gui_column_tree. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now, i am working on double clicking the functional location and it will bring me to tcode IL03. But, it seems like i cannot capture of the field value clicked. Below are my source code.  Can anyone pls help me on this? Thank you very much&lt;/P&gt;&lt;P&gt;&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  register_events&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;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt; --&amp;gt;  p1        text&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt; &amp;lt;--  p2        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 register_events .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Define the events which will be passed to the backend&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  DATA: lt_events TYPE cntl_simple_events,&lt;/P&gt;&lt;P&gt;        l_event TYPE cntl_simple_event.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  CALL METHOD gd_tree-&amp;gt;get_registered_events&lt;/P&gt;&lt;P&gt;    IMPORTING&lt;/P&gt;&lt;P&gt;      events = lt_events.&lt;/P&gt;&lt;P&gt;  l_event-eventid = cl_gui_column_tree=&amp;gt;eventid_item_double_click.&lt;/P&gt;&lt;P&gt;  l_event-appl_event = 'X'.&lt;/P&gt;&lt;P&gt;  APPEND l_event TO lt_events.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  CALL METHOD gd_tree-&amp;gt;set_registered_events&lt;/P&gt;&lt;P&gt;    EXPORTING&lt;/P&gt;&lt;P&gt;      events                    = lt_events&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;      illegal_event_combination = 3.&lt;/P&gt;&lt;P&gt;  IF sy-subrc &amp;lt;&amp;gt; 0.&lt;/P&gt;&lt;P&gt;    MESSAGE x208(00) WITH 'ERROR'.&lt;/P&gt;&lt;P&gt;  ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Set Handler&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  DATA: l_event_receiver TYPE REF TO lcl_tree_event_receiver.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  CREATE OBJECT l_event_receiver.&lt;/P&gt;&lt;P&gt;  SET HANDLER l_event_receiver-&amp;gt;handle_item_double_click FOR gd_tree.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ENDFORM.                    " register_events&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CLASS lcl_tree_event_receiver DEFINITION.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  PUBLIC SECTION.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    METHODS handle_item_double_click&lt;/P&gt;&lt;P&gt;      FOR EVENT item_double_click OF cl_gui_alv_tree&lt;/P&gt;&lt;P&gt;      IMPORTING node_key&lt;/P&gt;&lt;P&gt;                fieldname.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ENDCLASS.                    "lcl_tree_event_receiver DEFINITION&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CLASS lcl_tree_event_receiver IMPLEMENTATION.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  METHOD handle_item_double_click.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    DATA: lt_selected_nodes TYPE lvc_nkey,&lt;/P&gt;&lt;P&gt;          lt_fieldname      TYPE lvc_fname.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Determine which line is selected&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;    CALL METHOD gd_tree-&amp;gt;get_selected_item&lt;/P&gt;&lt;P&gt;      IMPORTING&lt;/P&gt;&lt;P&gt;        e_selected_node = lt_selected_nodes&lt;/P&gt;&lt;P&gt;        e_fieldname     = lt_fieldname.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    CALL METHOD cl_gui_cfw=&amp;gt;flush.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    SET PARAMETER ID 'IFL' FIELD lt_fieldname.&lt;/P&gt;&lt;P&gt;    SET PARAMETER ID 'ISR' FIELD 'MOB01'.&lt;/P&gt;&lt;P&gt;    CALL TRANSACTION 'IL03' AND SKIP FIRST SCREEN.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  ENDMETHOD.                    "handle_item_double_click&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ENDCLASS.                    "lcl_tree_event_receiver IMPLEMENTATION&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 19 Nov 2006 08:55:53 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/alv-tree-event-handler/m-p/1724245#M315862</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-11-19T08:55:53Z</dc:date>
    </item>
    <item>
      <title>Re: ALV Tree - Event Handler</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/alv-tree-event-handler/m-p/1724246#M315863</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;One of the parameters of the event double click is the node_key (IMPORTING node_key), so i guess you should be able to read the data and figure what row has been clicked, right?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Using that you should be able to navigate to IL03.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Ravi&lt;/P&gt;&lt;P&gt;Note - Please mark all the helpful answers&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 19 Nov 2006 09:35:20 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/alv-tree-event-handler/m-p/1724246#M315863</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-11-19T09:35:20Z</dc:date>
    </item>
    <item>
      <title>Re: ALV Tree - Event Handler</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/alv-tree-event-handler/m-p/1724247#M315864</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Goh&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Based on your coding you are using CL_GUI_ALV_TREE instead of CL_GUI_COLUMN_TREE.&lt;/P&gt;&lt;P&gt;Calling method get_selected_item within your event handler method is unnecessary because these data are already provided by the event interface.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;[code]METHOD handle_item_double_click.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA: lt_selected_nodes TYPE lvc_nkey,&lt;/P&gt;&lt;P&gt;lt_fieldname TYPE lvc_fname.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*$Comment: unnecessary because these data are already provided&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt; by the event interface (IMPORTING nodekey fieldname).&lt;/P&gt;&lt;/LI&gt;&lt;UL&gt;&lt;UL&gt;&lt;LI level="3" type="ul"&gt;&lt;P&gt;Determine which line is selected&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;P&gt;**CALL METHOD gd_tree-&amp;gt;get_selected_item&lt;/P&gt;&lt;P&gt;**IMPORTING&lt;/P&gt;&lt;P&gt;**e_selected_node = lt_selected_nodes&lt;/P&gt;&lt;P&gt;**e_fieldname = lt_fieldname.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ENDMETHOD. "handle_item_double_click[/code]&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The following sample is based in report BCALV_TREE_04 but can be simply applied to your application:&lt;/P&gt;&lt;P&gt;[code]  METHOD handle_item_double_click.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  define local data&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;    DATA:&lt;/P&gt;&lt;P&gt;      ls_outtab     TYPE sflight.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    FIELD-SYMBOLS:&lt;/P&gt;&lt;P&gt;      &amp;lt;ld_fld&amp;gt;      TYPE ANY.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  Call this method to get the values of the selected tree line&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;    CALL METHOD g_alv_tree-&amp;gt;get_outtab_line&lt;/P&gt;&lt;P&gt;      EXPORTING&lt;/P&gt;&lt;P&gt;        i_node_key     = node_key&lt;/P&gt;&lt;P&gt;      IMPORTING&lt;/P&gt;&lt;P&gt;        e_outtab_line  = ls_outtab&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;       E_NODE_TEXT    =&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;       et_item_layout =&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;       ES_NODE_LAYOUT =&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;      EXCEPTIONS&lt;/P&gt;&lt;P&gt;        node_not_found = 1&lt;/P&gt;&lt;P&gt;        OTHERS         = 2.&lt;/P&gt;&lt;P&gt;    IF sy-subrc &amp;lt;&amp;gt; 0.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;               WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;    ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    ASSIGN COMPONENT fieldname OF STRUCTURE ls_outtab TO &amp;lt;ld_fld&amp;gt;.&lt;/P&gt;&lt;P&gt;    IF ( &amp;lt;ld_fld&amp;gt; IS ASSIGNED ).&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  ... Call transaction with selected (item) value.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;    ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  ENDMETHOD.                    "handle_item_double_click[/code]&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The ASSIGN statement will work if no item of the hierarchy part is selected.&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>Sun, 19 Nov 2006 20:44:05 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/alv-tree-event-handler/m-p/1724247#M315864</guid>
      <dc:creator>uwe_schieferstein</dc:creator>
      <dc:date>2006-11-19T20:44:05Z</dc:date>
    </item>
    <item>
      <title>Re: ALV Tree - Event Handler</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/alv-tree-event-handler/m-p/1724248#M315865</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for all your help &lt;SPAN __jive_emoticon_name="happy"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 20 Nov 2006 02:51:30 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/alv-tree-event-handler/m-p/1724248#M315865</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-11-20T02:51:30Z</dc:date>
    </item>
  </channel>
</rss>

