Pages

Tuesday, August 31, 2010

Normal ALV class Design-Events double click and top-end of page

********************************************************************
* ABAP Name: ZZSCPR044_INMRP_EXCP_CLASS
* Created by: Agnihotro Sinha
* Created on: 08/12/2010.
* Version: 1.0
*------------------------------------------------------------------*
* Modification Log:
* Date Programmer Correction Description
*
********************************************************************

************************************************************************
* Class declarations
************************************************************************
CLASS lcl_event_handler DEFINITION FINAL.
* event receiver definitions for ALV actions
PUBLIC SECTION.
*** Any Event with PREFIX as 'PRINT' is connected to ALV List Display
*** and also gthe event need not be registered with ALV Object
METHODS:
* Handle List output Top-Of-Page
on_top_of_page
FOR EVENT print_top_of_page OF cl_gui_alv_grid,
*Handle grid Top_Of_Page
on_grid_top_of_page
FOR EVENT TOP_OF_PAGE OF cl_gui_alv_grid
IMPORTING
e_dyndoc_id,
* Handle List End of Page
on_end_of_page
FOR EVENT print_END_OF_LIST OF cl_gui_alv_grid,
* Handle Double Click
handle_double_click
FOR EVENT double_click OF cl_gui_alv_grid
IMPORTING e_row e_column.
ENDCLASS. "lcl_event_receiver DEFINITION
************************************************************************

CLASS lcl_event_handler IMPLEMENTATION.

* Create the Text to be dispalyed at top of page of ALV List Output
METHOD on_grid_top_of_page.
* top-of-page event for grid Display
PERFORM event_top_of_page USING e_dyndoc_id.
ENDMETHOD. "On_top_of_page

* Create Top_Of_Page display for ALV Grid Output
METHOD on_top_of_page.
* Will be hit only when ALV List Display is called
PERFORM display_list_top.
* e_dyndoc_id = obj_dyndoc_id.
ENDMETHOD. "create_top_of_page
* Create End of Page for List Display
METHOD on_end_of_page.
PERFORM display_list_end.
ENDMETHOD.
* Handle user command for Double Click
METHOD handle_double_click.

* read selected row from internal table gt_sflight
READ TABLE gt_mat INDEX e_row-index INTO wa_mat.
IF sy-subrc eq 0.
PERFORM f_drill_down USING wa_mat e_column.
ENDIF.


ENDMETHOD. "handle_user_command
ENDCLASS. "lcl_event_receiver IMPLEMENTATION

No comments:

Post a Comment