Handling double click event in oops alv

I need to write a interactive alv where,can any one help me in handling double click event using oops.

Hello,
Demo program on interactive ALV using OOPS
REPORT  ZALV_OOINTERACTIVE.*Class definition for handling double click
CLASS event_class DEFINITION DEFERRED.*Internal table and work area declarations for dd02l and dd03l
DATA : it_dd02l TYPE TABLE OF dd02l,
       wa_dd02l TYPE dd02l,
       it_dd03l TYPE TABLE OF dd03l,
       wa_dd03l TYPE dd03l.*data declarations for ALV Main list
DATA : ty_lay1 TYPE lvc_s_layo,
       it_fieldcat TYPE lvc_t_fcat ,
       ty_fieldcat TYPE lvc_s_fcat ,
       c_alv1 TYPE REF TO cl_gui_alv_grid,
       c_cont1 TYPE REF TO cl_gui_custom_container,
       event_receiver TYPE REF TO event_class.*data declarations for ALV Interactive listDATA : ty_lay2 TYPE lvc_s_layo,
       it_fcat TYPE lvc_t_fcat ,
       ty_fcat TYPE lvc_s_fcat ,
       c_alv2 TYPE REF TO cl_gui_alv_grid,
       c_cont2 TYPE REF TO cl_gui_custom_container.
**Select options for multiple values and NOT ranges
SELECT-OPTIONS : s_table FOR wa_dd02l-tabname NO INTERVALS.
Initialization event
INITIALIZATION.*Start of selection event
START-OF-SELECTION.*fetch data into table and field characteristics
  PERFORM fetch_data.*ALV display for output
  PERFORM alv_output.&----
*&      Form  FETCH_DATA
      text
-->  p1        text
<--  p2        text
FORM fetch_data .*Select the table details
  SELECT * FROM dd02l INTO CORRESPONDING FIELDS OF TABLE it_dd02l 
WHERE tabname IN s_table
  AND tabclass = 'TRANSP'.
ENDFORM.                    " FETCH_DATA----* CLASS lcl_event_receiver DEFINITION----CLASS event_class DEFINITION.*Handling double click
  PUBLIC SECTION.    METHODS:
    handle_double_click
    FOR EVENT double_click OF cl_gui_alv_grid IMPORTING e_row .ENDCLASS. "lcl_event_receiver DEFINITION
----* CLASS lcl_event_receiver IMPLEMENTATION
----CLASS event_class IMPLEMENTATION.  METHOD handle_double_click.    DATA : ls_dd02l LIKE LINE OF it_dd02l.*Reading the selected data into a variable
    READ TABLE it_dd02l INDEX e_row-index INTO ls_dd02l.*  *Select the field details of the selected table
    SELECT * FROM dd03l INTO CORRESPONDING FIELDS OF TABLE it_dd03l
    WHERE tabname EQ ls_dd02l-tabname.
*calling the ALV containing the field values
    CALL SCREEN 101.  ENDMETHOD. "handle_double_clickENDCLASS. "lcl_event_receiver IMPLEMENTATION&----& Module pbo_100 OUTPUT&----
*MODULE pbo_100 OUTPUT.
*set pf-status 'XXX'.
*set titlebar 'XXX'.
ENDMODULE. " PBO_100 OUTPUT
*& Module alv_100 OUTPUT
&----MODULE alv_100 OUTPUT.*Check if there is no custom container in screen 100
  IF c_cont1 IS INITIAL.*Creating object of container
    CREATE OBJECT c_cont1
     EXPORTING
       container_name = 'CCONT'.
    IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.*Creating object of alv
    CREATE OBJECT c_alv1
       EXPORTING
        i_parent = c_cont1.
    IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.*alv layout
    PERFORM alv_100_layout.*alv field catalogue
    PERFORM alv_100_fieldcat.*Displaying the ALV grid
    CALL METHOD c_alv1->set_table_for_first_display
      EXPORTING
        is_layout       = ty_lay1
      CHANGING
        it_outtab       = it_dd02l[]
        it_fieldcatalog = it_fieldcat.    IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.*Create object of the event class and setting handler for double click
    CREATE OBJECT event_receiver.
    SET HANDLER event_receiver->handle_double_click FOR c_alv1.  ENDIF.ENDMODULE. " ALV_100 OUTPUT&----& Module pai_100 INPUT&----
*MODULE pai_100 INPUT.
ENDMODULE. " pai_100 INPUT----* MODULE PBO_101 OUTPUT----MODULE pbo_101 OUTPUT.
SET PF-STATUS 'XXX'.
SET TITLEBAR 'XXX'.
ENDMODULE. " PBO_101 INPUT----* MODULE ALV_101 OUTPUT----
MODULE alv_101 OUTPUT.
*Check if the Custom container exists.
  IF c_cont2 IS INITIAL.*Creating container object
    CREATE OBJECT c_cont2
      EXPORTING
        container_name = 'CDCONT'.
    IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.*creating ALV grid for interactive list
    CREATE OBJECT c_alv2
      EXPORTING
       i_parent = c_cont2.
    IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.*ALV layout
    PERFORM alv_101_layout.*ALV fieldcatalogue
    PERFORM alv_101_fieldcat.*Sorting the output by field position
    SORT it_dd03l BY position.*ALV for display field details
    CALL METHOD c_alv2->set_table_for_first_display
      EXPORTING
        is_layout       = ty_lay2
      CHANGING
        it_outtab       = it_dd03l[]
        it_fieldcatalog = it_fcat.
    IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.  ENDIF.ENDMODULE. " ALV_101 OUTPUT
&----& Module PAI_101 INPUT&----
*MODULE pai_101 INPUT.ENDMODULE. " PAI_101 INPUT
*&      Form  ALV_OUTPUT
      text
-->  p1        text
<--  p2        text
FORM alv_output .
  CALL SCREEN 100.ENDFORM.                    " ALV_OUTPUT
*&      Form  ALV_100_LAYOUT
      text
-->  p1        text
<--  p2        text
FORM alv_100_layout .  ty_lay1-grid_title = 'TABLES'.
  ty_lay1-zebra = 'X'.
  ty_lay1-no_toolbar = 'X'.ENDFORM.                    " ALV_100_LAYOUT
*&      Form  ALV_100_FIELDCAT
      text
