<?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: Event Handler for second grid in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/event-handler-for-second-grid/m-p/5168210#M1196860</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Great! Uwe. It help me to solve my problem.&lt;/P&gt;&lt;P&gt;Your solution is what I prefered, and I have tried it works.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks a lot.&lt;/P&gt;&lt;P&gt;Liang&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Liang Ji on Feb 17, 2009 9:40 PM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 17 Feb 2009 20:33:38 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2009-02-17T20:33:38Z</dc:date>
    <item>
      <title>Event Handler for second grid</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/event-handler-for-second-grid/m-p/5168202#M1196852</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi, Gurus:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I followed the example ALV program BCALV_GRID_03, created my own program.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have my own data show on the first grid. Double click event implemented, so I can go to second grid via double click.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now I need to implement another double click event for grid 2, the code inside CLASS lcl_event_receiver IMPLEMENTATION is just for grid 1. How could I do it ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have read the Easy Reference for ALV Grid Control, it seems that I could not get answer from it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Liang&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 17 Feb 2009 17:18:45 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/event-handler-for-second-grid/m-p/5168202#M1196852</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-02-17T17:18:45Z</dc:date>
    </item>
    <item>
      <title>Re: Event Handler for second grid</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/event-handler-for-second-grid/m-p/5168203#M1196853</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Try this way&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;

data: event_receiver_grid type ref to lcl_event_receiver_grid,
      event_receiver_grid2 type ref to lcl_event_receiver_grid2.
....
....
....
class lcl_event_receiver_grid2 definition.

  public section.
    methods:
    double_click_200
             for event double_click
             of cl_gui_alv_grid
             importing e_row e_column es_row_no,
....
....
class lcl_event_receiver_grid2 implementation.

  method double_click_200.
    v_dclick = c_y.
    move e_row to wa_dblclk_rows.
    append wa_dblclk_rows to i_dblclk_rows.
    v_row = wa_dblclk_rows-index.
    if e_column-fieldname ne 'EQUNR'.
*      perform f_equipment_detail.
    endif.
    clear : v_dclick.
  endmethod.                             
....
....
....
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;then use the lcl_event_receiver_grid2 in the set handler for grid2&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
    set handler event_receiver_grid-&amp;gt;double_click_200 for grid2.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;a®&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 17 Feb 2009 17:28:53 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/event-handler-for-second-grid/m-p/5168203#M1196853</guid>
      <dc:creator>former_member194669</dc:creator>
      <dc:date>2009-02-17T17:28:53Z</dc:date>
    </item>
    <item>
      <title>Re: Event Handler for second grid</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/event-handler-for-second-grid/m-p/5168204#M1196854</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&amp;lt;&amp;lt; cut and paste without attribution from https://www.sdn.sap.com/irj/scn/wiki?path=/pages/viewpage.action%3fpageid=53583 removed &amp;gt;&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: GP on Feb 17, 2009 6:32 PM&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Rob Burbank on Feb 17, 2009 1:24 PM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 17 Feb 2009 17:29:22 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/event-handler-for-second-grid/m-p/5168204#M1196854</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-02-17T17:29:22Z</dc:date>
    </item>
    <item>
      <title>Re: Event Handler for second grid</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/event-handler-for-second-grid/m-p/5168205#M1196855</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;a®s:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Your proposal does not work since lcl_event_receiver_grid2 is not defined in SAP.&lt;/P&gt;&lt;P&gt;If I use:  event_receiver_grid2 type ref to lcl_event_receiver_grid&lt;/P&gt;&lt;P&gt;It does not make sense since "lcl_event_receiver_grid"  is still same class.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Liang&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 17 Feb 2009 17:37:46 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/event-handler-for-second-grid/m-p/5168205#M1196855</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-02-17T17:37:46Z</dc:date>
    </item>
    <item>
      <title>Re: Event Handler for second grid</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/event-handler-for-second-grid/m-p/5168206#M1196856</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE level="1"&gt;&lt;/BLOCKQUOTE&gt;&lt;PRE&gt;&lt;CODE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;gt; &lt;/P&gt;&lt;/CODE&gt;&lt;PRE&gt;&lt;CODE&gt;&lt;CODE&gt;
