<?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 on Subscreen in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/alv-on-subscreen/m-p/7045363#M1501326</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Peter,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This is implemented similary to main screen's ALV. Actually there is no difference for the system whether AVL is embeded in main screen or a subscreen. The handler must be correctly set and that's it. Refer below program. It uses ALV in subscreen and the event handling works fine&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
"program
CLASS cl_ev_handler DEFINITION.
  PUBLIC SECTION.
    METHODS:
          handle_double_click FOR EVENT double_click OF cl_gui_alv_grid
                              IMPORTING e_row e_column es_row_no.
ENDCLASS.                    "cl_ev_handler DEFINITION


CLASS cl_ev_handler IMPLEMENTATION.
  METHOD handle_double_click .
    DATA: l_mess TYPE string,
          l_row(2) TYPE c.

    DATA: it_sub TYPE lvc_t_grpl.

    WRITE es_row_no-row_id TO l_row.
    CONCATENATE 'Double click at: ' e_column-fieldname 'in'
                                     l_row 'row.'
                                     INTO l_mess SEPARATED BY space.
    MESSAGE l_mess TYPE 'I'.
  ENDMETHOD .                    "handle_double_click
ENDCLASS.                    "cl_ev_handler IMPLEMENTATION


DATA: r_cc_container TYPE REF TO cl_gui_custom_container.
DATA: r_alv_grid TYPE REF TO cl_gui_alv_grid.
DATA  r_ev_handler TYPE REF TO cl_ev_handler.

DATA: it_sflight TYPE TABLE OF sflight.

START-OF-SELECTION.

  SELECT * FROM sflight INTO TABLE it_sflight UP TO 10 ROWS.

  CALL SCREEN 100.

"subscreen's pbo (0101)
MODULE pbo_subscreen OUTPUT.

  IF r_cc_container IS INITIAL.
    CREATE OBJECT r_cc_container
      EXPORTING
        container_name    = 'CCONTAINER'.

    CREATE OBJECT r_alv_grid
      EXPORTING
       i_parent           = r_cc_container.

    CALL METHOD r_alv_grid-&amp;gt;set_table_for_first_display
      EXPORTING
        i_structure_name = 'SFLIGHT'
      CHANGING
        it_outtab        = it_sflight.

    CREATE OBJECT r_ev_handler.
    SET HANDLER r_ev_handler-&amp;gt;handle_double_click FOR r_alv_grid.
  ENDIF.
ENDMODULE.       


"screen 100 (main screen) flow layout
PROCESS BEFORE OUTPUT.
  CALL SUBSCREEN area INCLUDING sy-repid '0101'.       
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Marcin&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 28 Jul 2010 10:51:51 GMT</pubDate>
    <dc:creator>MarcinPciak</dc:creator>
    <dc:date>2010-07-28T10:51:51Z</dc:date>
    <item>
      <title>ALV on Subscreen</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/alv-on-subscreen/m-p/7045362#M1501325</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 have an Problem with handle Events from ALV in an Subscreen. &lt;/P&gt;&lt;P&gt;I have create the eventhandle and have set it to my ALV on the subscreen. But the event doesn't raise. &lt;/P&gt;&lt;P&gt;Where have I to implement this handler? It can't be the same as in normal Screens. There it runs without any Problems.&lt;/P&gt;&lt;P&gt;Where are the differents?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Peter&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 28 Jul 2010 08:38:43 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/alv-on-subscreen/m-p/7045362#M1501325</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-07-28T08:38:43Z</dc:date>
    </item>
    <item>
      <title>Re: ALV on Subscreen</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/alv-on-subscreen/m-p/7045363#M1501326</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Peter,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This is implemented similary to main screen's ALV. Actually there is no difference for the system whether AVL is embeded in main screen or a subscreen. The handler must be correctly set and that's it. Refer below program. It uses ALV in subscreen and the event handling works fine&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
"program
CLASS cl_ev_handler DEFINITION.
  PUBLIC SECTION.
    METHODS:
          handle_double_click FOR EVENT double_click OF cl_gui_alv_grid
                              IMPORTING e_row e_column es_row_no.
ENDCLASS.                    "cl_ev_handler DEFINITION


CLASS cl_ev_handler IMPLEMENTATION.
  METHOD handle_double_click .
    DATA: l_mess TYPE string,
          l_row(2) TYPE c.

    DATA: it_sub TYPE lvc_t_grpl.

    WRITE es_row_no-row_id TO l_row.
    CONCATENATE 'Double click at: ' e_column-fieldname 'in'
                                     l_row 'row.'
                                     INTO l_mess SEPARATED BY space.
    MESSAGE l_mess TYPE 'I'.
  ENDMETHOD .                    "handle_double_click
ENDCLASS.                    "cl_ev_handler IMPLEMENTATION


DATA: r_cc_container TYPE REF TO cl_gui_custom_container.
DATA: r_alv_grid TYPE REF TO cl_gui_alv_grid.
DATA  r_ev_handler TYPE REF TO cl_ev_handler.

DATA: it_sflight TYPE TABLE OF sflight.

START-OF-SELECTION.

  SELECT * FROM sflight INTO TABLE it_sflight UP TO 10 ROWS.

  CALL SCREEN 100.

"subscreen's pbo (0101)
MODULE pbo_subscreen OUTPUT.

  IF r_cc_container IS INITIAL.
    CREATE OBJECT r_cc_container
      EXPORTING
        container_name    = 'CCONTAINER'.

    CREATE OBJECT r_alv_grid
      EXPORTING
       i_parent           = r_cc_container.

    CALL METHOD r_alv_grid-&amp;gt;set_table_for_first_display
      EXPORTING
        i_structure_name = 'SFLIGHT'
      CHANGING
        it_outtab        = it_sflight.

    CREATE OBJECT r_ev_handler.
    SET HANDLER r_ev_handler-&amp;gt;handle_double_click FOR r_alv_grid.
  ENDIF.
ENDMODULE.       


"screen 100 (main screen) flow layout
PROCESS BEFORE OUTPUT.
  CALL SUBSCREEN area INCLUDING sy-repid '0101'.       
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Marcin&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 28 Jul 2010 10:51:51 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/alv-on-subscreen/m-p/7045363#M1501326</guid>
      <dc:creator>MarcinPciak</dc:creator>
      <dc:date>2010-07-28T10:51:51Z</dc:date>
    </item>
  </channel>
</rss>