-->  p1        text
<--  p2        text
FORM alv_100_fieldcat .
  CLEAR ty_fieldcat.
  ty_fieldcat-row_pos = 1.
  ty_fieldcat-col_pos = 1.
  ty_fieldcat-fieldname = 'TABNAME'.
  ty_fieldcat-tabname = 'GT_DD02L'.
  ty_fieldcat-coltext = 'TableName'.
  ty_fieldcat-outputlen = 10.
  APPEND ty_fieldcat TO it_fieldcat.
  CLEAR ty_fieldcat.  ty_fieldcat-row_pos = 1.
  ty_fieldcat-col_pos = 2.
  ty_fieldcat-fieldname = 'TABCLASS'.
  ty_fieldcat-tabname = 'GT_DD02L'.
  ty_fieldcat-coltext = 'CATEGORY'.
  ty_fieldcat-outputlen = 10.
  APPEND ty_fieldcat TO it_fieldcat.
  CLEAR ty_fieldcat.  ty_fieldcat-row_pos = 1.
  ty_fieldcat-col_pos = 3.
  ty_fieldcat-fieldname = 'AS4USER'.
  ty_fieldcat-tabname = 'GT_DD02L'.
  ty_fieldcat-coltext = 'CREATED'.
  ty_fieldcat-outputlen = 10.
  APPEND ty_fieldcat TO it_fieldcat.
  CLEAR ty_fieldcat.  ty_fieldcat-row_pos = 1.
  ty_fieldcat-col_pos = 4.
  ty_fieldcat-fieldname = 'AS4DATE'.
  ty_fieldcat-tabname = 'GT_DD02L'.
  ty_fieldcat-coltext = 'DATE'.
  ty_fieldcat-outputlen = 10.
  APPEND ty_fieldcat TO it_fieldcat.
  CLEAR ty_fieldcat.
  ty_fieldcat-row_pos = 1.
  ty_fieldcat-col_pos = 5.
  ty_fieldcat-fieldname = 'AS4TIME'.
  ty_fieldcat-tabname = 'GT_DD02L'.
  ty_fieldcat-coltext = 'TIME'.
  ty_fieldcat-outputlen = 10.
  APPEND ty_fieldcat TO it_fieldcat.
  CLEAR ty_fieldcat.  ty_fieldcat-row_pos = 1.
  ty_fieldcat-col_pos = 6.
  ty_fieldcat-fieldname = 'CONTFLAG'.
  ty_fieldcat-tabname = 'GT_DD02L'.
  ty_fieldcat-coltext = 'Delivery Class'.
  ty_fieldcat-outputlen = 15.
  APPEND ty_fieldcat TO it_fieldcat.
  CLEAR ty_fieldcat.ENDFORM.                    " ALV_100_FIELDCAT
*&      Form  ALV_101_LAYOUT
      text
-->  p1        text
<--  p2        text
FORM alv_101_layout .  ty_lay2-grid_title = 'FIELDS'.
  ty_lay2-zebra = 'X'.
  ty_lay2-no_toolbar = 'X'.ENDFORM.                    " ALV_101_LAYOUT
*&      Form  ALV_101_FIELDCAT
      text
-->  p1        text
<--  p2        text
FORM alv_101_fieldcat .  REFRESH it_fieldcat.
  REFRESH it_fcat.
  CLEAR ty_fcat.  ty_fcat-row_pos = 1.
  ty_fcat-col_pos = 1.
  ty_fcat-fieldname = 'FIELDNAME'.
  ty_fcat-tabname = 'GT_DD03L'.
  ty_fcat-coltext = 'Fieldname'.
  ty_fcat-outputlen = 10.
  APPEND ty_fcat TO it_fcat.
  ty_fcat-row_pos = 1.
  ty_fcat-col_pos = 2.
  ty_fcat-fieldname = 'CHECKTABLE'.
  ty_fcat-tabname = 'GT_DD03L'.
  ty_fcat-coltext = 'CHECKTABLE'.
  ty_fcat-outputlen = 10.
  APPEND ty_fcat TO it_fcat.  ty_fcat-row_pos = 1.
  ty_fcat-col_pos = 3.
  ty_fcat-fieldname = 'KEYFLAG'.
  ty_fcat-tabname = 'GT_DD03L'.
  ty_fcat-coltext = 'Key Flag'.
  ty_fcat-outputlen = 10.
  APPEND ty_fcat TO it_fcat.ENDFORM.                    " ALV_101_FIELDCAT