&amp;gt; data: event_receiver_grid type ref to lcl_event_receiver_grid,
&amp;gt;       event_receiver_grid2 type ref to lcl_event_receiver_grid2.
&amp;gt; &lt;/CODE&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;gt;&lt;/P&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you see my code above i am referencing to  lcl_event_receiver_grid2 and NOT  lcl_event_receiver_grid.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and also you need to  define and implement  lcl_event_receiver_grid2  in your code&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; a®&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 17 Feb 2009 17:41:25 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/event-handler-for-second-grid/m-p/5168206#M1196856</guid>
      <dc:creator>former_member194669</dc:creator>
      <dc:date>2009-02-17T17:41:25Z</dc:date>
    </item>
    <item>
      <title>Re: Event Handler for second grid</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/event-handler-for-second-grid/m-p/5168207#M1196857</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Now I understand now.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for your advise.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Liang&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 17 Feb 2009 18:08:29 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/event-handler-for-second-grid/m-p/5168207#M1196857</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-02-17T18:08:29Z</dc:date>
    </item>
    <item>
      <title>Re: Event Handler for second grid</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/event-handler-for-second-grid/m-p/5168208#M1196858</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Liang&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;There is absolutely no need to define a second event handler. You may have a look at my sample report &lt;STRONG&gt;ZUS_SDN_THREE_ALV_GRIDS&lt;/STRONG&gt; in thread &lt;SPAN __jive_macro_name="thread" id="286895"&gt;&lt;/SPAN&gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The crucial points are shown below:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
*---------------------------------------------------------------------*
*       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.  " &amp;lt;&amp;lt;&amp;lt; optional parameter: instance that raised the event
 
 
ENDCLASS.                    "lcl_eventhandler DEFINITION
 
 
 
*---------------------------------------------------------------------*
*       CLASS lcl_eventhandler IMPLEMENTATION
*---------------------------------------------------------------------*
*
*---------------------------------------------------------------------*
CLASS lcl_eventhandler IMPLEMENTATION.
 
  METHOD handle_double_click.
*   define local data
    DATA:
      ls_knb1      TYPE knb1,
      ls_vbak      TYPE vbak,
      ls_vbap      TYPE vbap.
 
 
    CASE sender.  " discriminate according to sending instance...
      WHEN 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( 'ORDERS' ).
 
 
      WHEN go_grid2.
        READ TABLE gt_vbak INTO ls_vbak INDEX e_row-index.
        CHECK ( ls_vbak-vbeln 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( 'ORDER_DETAILS' ).
 
 
 
      WHEN go_grid3.
        READ TABLE gt_vbap INTO ls_vbap INDEX e_row-index.
        CHECK ( ls_vbap-matnr IS NOT INITIAL ).
 
        SET PARAMETER ID 'MAT' FIELD ls_vbap-matnr.
        CALL TRANSACTION 'MM02' AND SKIP FIRST SCREEN.
 
      WHEN OTHERS.
        RETURN.
    ENDCASE.

 
  ENDMETHOD.                    "handle_double_click
 
ENDCLASS.                    "lcl_eventhandler IMPLEMENTATION
&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>Tue, 17 Feb 2009 19:30:04 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/event-handler-for-second-grid/m-p/5168208#M1196858</guid>
      <dc:creator>uwe_schieferstein</dc:creator>
      <dc:date>2009-02-17T19:30:04Z</dc:date>
    </item>
    <item>
      <title>Re: Event Handler for second grid</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/event-handler-for-second-grid/m-p/5168209#M1196859</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Uwe,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I never used "SENDER" parameter. Its new info to me. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This info i came to know few months earlier i can avoid bunch of unwanted codes which i have written&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks anyway&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;a®&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 17 Feb 2009 19:37:53 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/event-handler-for-second-grid/m-p/5168209#M1196859</guid>
      <dc:creator>former_member194669</dc:creator>
      <dc:date>2009-02-17T19:37:53Z</dc:date>
    </item>
    <item>
      <title>Re: Event Handler for second grid</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/event-handler-for-second-grid/m-p/5168210#M1196860</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Great! Uwe. It help me to solve my problem.&lt;/P&gt;&lt;P&gt;Your solution is what I prefered, and I have tried it works.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks a lot.&lt;/P&gt;&lt;P&gt;Liang&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Liang Ji on Feb 17, 2009 9:40 PM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 17 Feb 2009 20:33:38 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/event-handler-for-second-grid/m-p/5168210#M1196860</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-02-17T20:33:38Z</dc:date>
    </item>
  </channel>
</rss>