Similar Messages

  • Problem in handling double click in the second alv grid control

    Hi all,
    I have a screen. In the screen , I have 2 custom container and each custom container has 1 alv grid control.
    I need to handle double click event for both of alv grid controls in my screen.
    I defined 2 local event handler class for each alv grid and defined 2 handle_double_click event.
    In the first Alv grid double click works fine , everything is ok, world is peaceful.
    But in the second alvgrid, the row parameters (E_ROW, E_COLUMN, ES_ROW_NO) comes initial so i cannot handle it.
    All i need is to call a different transaction (displaying the equipment-IE03) when user double-click on a field in the second alv grid control. I tried to use hotspot_click event too but it does'nt give the row id either.
    I read some posts in the forms ([Double click event of alv grid control|Double click event of alv grid control]).
    I tried everything but nothing works.
    Please help. Your answers will be appreciated.

    Hello Eagle
    I am not sure where the problem lies in your case but sample report ZUS_SDN_THREE_ALV_GRIDS_01 shows that you can always find out the current cell after the double-click event (in any case you have the current cell already as IMPORTING parameters of the event):
    *& Report  ZUS_SDN_THREE_ALV_GRIDS_01
    *& Flow logic of screen '0100' (no screen elements, ok-code => GD_OKCODE):
    **    PROCESS BEFORE OUTPUT.
    **      MODULE STATUS_0100.
    **    PROCESS AFTER INPUT.
    **      MODULE USER_COMMAND_0100.
    *& Thread: problem in handling double click in the second alv grid control
    *& <a class="jive_macro jive_macro_thread" href="" __jive_macro_name="thread" modifiedtitle="true" __default_attr="1172052"></a>
    REPORT  zus_sdn_three_alv_grids_01.
    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_splitter_2    TYPE REF TO cl_gui_splitter_container,
      go_cell_top      TYPE REF TO cl_gui_container,
      go_cell_bottom   TYPE REF TO cl_gui_container,
      go_cell_left     TYPE REF TO cl_gui_container,
      go_cell_right    TYPE REF TO cl_gui_container,
      go_grid1         TYPE REF TO cl_gui_alv_grid,
      go_grid2         TYPE REF TO cl_gui_alv_grid,
      go_grid3         TYPE REF TO cl_gui_alv_grid.
    DATA:
      gt_outtab        TYPE STANDARD TABLE OF vbak,
      gt_outtab_2      TYPE STANDARD TABLE OF vbap,
      gt_outtab_3      TYPE STANDARD TABLE OF vbep.
    **PARAMETERS:
    **  p_bukrs          TYPE bukrs  DEFAULT '1000'.
    *       CLASS lcl_eventhandler DEFINITION
    CLASS lcl_eventhandler DEFINITION.
      PUBLIC SECTION.
        CLASS-DATA:
          ms_row      TYPE lvc_s_row,
          ms_col      TYPE lvc_s_col.
        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_outtab      TYPE vbak,
          ls_outtab_2    TYPE vbap,
          ls_outtab_3    TYPE vbep.
        "   Initialize class data
        CLEAR: ms_row,
               ms_col.
        CASE sender.
          WHEN go_grid1.
            ms_row = e_row.
            ms_col = e_column.
    *       Triggers PAI of the dynpro with the specified ok-code
            CALL METHOD cl_gui_cfw=>set_new_ok_code
              EXPORTING
                new_code = 'GET_ITEMS'
    *          IMPORTING
    *            rc       =
          WHEN go_grid2.
            ms_row = e_row.
            ms_col = e_column.
    *       Triggers PAI of the dynpro with the specified ok-code
            CALL METHOD cl_gui_cfw=>set_new_ok_code
              EXPORTING
                new_code = 'GET_SCHEDULE_LINES'
    *          IMPORTING
    *            rc       =
          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
    START-OF-SELECTION.
      SELECT        * FROM  vbak INTO TABLE gt_outtab UP TO 100 ROWS.
      PERFORM init_controls.
    * Display data
      CALL METHOD go_grid1->set_table_for_first_display
        EXPORTING
          i_structure_name = 'VBAK'
        CHANGING
          it_outtab        = gt_outtab
        EXCEPTIONS
          OTHERS           = 4.
      IF sy-subrc NE 0.
    *   MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *              WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
      REFRESH: gt_outtab_2.
      CALL METHOD go_grid2->set_table_for_first_display
        EXPORTING
          i_structure_name = 'VBAP'
        CHANGING
          it_outtab        = gt_outtab_2    " empty !!!
        EXCEPTIONS
          OTHERS           = 4.
      IF sy-subrc NE 0.
    *   MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *              WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
      REFRESH: gt_outtab_3.
      CALL METHOD go_grid3->set_table_for_first_display
        EXPORTING
          i_structure_name = 'VBEP'
        CHANGING
          it_outtab        = gt_outtab_3    " empty !!!
        EXCEPTIONS
          OTHERS           = 4.
      IF sy-subrc NE 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->link
        EXPORTING
          repid                       = gd_repid
          dynnr                       = '0100'
    *      CONTAINER                   =
        EXCEPTIONS
          OTHERS                      = 4.
      IF sy-subrc NE 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:
    *PROCESS BEFORE OUTPUT.
    *  MODULE STATUS_0100.
    *PROCESS AFTER INPUT.
    *  MODULE USER_COMMAND_0100.
    END-OF-SELECTION.
    *&      Module  STATUS_0100  OUTPUT
    *       text
    MODULE status_0100 OUTPUT.
      SET PF-STATUS 'STATUS_0100'.  " contains push button "ORDERS"
    *  SET TITLEBAR 'xxx'.
    * Refresh display of detail ALV list
      CALL METHOD go_grid2->refresh_table_display
    *    EXPORTING
    *      IS_STABLE      =
    *      I_SOFT_REFRESH =
        EXCEPTIONS
          OTHERS         = 2.
      IF sy-subrc NE 0.
    *   MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *              WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
    * Refresh display of detail ALV list
      CALL METHOD go_grid3->refresh_table_display
    *    EXPORTING
    *      IS_STABLE      =
    *      I_SOFT_REFRESH =
        EXCEPTIONS
          OTHERS         = 2.
      IF sy-subrc NE 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
    *&      Module  USER_COMMAND_0100  INPUT
    *       text
    MODULE user_command_0100 INPUT.
      CASE gd_okcode.
        WHEN 'BACK' OR
             'END'  OR
             'CANC'.
          SET SCREEN 0. LEAVE SCREEN.
        " Double-click on first or second ALV grid
        WHEN 'GET_ITEMS'  OR
             'GET_SCHEDULE_LINES'.
          PERFORM get_details.
        WHEN OTHERS.
      ENDCASE.
      CLEAR: gd_okcode.
    ENDMODULE.                 " USER_COMMAND_0100  INPUT
    *&      Form  INIT_CONTROLS
    *       text
    *  -->  p1        text
    *  <--  p2        text
    FORM init_controls .
    * Create docking container
      CREATE OBJECT go_docking
        EXPORTING
          parent = cl_gui_container=>screen0
          ratio  = 90
        EXCEPTIONS
          OTHERS = 6.
      IF sy-subrc NE 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 NE 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->get_container
        EXPORTING
          row       = 1
          column    = 1
        RECEIVING
          container = go_cell_left.
      CALL METHOD go_splitter->get_container
        EXPORTING
          row       = 1
          column    = 2
        RECEIVING
          container = go_cell_right.
    * Create 2nd splitter container
      CREATE OBJECT go_splitter_2
        EXPORTING
          parent            = go_cell_left
          rows              = 2
          columns           = 1
    *      NO_AUTODEF_PROGID_DYNNR =
    *      NAME              =
        EXCEPTIONS
          cntl_error        = 1
          cntl_system_error = 2
          OTHERS            = 3.
      IF sy-subrc NE 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_2->get_container
        EXPORTING
          row       = 1
          column    = 1
        RECEIVING
          container = go_cell_top.
      CALL METHOD go_splitter_2->get_container
        EXPORTING
          row       = 2
          column    = 1
        RECEIVING
          container = go_cell_bottom.
    * Create ALV grids
      CREATE OBJECT go_grid1
        EXPORTING
          i_parent = go_cell_top
        EXCEPTIONS
          OTHERS   = 5.
      IF sy-subrc NE 0.
    *   MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *              WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
      CREATE OBJECT go_grid2
        EXPORTING
          i_parent = go_cell_bottom
        EXCEPTIONS
          OTHERS   = 5.
      IF sy-subrc NE 0.
    *   MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *              WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
      CREATE OBJECT go_grid3
        EXPORTING
          i_parent = go_cell_right
        EXCEPTIONS
          OTHERS   = 5.
      IF sy-subrc NE 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=>handle_double_click FOR go_grid1.
      SET HANDLER: lcl_eventhandler=>handle_double_click FOR go_grid2.
      SET HANDLER: lcl_eventhandler=>handle_double_click FOR go_grid3.
    ENDFORM.                    " INIT_CONTROLS
    *&      Form  GET_DETAILS
    *       text
    *  -->  p1        text
    *  <--  p2        text
    FORM get_details .
    * define local data
      DATA: ls_row      TYPE lvc_s_row,
            ls_col      TYPE lvc_s_col.
      data: ls_outtab   type vbak,
            ls_outtab_2 type vbap,
            ls_outtab_3 type vbep.
      BREAK-POINT.
      CASE gd_okcode.
        WHEN 'GET_ITEMS'.
          CALL METHOD go_grid1->get_current_cell
            IMPORTING
    *          e_row     =
    *          e_value   =
    *          e_col     =
              es_row_id = ls_row
              es_col_id = ls_col
    *          es_row_no =
          read TABLE gt_outtab into ls_outtab index ls_row-index.
          refresh: gt_outtab_2,
                   gt_outtab_3.
          SELECT        * FROM  vbap into TABLE gt_outtab_2
                 WHERE  vbeln  = ls_outtab-vbeln.
        WHEN 'GET_SCHEDULE_LINES'.
          CALL METHOD go_grid2->get_current_cell
            IMPORTING
    *          e_row     =
    *          e_value   =
    *          e_col     =
              es_row_id = ls_row
              es_col_id = ls_col
    *          es_row_no =
          READ TABLE gt_outtab_2 into ls_outtab_2 index ls_row-index.
          refresh: gt_outtab_3.
          SELECT        * FROM  vbep into TABLE gt_outtab_3
                 WHERE  vbeln  = ls_outtab_2-vbeln
                 AND    posnr  = ls_outtab_2-posnr.
        WHEN OTHERS.
          RETURN.
      ENDCASE.
      IF ( lcl_eventhandler=>ms_row = ls_row  AND
           lcl_eventhandler=>ms_col = ls_col ).
        MESSAGE 'Current cell identical'  TYPE 'I'.
      ELSE.
        MESSAGE 'Current cell NOT identical'  TYPE 'I'.
      ENDIF.
    ENDFORM.                    " GET_DETAILS
    Regards
      Uwe

  • How to handle double click event in a text control

    Hi,
       Will u please send me information on handling double click events inside text control and also about locking and unlocking of DB tables for updation.
    Regards,
    Praba.

    Hi Prabhavathi,
    Here is how you handle double click events in Textedit control.
    1)Create a custom control in screen (say TEXT_CONTROL)
    2)In main program,
    a) Declarations:
    data: obj type ref to cl_gui_custiom_control.
          text type ref to cl_gui_textedit.
    b) Create the instance of custom container
    c) Create the instance of textedit control.
    3)Now to handle double click events , create a local class as follows.
    class shail_event definition.
    public section.
    methods:
    handle_doubleclick for event dblclick of cl_gui_textedit .
    endclass.
    class shail_event implementation.
    method handle_doubleclick .
    here do the coding for handling the double click.
    endmethod.
    endclass.
    4) Create an instance of the handler class(ie.ZSHAIL_EVENT).Let it be named hand.
    5) Define varibles for event.
    DATA: i_events TYPE cntl_simple_events,
          wa_events TYPE cntl_simple_event.
    SET HANDLER hand->handle_doubleclick for text.
    wa_events-eventid = cl_gui_textedit=>event_double_click.
    wa_events-appl_event = 'X'. "This is an application event
    APPEND wa_events TO i_events.
    6)
        CALL METHOD texte->set_registered_events
          EXPORTING
            events                    = i_events
          EXCEPTIONS
            cntl_error                = 1
            cntl_system_error         = 2
            illegal_event_combination = 3
            OTHERS                    = 4.
        IF sy-subrc <> 0.
         MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
                    WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
        ENDIF.
    These are the basic steps needed for handling events in Textedit control.You can go to SE24 and type CL_GUI_TEXTEDIT to find the associated events of the class.
    If you want the program, kindly send your mail-id so that I can mail it to you.
    Regards,
    Sylendra.

  • BCALV_TREE_DEMO - handle double click event

    Hi everyone,
    I'm trying to do something close to BCALV_TREE_DEMO but I can't have a double click triggering anything. I have exactly the same code (except that I uncommented the PERFORM register_events) so I don't need to post here anything else.
    Can u help plz?
    Regards,
    André Costa
    Message was edited by:
            Andr Costa
    I also add the following line in the FORM register_events:
      set handler l_event_receiver->handle_item_double_click                                                        for tree1.

    Hi Umesh,
    Thanks for your reply , but af:ClientListener cannot be child of Hierarchy Viewer Component.
    Please suggest some other solution.
    Thanks,
    Jinali

  • I see slis everywhere while trying to handle double click

    I want to handle double click event of the alv grid but I could not reach any problem solving answer in documents.
    Am I required to write a class to handle user clicks on alv grid?
    Please send me a code segment on this subject. The procedure also would be very helpful.
    Thanks in advance.

    hi,
    CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY' Or list display
    EXPORTING
    I_CALLBACK_PROGRAM = sy-repid
    I_CALLBACK_USER_COMMAND = 'F_USER_COMMAND' " FORM NAME
    IT_FIELDCAT = GT_FIELDCAT
    TABLES
    T_OUTTAB = ITAB
    Here comes the interaction part
    FORM F_USER_COMMAND USING R_UCOMM LIKE SY-UCOMM
    RS_SELFIELD TYPE SLIS_SELFIELD.
    CASE R_UCOMM.        "system fileds
    When '&IC1'.                   "this is Fcodce for double click
    if rs_selfield-fieldname = '<your field name>'    "give the field name on whcih you will double click
    Write your code here..
    fetch data from DB tables and put in internal tables and again use reuse_ALV_grid_display function module you will get interactive list
    else
    you can use "REUSE_ALV_POPUP_TO_SELECT"
    to show the details in a small window..
    endif.
    endcase.
    ENDFORM.
    rewards if useful
    regards,
    nazeer

  • Double click event in ALV Display

    Hi
      I am using Reuse_alv_grid_display for dis[playing ALV. Now I want to handle double click event on a perticular Single column.
    Pls provide code.

    Hi,
    Check this example..If you double click on the purchase order field, it will take you to the corresponding PO in ME23N..
    TYPE-POOLS: slis.
    DATA: gt_fieldcat TYPE slis_t_fieldcat_alv.
    DATA: BEGIN OF wa_ekko,
    ebeln like ekko-ebeln,
    ekorg like ekko-ekorg,
    ekgrp like ekko-ekgrp,
    END OF wa_ekko.
    DATA: v_repid TYPE syrepid.
    v_repid = sy-repid.
    DATA it_ekko LIKE STANDARD TABLE OF wa_ekko WITH HEADER LINE.
    SELECT * UP TO 100 ROWS
    FROM ekko
    INTO CORRESPONDING FIELDS OF TABLE it_ekko.
    CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
         EXPORTING
              i_program_name     = v_repid
              i_internal_tabname = 'WA_EKKO'
              i_inclname         = v_repid
         CHANGING
              ct_fieldcat        = gt_fieldcat.
    Pass the program.
    v_repid = sy-repid.
    CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
         EXPORTING
              i_callback_program      = v_repid
              it_fieldcat             = gt_fieldcat
              i_callback_user_command = 'USER_COMMAND'
         TABLES
              t_outtab                = it_ekko.
          FORM display_detail                                           *
    -->  UCOMM                                                         *
    -->  SELFIELD                                                      *
    FORM user_command USING ucomm LIKE sy-ucomm
    selfield TYPE slis_selfield.
      IF ucomm = '&IC1' AND selfield-fieldname = 'EBELN'.
        READ TABLE it_ekko INDEX selfield-tabindex.
        IF sy-subrc = 0.
          SET PARAMETER ID 'BES' FIELD it_ekko-ebeln.
          CALL TRANSACTION 'ME23N' AND SKIP FIRST SCREEN.
        ENDIF.
      ENDIF.
    ENDFORM.
    Thanks,
    Naren

  • Double click on the node,ALV tree, subscreen

    Hi,
    I have a small requirement in ALV Tree
    left side i get a tree and when i double click on one of it , i'm trying to display the subscreen. even though i am setting the paramaters to the screen but i'm unable to get those values in the subscreen.
    example
    Name        Description                                                subscreen 0101
    xyz           xyz desc (double click on this)                  name    = XYZ
    ABC         abs desc                                                      descrip = xyz desc
    This is what the requirement is:
    Please help me out with the solution.
    Bhavana

    Hi Bhavana,
    Register your double click event in the ALV Tree program. Then call the respective subscreen using sy-ucomm value.
    IF NOT r_ucomm IS INITIAL.
        CASE r_ucomm.
          WHEN '&F03'.
            SET SCREEN 100.
            LEAVE SCREEN.
    endif.
    Refer the below code for setting the registering the event.
      CALL METHOD tree->get_registered_events
        IMPORTING
          events = l_events_s.
      l_event-eventid = cl_gui_column_tree=>eventid_item_double_click.
      APPEND l_event TO l_events_s.
      CALL METHOD tree->set_registered_events
        EXPORTING
          events                    = l_events_s
        EXCEPTIONS
          cntl_error                = 1
          cntl_system_error         = 2
          illegal_event_combination = 3.
      CREATE OBJECT l_events_receiver.
      SET HANDLER l_events_receiver->handle_item_click FOR tree.
    CLASS lcl_events_receiver DEFINITION.                       "#EC *
      PUBLIC SECTION.
        METHODS:
        handle_item_click FOR EVENT item_double_click OF cl_gui_alv_tree
            IMPORTING node_key fieldname.
    ENDCLASS.                    "lcl_handle_events DEFINITION
    CLASS lcl_events_receiver IMPLEMENTATION.
      METHOD handle_item_click.
        PERFORM employee_data USING node_key fieldname.
        CALL SCREEN 300.
      ENDMETHOD.                    "HANDLE_ITEM_DOUBLE_CLICK
    ENDCLASS.                    "lcl_events_receiver IMPLEMENTATION
    Thanks.
    Ganesh R K
    Edited by: Ganesh.rk83 on Jun 23, 2011 11:21 AM

  • Double-click event on a CL_SIMPLE_TREE_MODEL

    Hi all,
    I created an object of CL_SIMPLE_TREE_MODEL. it's working.
    But i am not able to double-click on it while following the same procedure on alv-grid it's working.
    is there any parameter like ' ITEM_SELECTION  '  in other tree class constructors, or any other way.
    Help me folks

    MODULE USER_COMMAND_0100 INPUT.
      CASE OK_CODE.
        WHEN  'BACK'.
          LEAVE PROGRAM.
        WHEN 'GET'.
          SELECT * FROM spfli into TABLE it_spfli
            WHERE carrid = spfli-carrid .
          IF sy-subrc = 0.
            CALL METHOD REF_GRID->REFRESH_TABLE_DISPLAY
           EXPORTING
             IS_STABLE      =
             I_SOFT_REFRESH =
            EXCEPTIONS
              FINISHED       = 1
              others         = 2 .
          IF SY-SUBRC = 0.
            MESSAGE 'LIST RETREIVED SUCCESSFULY' TYPE 'S'.
            ENDIF.
          ELSE.
            MESSAGE 'NO ENTRY FOR THIS SELECTION' type 'I'.
          ENDIF.
    WHEN 'OK'.
       LEAVE TO SCREEN 0.
      ENDCASE.
      CALL METHOD CL_GUI_CFW=>DISPATCH.    " Dispatch (static method) forwards a GUI Event to Proxy Object.
      IF ref_grid is not INITIAL .
        set HANDLER ref_dub_click->handle_double_click FOR ref_grid.
        set HANDLER ref_dub_click->handle_hotspot_click FOR ref_grid.
      ENDIF.
    IF ref_tree is NOT INITIAL.
    ENDIF.
    CALL METHOD cl_gui_cfw=>flush.
    ENDMODULE.  
    CLASS lcl_event_handler DEFINITION.             " Local class for event-handling
      PUBLIC SECTION.
        METHODS:
          handle_double_click for event double_click of cl_gui_alv_grid
            IMPORTING e_row e_column.
        METHODS:
          handle_hotspot_click for EVENT hotspot_click of cl_gui_alv_grid
            IMPORTING e_row_id e_column_id.
        METHODS:
          handle_double_click_tree FOR EVENT NODE_DOUBLE_CLICK of cl_simple_tree_model        "Method to handle double-click *event on Tree
        IMPORTING node_key.
    endclass.                    "lcl_event_handler DEFINITION
          CLASS lcl_event_handler IMPLEMENTATION
    CLASS lcl_event_handler IMPLEMENTATION.
      METHOD handle_double_click.
        READ TABLE it_spfli INTO spfli index e_row-index.
        IF sy-subrc = 0.
          CALL SCREEN 0101 STARTING AT 10 10 ENDING AT 50 30.
        ELSE.
          MESSAGE 'DOUBLE-CLICK occurred but no data found' TYPE 'W'.
        ENDIF.
      ENDMETHOD.                    "handle_double_click
      METHOD handle_hotspot_click.
        READ TABLE it_spfli INTO spfli INDEX e_row_id-index.
        IF sy-subrc = 0.
          CALL SCREEN 0101 STARTING AT 20 20 ENDING AT 60 40.
        ELSE.
          MESSAGE 'Hot-spot clicked but no data found' TYPE 'w'.
        ENDIF.
      ENDMETHOD.                    "handle_hotspot_click
      METHOD handle_double_click_tree.
        SELECT * from sbook into TABLE itab_sbook.
        LOOP AT itab_sbook into wa_sbook.
          Write  node_key.
               IF node_key = wa_sbook.
                  append wa_sbook to itab1_sbook.
               ENDIF.
        ENDLOOP.
      ENDMETHOD.                    "handle_double_click_tree
    ENDCLASS.                    "lcl_event_handler IMPLEMENTATION
    This is the code please help me now if you can
    Edited by: Gopal Kansal on Sep 25, 2009 10:34 AM
    Edited by: Gopal Kansal on Sep 25, 2009 10:35 AM
    Edited by: Gopal Kansal on Sep 25, 2009 10:37 AM

  • How to handle double click in a table control?

    Hi,
    Can any one let me how to handle double click event in a table control in dialog programming?
    here i need to navigate to another screen when user double click on the table contols (emp number column).
    thanks in advance,
    PrasadBabu.

    to define double click in your table controlwhich is similar to 'PICK' function. Enable F2 in PF-status for this
    Table Control Question
    Check the above thread which was posted recently on SDN, please award points if found helpful

  • Double Click event on table

    I need to allow selection of table row on double click - I implemented this functionality as suggested in article "http://technology.amis.nl/blog/3845/adf-11g-richfaces-handling-the-client-side-double-click-to-invoke-a-server-side-operation". I noticed the double click works fine if I click on any part of the row that is empty (without text). If i double click on the text that is displayed on the column cell - it just highlights the text and does not invoke Java script method for handling double-click event. I have set table 'rowselection' to 'single'. I am using Jdeveloper 11.1.5 and Firefox (3.1.16) browser.
    Any one else has experienced this issue, is there any solution for this.

    Thanks Timo for your response. I am seeing this odd behavior when using pageflowscope managed bean.
    1). I have a page (part of unbounded taskflow) that has commandlink which invokes a task flow as dialog (inline-popup):
    <?xml version='1.0' encoding='UTF-8'?>
    <jsp:root xmlns:jsp="http://java.sun.com/JSP/Page" version="2.1"
    xmlns:f="http://java.sun.com/jsf/core"
    xmlns:h="http://java.sun.com/jsf/html"
    xmlns:af="http://xmlns.oracle.com/adf/faces/rich">
    <jsp:directive.page contentType="text/html;charset=UTF-8"/>
    <f:view>
    <af:document id="d1" title="testw">
    <af:form id="f1">
    <af:panelGroupLayout id="pgl1">
    <af:commandLink text="Link"
    id="cl1" useWindow="true"
    immediate="true"
    windowHeight="500" windowWidth="600"
    windowEmbedStyle="inlineDocument"
    inlineStyle="text-align:left;"
    action="testflow"/>
    </af:panelGroupLayout>
    </af:form>
    </af:document>
    </f:view>
    </jsp:root>
    2). The inline popup has a table where I am using double click event on a row.
    <?xml version='1.0' encoding='UTF-8'?>
    <jsp:root xmlns:jsp="http://java.sun.com/JSP/Page" version="2.1"
    xmlns:f="http://java.sun.com/jsf/core"
    xmlns:h="http://java.sun.com/jsf/html"
    xmlns:af="http://xmlns.oracle.com/adf/faces/rich">
    <jsp:directive.page contentType="text/html;charset=UTF-8"/>
    <f:view>
    <af:document id="d1">
    <af:form id="f1" clientComponent="true">
    <af:table value="#{TestdblClick.list}" var="row"
    rowBandingInterval="0" id="t1" rowSelection="single"
    clientComponent="true" binding="#{TestdblClick.contactTable}"
    emptyText="no data" columnStretching="last">
    <af:clientListener method="dblkfunction" type="dblClick"/>
    <af:serverListener type="doubleClickOnRow"
    method="#{TestdblClick.doubleClick}"/>
    <af:clientListener method="singlelkfunction" type="selection"/>
    <af:serverListener type="singleClickOnRow"
    method="#{TestdblClick.singleClick}"/>
    <af:column sortable="false" headerText="Col1" align="start" id="c3"
    rowHeader="unstyled">
    <af:outputText value="#{row.col1}" id="ot1"/>
    </af:column>
    <af:column sortable="false" headerText="Col2" align="start" id="c2">
    <af:outputText value="#{row.col2}" id="ot3"/>
    </af:column>
    <af:column sortable="false" headerText="Col3" align="start" id="c1">
    <af:outputText value="#{row.col3}" id="ot2"/>
    </af:column>
    </af:table>
    </af:form>
    <f:facet name="metaContainer">
    <af:resource type="javascript">
    function dblkfunction(event) {
    var source = event.getSource();
    AdfCustomEvent.queue(source, "doubleClickOnRow",
    },false);
    function singlelkfunction(event) {
    var source = event.getSource();
    AdfCustomEvent.queue(source, "singleClickOnRow",
    false);
    </af:resource>
    </f:facet>
    </af:document>
    </f:view>
    </jsp:root>
    TestdblClick.java
    ====================
    public class TestdblClick {
    public TestdblClick() {
    private RichTable contactTable;
    private List<Testdata2> list = null;
    public List<Testdata2> getList() {
    this.list = new Vector<Testdata2>();
    Testdata2 t1 = new Testdata2 ("joe", "demaggio", "contact");
    Testdata2 t2 = new Testdata2 ("joe2", "demaggio2", "contact");
    Testdata2 t3 = new Testdata2 ("joe3", "demaggio3", "contact");
    list.add(t1);
    list.add(t2);
    list.add(t3);
    return list;
    public void setList(List<Testdata2> list) {
    this.list = list;
    public void singleClick(ClientEvent clientEvent)
    System.out.println("------single click------");
    public void doubleClick(ClientEvent clientEvent)
    System.out.println("------doubleclick------");
    public void setContactTable(RichTable contactTable) {
    this.contactTable = contactTable;
    public RichTable getContactTable() {
    return contactTable;
    If I make "TestdblClick" managed bean as request scope to handle double-click event it works fine, however if I make "TestdblClick" managed bean as pageflow scope (task flow) it does not work when double click is on a text within the table row. I am not sure why pageflowscope should impact the double-click behavior.

  • Handle single click event in ALV OOPS

    Hi,
    I have to display 2 ALV grid...one above the other.
    Top ALV will contain Header info and bottom ALV witll display line item.
    I am use ALV OOPS.
    Now when user will click on the top ALV ...bottom ALV should show corresponding data.
    I don't have to use HOTSPOT or Double click event.
    How can I handle single click event.
    Please guide me..thanks in advance
    Regards,
    Prasoon

    hi,
                    for this in ALV OOPS take <b>2 custom containers( cl_gui_custom_container)</b>in the same screen and on the 1st container display the header data<b>(use set_tale_for_first_display method of class cl_gui_alv_grid)</b>.
                   On the 2nd screen item data for  this  use<b> EVENT</b> handling(you want <b>single click</b>). use<b> hotspot_click</b> or <b>button_click </b>events. 
    for this you have to register the events.   the code for that.
    <b>CLASS lcl_event_handler DEFINITION .</b>
    PUBLIC SECTION .
    METHODS:
    *--Hotspot click control
    handle_hotspot_click
    FOR EVENT hotspot_click OF cl_gui_alv_grid
    IMPORTING e_row_id e_column_id es_row_no ,
    *--To control button clicks
    handle_button_click
    FOR EVENT button_click OF cl_gui_alv_grid
    IMPORTING e_oject e_ucomm .
    PRIVATE SECTION.
    ENDCLASS.
    <b>CLASS lcl_event_handlerIMPLEMENTATION .</b>
    *--Handle Hotspot Click
    METHOD handle_hotspot_click .
    PERFORM handle_hotspot_click USING e_row_id e_column_id es_row_no .
    ENDMETHOD .
    METHOD handle_button_click .
    PERFORM handle_button_click USING e_object e_ucomm .
    ENDMETHOD .
    ENDCLASS .
    DATA gr_event_handler TYPE REF TO lcl_event_handler .
    <b>*--Creating an instance for the event handler</b>
    CREATE OBJECT gr_event_handler.
    <b>*--Registering handler methods to handle ALV Grid events</b>
    SET HANDLER gr_event_handler->handle_hotspot_click FOR gr_alvgrid .
    SET HANDLER gr_event_handler->handle_button_click FOR gr_alvgrid .
    do n't forget to use<b> refresh_table_display
    </b> other wise only the record which you first you clicked will display in the 2nd container.
    <b>Reward points for useful Answers</b>

  • ALV OOPS Double-click event

    Hi,
    I want to handle the double-click event in ALV grid (OOPs).
    The output should be shown in the same fashion as it is shown in SE16 when we double-click on any record in the result set.
    i.e. if you have selected the ALV grid display for the Data browser in SE16 and when you double click on any record, the complete record is shown in a window.
    I want this in my ALV as well..
    Can anyone please suggest how to achieve this?
    Regards
    s.a.k

    Hi siemens.a.k ,
    The solution for the issue would be to create a  custom screen and add a custom table controller in a container.
    In this table controller you map the respective fields required for your output
    Now once you are done with data population in the custom controller for ALV grid display using cl_gui_alv_grid_display class...
    create events in your custom class to handle the on click event.
    If you observe the standard functionality it could be clearly seen that sap has created another screen for the display of records in different view.
    You could also replicate the similar thing by creating another screen and populating the required fields into the second screen.
    As of now i am providing this information ...I would even try to simulate the scenario at my system.
    So once i am done i would update you the same...
    Thanks
    M.Naveen Kumar....

  • ALV: Issue with double  click event after sorting the ALV

    Hello Experts,
    I have an internal table that populates an ALV grid. When the user doubleclicks a row, my method HANDLE_DOUBLE_CLICK returns the e_row-index value from the ALV Grid. I use this index value to read the internal table, then retrieve additional data.
    My problem is the user may sort the ALV grid before double clicking on a line. If this happens my internal table is not sorted to match the ALV grid, so reading the internal table with the e_row-index value returns the wrong information.
    When the double click event occurs, is it possible to capture the value in column 1 instead of a value for e_row-index?
    There is one more paramter in HANDLE_DOUBLE_CLICK for row id.   It is coming blank in debugging .  what is the purpose of this parameter and how i can make use of it ?
    Regards
    Vivek

    Hi,
    I am Posting The Code Which Uses Double Click Event.
    And This Code will provide the total information to you.
    REPORT  ZALVGRID_PG.
    TABLES: SSCRFIELDS.
    DATA: V_BELNR TYPE RBKP-BELNR.
    SELECTION-SCREEN BEGIN OF BLOCK B1 WITH FRAME TITLE TEXT-001.
    SELECT-OPTIONS: IRNO FOR V_BELNR.
    PARAMETERS: P_GJAHR TYPE RBKP-GJAHR.
    SELECTION-SCREEN END OF BLOCK B1.
    DATA: WA TYPE ZALVGRID_DISPLAY,
          ITAB TYPE STANDARD TABLE OF ZALVGRID_DISPLAY.
    DATA: IDENTITY TYPE REF TO CL_GUI_CUSTOM_CONTAINER.
    DATA: GRID TYPE REF TO CL_GUI_ALV_GRID.
    DATA: L_IDENTITY TYPE REF TO CL_GUI_CUSTOM_CONTAINER.
    DATA: L_TREE TYPE REF TO CL_GUI_ALV_TREE_SIMPLE.
    TYPE-POOLS: SLIS,SDYDO.
    DATA: L_LOGO TYPE SDYDO_VALUE,
          L_LIST TYPE SLIS_T_LISTHEADER.
    END-OF-SELECTION.
    CLASS CL_LC DEFINITION.
      PUBLIC SECTION.
        METHODS: DC FOR EVENT DOUBLE_CLICK OF CL_GUI_ALV_GRID IMPORTING E_ROW E_COLUMN.
    ENDCLASS.
    CLASS CL_LC IMPLEMENTATION.
      METHOD DC.
        DATA: WA1 TYPE ZALVGRID_DISPLAY.
        READ TABLE ITAB INTO WA1 INDEX E_ROW-INDEX.
        BREAK-POINT.
        SET PARAMETER ID 'BLN' FIELD WA1-BELNR.
        CALL TRANSACTION 'FB02'.
      ENDMETHOD.                    "DC
    ENDCLASS.
    DATA: OBJ_CL TYPE REF TO CL_LC.
    START-OF-SELECTION.
      PERFORM SELECT_DATA.
      IF SY-SUBRC = 0.
        CALL SCREEN 100.
      ELSE.
        MESSAGE E000(0) WITH 'DATA NOT FOUND'.
      ENDIF.
      INCLUDE ZALVGRID_PG_STATUS_0100O01.
      INCLUDE ZALVGRID_PG_LOGOSUBF01.
      INCLUDE ZALVGRID_PG_SELECT_DATAF01.
    INCLUDE ZALVGRID_PG_USER_COMMAND_01I01.
    ***INCLUDE ZALVGRID_PG_STATUS_0100O01 .
    MODULE STATUS_0100 OUTPUT.
      SET PF-STATUS 'AB'.
    *  SET TITLEBAR 'xxx'.
      IF IDENTITY IS INITIAL.
        CREATE OBJECT IDENTITY
        EXPORTING
          CONTAINER_NAME = 'ALVCONTROL'.
        CREATE OBJECT GRID
        EXPORTING
          I_PARENT = IDENTITY.
        CALL METHOD GRID->SET_TABLE_FOR_FIRST_DISPLAY
          EXPORTING
             I_STRUCTURE_NAME              = 'ZALVGRID_DISPLAY'
          CHANGING
            IT_OUTTAB                     = ITAB.
        CREATE OBJECT OBJ_CL.
        SET HANDLER OBJ_CL->DC FOR GRID.
        ENDIF.
        IF L_IDENTITY IS INITIAL.
          CREATE OBJECT L_IDENTITY
          EXPORTING
            CONTAINER_NAME = 'LOGO'.
          CREATE OBJECT L_TREE
          EXPORTING
            I_PARENT = L_IDENTITY.
          PERFORM LOGOSUB USING L_LOGO.
          CALL METHOD L_TREE->CREATE_REPORT_HEADER
            EXPORTING
              IT_LIST_COMMENTARY    = L_LIST
              I_LOGO                = L_LOGO.
          ENDIF    .
    ENDMODULE.                 " STATUS_0100  OUTPUT
    ***INCLUDE ZALVGRID_PG_LOGOSUBF01 .
    FORM LOGOSUB  USING    P_L_LOGO.
      P_L_LOGO = 'ERPLOGO'.
    ENDFORM.                    " LOGOSUB
    ***INCLUDE ZALVGRID_PG_SELECT_DATAF01 .
    FORM SELECT_DATA .
      SELECT RBKP~BELNR
             RBKP~BLDAT
             RSEG~BUZEI
             RSEG~MATNR
             INTO TABLE ITAB
             FROM RBKP INNER JOIN RSEG
        ON RBKP~BELNR = RSEG~BELNR
        WHERE RBKP~BELNR IN IRNO
        AND RBKP~GJAHR = P_GJAHR.
    ENDFORM.                    " SELECT_DATA
    ***INCLUDE ZALVGRID_PG_USER_COMMAND_01I01 .
    MODULE USER_COMMAND_0100 INPUT.
      CASE SY-UCOMM.
        WHEN 'EXIT'.
          LEAVE PROGRAM.
        WHEN 'CANCEL'.
           EXIT.
           ENDCASE.
    ENDMODULE.                 " USER_COMMAND_0100  INPUT
    Warm Regards,
    PavanKumar.G
    Edited by: pavankumar.g on Jan 19, 2012 5:30 AM

  • ALV Class Double click event

    Hi All,
    I have created an alv report using alv class. I have handled the double click event in that i am calling transaction using row currenlty selected. But after doing subtotalling the list and then i double click a line it is passing wrong data.
    Points are awarded,
    Regards,
    Bharat Mistry
    Message was edited by: Bharat Mistry

    Hi Bharat,
    Read the internal table contents in double click event with e_row-index , then you will get the data of that particular row.
    check below code :
    local class to handle semantic checks
    CLASS lcl_event_receiver DEFINITION DEFERRED.
    DATA: g_event_receiver TYPE REF TO lcl_event_receiver.
    LOCAL CLASS Definition
    *§4.Define and implement event handler to handle event DATA_CHANGED.
    CLASS lcl_event_receiver DEFINITION.
      public section.
        METHODS:
          handle_double_click
                 FOR EVENT double_click OF cl_gui_alv_grid
                 IMPORTING e_row e_column.
    ENDCLASS.
    CLASS lcl_event_receiver IMPLEMENTATION.
      METHOD handle_double_click.
      read table gt_outtab index e_row-index into
    Regards
    Appana
    *Reward Points for helpful answers
    Message was edited by: L Appana

  • In ALV reports how double click event works?

    in ALV reports how double click event works? Explain in detail.....

    hi,
    last lines is used for clicking
    *& Report  Z_SWAS_FUNCTIONAL
    report  z_swas_functional.
    tables: qmel,viqmel,iloa,afko.
    -- global data declerations--
    data: ok_code like sy-ucomm,
          gt_itab type table of zfunctional,
          t_output type table of zfunctional,
          g_container type scrfname value 'CUSTOM_CONTROL',
          grid1  type ref to cl_gui_alv_grid,
          g_custom_container type ref to cl_gui_custom_container,
          e_row type lvc_s_row,
          e_column type lvc_s_col,
          es_row_no type lvc_s_roid.
    *CLASS DECLARATION
    class z_functional definition.
    public section.
    class-methods : handle_double_click
                    for event double_click of cl_gui_alv_grid
                         importing e_row  e_column.
    endclass.
    *CLASS IMPLEMENTATION
    class z_functional implementation.
    method handle_double_click.
           perform handle_double_click using e_row e_column es_row_no.
    endmethod.
    endclass.
    *CODE FOR SELECTION SCREEN
    selection-screen begin of block 84433  with frame title text-t01.
    parameters : n_number like viqmel-qmnum,
                    n_type like qmel-qmart,
                    f_loca like iloa-tplnr,
                    name like qmel-qmnam.
    selection-screen end of block 84433.
                        screen validation event                          *
    at selection-screen on n_number.
      select single *
        from viqmel
          where qmnum eq n_number.
    if sy-subrc ne 0.
      MESSAGE 'NOTIFICATION NUMBER DOESNOT EXIST' TYPE 'E'.
    endif.
    select qmart from qmel into qmel where qmart eq N_TYPE.
    endselect.
    if sy-subrc ne 0.
      MESSAGE 'NOTIFICATION TYPE DOES NOT EXIST' TYPE 'E'.
    endif.
    *START OF SELECTION EVENT
    start-of-selection.
        perform fetchdata.
    end-of-selection.
    *Call screen event
    call screen 100.
    *PERFORM DISPLAY.
    *&      Form  FETCHDATA
          text
    -->  p1        text
    <--  p2        text
    form fetchdata .
    *SELECT VIQMEL~QMNUM VIQMEL~QMTXT VIQMEL~QMDAT VIQMEL~LTRMN VIQMEL~PRIOK
          VIQMELBEZDT VIQMELAUFNR VIQMELTPLNR AFKOGLTRP into corresponding fields of table GT_ITAB
             FROM VIQMEL INNER JOIN AFKO ON VIQMELAUFNR = AFKOAUFNR
                   WHERE VIQMELQMNUM IN N_NUMBER and VIQMELQMART IN N_TYPE AND VIQMEL~QMNAM IN NAME.
    call function 'ZSWAS_TEST'
      exporting
        qmnum         = n_number
       qmart         = n_type
       tplnr         = f_loca
       qmnam         = name
      tables
        output        = gt_itab
    if sy-subrc ne 0.
       message e000(z84433_msg_class).
    endif.
    endform.                    " FETCHDATA
    *&      Module  STATUS_0100  OUTPUT
          text
    module status_0100 output.
      set pf-status 'MAIN'.
    SET TITLEBAR 'xxx'.
    *creating custom container and grid instance
    if g_custom_container is initial.
        create object g_custom_container
               exporting container_name = g_container.
        create object grid1
               exporting i_parent = g_custom_container.
        call method grid1->set_table_for_first_display
          exporting
            i_structure_name = 'ZFUNCTIONAL'
          changing
            it_outtab        = gt_itab.
    *set handler events
        set handler z_functional=>handle_double_click for grid1.
      endif.
    endmodule.                 " STATUS_0100  OUTPUT
    *&      Module  USER_COMMAND_0100  INPUT
          text
    module user_command_0100 input.
    case ok_code.
       when 'EXIT'.
        perform exit_program.
    endcase.
      clear ok_code.
    endmodule.                 " USER_COMMAND_0100  INPUT
    *&      Form  EXIT_PROGRAM
          text
    -->  p1        text
    <--  p2        text
    form exit_program .
    leave program.
    endform.                    " EXIT_PROGRAM
    *&      Form  handle_double_click
          text
         -->P_E_ROW  text
         -->P_E_COLUMN  text
         -->P_ES_ROW_NO  text
    form handle_double_click  using   e_row type lvc_s_row
                                      e_column type lvc_s_col
                                      es_row_no type lvc_s_roid.
    data: t_output type  zfunctional.
        read table gt_itab into t_output index e_row-index .
      if sy-subrc = 0 and e_column-fieldname eq 'QMNUM'.
        set parameter id 'K01' field t_output-qmnum.
        call transaction 'ZSMART' and skip first screen .
      endif.
    endform.                    " handle_double_click
    regards,
    swaroop.

Maybe you are looking for

  • Bootcamp problem please help

    Hi, I've been having this problem for weeks now. I was able to intall windows 7 using bootcamp, which I did numerous times with my previous macs. Today, I wiped my harddrive, and fresh installed OSX and windows 7 everything went perfect up to the poi

  • Delete Adjacent Records in DTP execuetion

    Hi , I just want to delete adjacent records while loading DTP ,since Start routine logic was incorporated. Adjacent Records are not getting deleted because of the comparison takes place in different data packages. Pls. let me know if u have some idea

  • How do i reset or find out my itunes/app store security code?

    i forgot my itunes/appstore sercirity code, how do i reset or find out what it was?

  • Automate Saving Process to two PDFs

    I am trying to figure out a way to make expedite saving a file into two separate PDFs with separate settings. One needs to be CMYK, All layers flattened, All blacks to 100 black (Adjustments, Selective Color, Black), saved to a PDF with no compressio

  • JRockit Management Console - Exception Count

    Hello, I'm using jrockit-j2sdk1.4.2_04. I download the JRA from: /wljrockit/docs142/JRA.zip. I started the Management Server with Tomcat 5.0. After starting the management console the exception count continuously increases one per second (approx). Is