*----------------------------------------------------------------------*
* Name of the program: *
* *
* Purpose: Include program for Y_CLASSES_ALV_EDIT_BUTTON *
*----------------------------------------------------------------------*
* Author : JATIN SINGHAL *
* Date : 06.04.2014 *
* Ref Doc : *
* TR No. : *
*----------------------------------------------------------------------*
*----------------------------------------------------------------------*
* MODIFICATION HISTORY - Oldest on Top *
*----------------------------------------------------------------------*
* Date Transport No. Person Comments *
*----------------------------------------------------------------------*
* mm/dd/yyyy XXXXXXX ******** ******** *
* *
*----------------------------------------------------------------------*
DATA : o_cust TYPE REF TO cl_gui_custom_container,
o_alv TYPE REF TO cl_gui_alv_grid,
it_mara TYPE TABLE OF mara,
wa_mara TYPE mara,
gt_fcat TYPE lvc_t_fcat,
gs_layo TYPE lvc_s_layo,
ok_code TYPE sy-ucomm.
DATA: t_mat LIKE mara-matnr,
variant TYPE disvariant,
gv_matnr type matnr.
*DATA : ty_toolbar TYPE stb_button.
DATA : e_object TYPE REF TO cl_alv_event_toolbar_set,
io_alv_toolbar TYPE REF TO cl_alv_event_toolbar_set.
data: i_modified TYPE STANDARD TABLE OF mara,"For getting modified rows
w_modified TYPE mara.
CLASS lcl_event_handler DEFINITION .
PUBLIC SECTION .
METHODS:
*--Double-click control
handle_double_click
FOR EVENT double_click OF cl_gui_alv_grid
IMPORTING e_row e_column es_row_no.
PRIVATE SECTION.
ENDCLASS. "lcl_event_handler DEFINITION
DATA gr_event_handler TYPE REF TO lcl_event_handler .
*----------------------------------------------------------------------*
* CLASS lcl_event_handler IMPLEMENTATION
*----------------------------------------------------------------------*
CLASS lcl_event_handler IMPLEMENTATION .
*--Handle Double Click
METHOD handle_double_click .
PERFORM handle_double_click USING e_row e_column es_row_no .
ENDMETHOD . "handle_double_click
ENDCLASS . "lcl_event_handler IMPLEMENTATION
CLASS cl_event_receiver DEFINITION.
PUBLIC SECTION.
METHODS handle_data_changed
FOR EVENT data_changed OF cl_gui_alv_grid
IMPORTING e_ucomm.
* er_data_changed
* e_onf4
* e_onf4_before
* e_onf4_after
ENDCLASS. "cl_event_receiver DEFINITION
CLASS cl_event_receiver IMPLEMENTATION.
METHOD handle_data_changed.
* BREAK-POINT.
*data: lt_index type LVC_T_ROW,
* lt_row type LVC_T_ROID.
DATA i_selected_rows TYPE lvc_t_row.
o_alv->check_changed_data( ).
CALL METHOD o_alv->get_selected_rows
IMPORTING
et_index_rows = i_selected_rows.
* et_row_no = lt_row.
* WHAT FUNCTION CAUSED THIS EVENT???
ENDMETHOD. "handle_data_changed
ENDCLASS. "cl_event_receiver IMPLEMENTATION
*CLASS lcl_events_d0100 DEFINITION DEFERRED.
DATA: "event_receiver1 TYPE REF TO lcl_events_d0100,
event_receiver TYPE REF TO cl_event_receiver,
i_selected_rows TYPE lvc_t_row, "Selected Rows
w_selected_rows TYPE lvc_s_row,
i_inserted_rows TYPE lvc_t_row,
w_inserted_rows TYPE lvc_s_row,
i_deleted_rows TYPE lvc_t_row,
W_deleted_rows TYPE lvc_S_row.
*TYPE-POOLS : CNDP.
Select-OPTIONS : s_matnr for gv_matnr.
*CLASS lcl_events_d0100 DEFINITION.
***
** PUBLIC SECTION.
**
** METHODS handle_toolbar_set
** FOR EVENT toolbar OF cl_gui_alv_grid
** IMPORTING
** e_object
** e_interactive."---user command on clicking a button
**
* METHODS handle_user_command.
* FOR EVENT user_command OF cl_gui_alv_grid
* IMPORTING e_ucomm sender.
* ENDMETHOD.
* ENDCLASS. "lcl_events_d0100 DEFINITIONTYPE-POOLS cndp.
*
*
*
*
*
*CLASS lcl_events_d0100 IMPLEMENTATION.
**
** METHOD handle_toolbar_set.
** ty_toolbar-function = 'SAVE'. "name of btn to catch click
** ty_toolbar-butn_type = 0.
** ty_toolbar-text = 'SAVE'.
** ty_toolbar-icon = 'icon_save_row'.
** APPEND ty_toolbar TO e_object->mt_toolbar.
**
** ENDMETHOD. "handle_toolbar_set
**
* METHOD handle_user_command.
** DATA: wr_data_changed TYPE REF TO cl_alv_changed_data_protocol.
*
* perform delete_row .
** Perform save_database.
** CALL METHOD o_alv->REFRESH_TABLE_DISPLAY.
** ENDCASE.
**
** ENDMETHOD. "handle_user_commandENDCLASS.
**ENDCLASS.
* Name of the program: *
* *
* Purpose: Include program for Y_CLASSES_ALV_EDIT_BUTTON *
*----------------------------------------------------------------------*
* Author : JATIN SINGHAL *
* Date : 06.04.2014 *
* Ref Doc : *
* TR No. : *
*----------------------------------------------------------------------*
*----------------------------------------------------------------------*
* MODIFICATION HISTORY - Oldest on Top *
*----------------------------------------------------------------------*
* Date Transport No. Person Comments *
*----------------------------------------------------------------------*
* mm/dd/yyyy XXXXXXX ******** ******** *
* *
*----------------------------------------------------------------------*
DATA : o_cust TYPE REF TO cl_gui_custom_container,
o_alv TYPE REF TO cl_gui_alv_grid,
it_mara TYPE TABLE OF mara,
wa_mara TYPE mara,
gt_fcat TYPE lvc_t_fcat,
gs_layo TYPE lvc_s_layo,
ok_code TYPE sy-ucomm.
DATA: t_mat LIKE mara-matnr,
variant TYPE disvariant,
gv_matnr type matnr.
*DATA : ty_toolbar TYPE stb_button.
DATA : e_object TYPE REF TO cl_alv_event_toolbar_set,
io_alv_toolbar TYPE REF TO cl_alv_event_toolbar_set.
data: i_modified TYPE STANDARD TABLE OF mara,"For getting modified rows
w_modified TYPE mara.
CLASS lcl_event_handler DEFINITION .
PUBLIC SECTION .
METHODS:
*--Double-click control
handle_double_click
FOR EVENT double_click OF cl_gui_alv_grid
IMPORTING e_row e_column es_row_no.
PRIVATE SECTION.
ENDCLASS. "lcl_event_handler DEFINITION
DATA gr_event_handler TYPE REF TO lcl_event_handler .
*----------------------------------------------------------------------*
* CLASS lcl_event_handler IMPLEMENTATION
*----------------------------------------------------------------------*
CLASS lcl_event_handler IMPLEMENTATION .
*--Handle Double Click
METHOD handle_double_click .
PERFORM handle_double_click USING e_row e_column es_row_no .
ENDMETHOD . "handle_double_click
ENDCLASS . "lcl_event_handler IMPLEMENTATION
CLASS cl_event_receiver DEFINITION.
PUBLIC SECTION.
METHODS handle_data_changed
FOR EVENT data_changed OF cl_gui_alv_grid
IMPORTING e_ucomm.
* er_data_changed
* e_onf4
* e_onf4_before
* e_onf4_after
ENDCLASS. "cl_event_receiver DEFINITION
CLASS cl_event_receiver IMPLEMENTATION.
METHOD handle_data_changed.
* BREAK-POINT.
*data: lt_index type LVC_T_ROW,
* lt_row type LVC_T_ROID.
DATA i_selected_rows TYPE lvc_t_row.
o_alv->check_changed_data( ).
CALL METHOD o_alv->get_selected_rows
IMPORTING
et_index_rows = i_selected_rows.
* et_row_no = lt_row.
* WHAT FUNCTION CAUSED THIS EVENT???
ENDMETHOD. "handle_data_changed
ENDCLASS. "cl_event_receiver IMPLEMENTATION
*CLASS lcl_events_d0100 DEFINITION DEFERRED.
DATA: "event_receiver1 TYPE REF TO lcl_events_d0100,
event_receiver TYPE REF TO cl_event_receiver,
i_selected_rows TYPE lvc_t_row, "Selected Rows
w_selected_rows TYPE lvc_s_row,
i_inserted_rows TYPE lvc_t_row,
w_inserted_rows TYPE lvc_s_row,
i_deleted_rows TYPE lvc_t_row,
W_deleted_rows TYPE lvc_S_row.
*TYPE-POOLS : CNDP.
Select-OPTIONS : s_matnr for gv_matnr.
*CLASS lcl_events_d0100 DEFINITION.
***
** PUBLIC SECTION.
**
** METHODS handle_toolbar_set
** FOR EVENT toolbar OF cl_gui_alv_grid
** IMPORTING
** e_object
** e_interactive."---user command on clicking a button
**
* METHODS handle_user_command.
* FOR EVENT user_command OF cl_gui_alv_grid
* IMPORTING e_ucomm sender.
* ENDMETHOD.
* ENDCLASS. "lcl_events_d0100 DEFINITIONTYPE-POOLS cndp.
*
*
*
*
*
*CLASS lcl_events_d0100 IMPLEMENTATION.
**
** METHOD handle_toolbar_set.
** ty_toolbar-function = 'SAVE'. "name of btn to catch click
** ty_toolbar-butn_type = 0.
** ty_toolbar-text = 'SAVE'.
** ty_toolbar-icon = 'icon_save_row'.
** APPEND ty_toolbar TO e_object->mt_toolbar.
**
** ENDMETHOD. "handle_toolbar_set
**
* METHOD handle_user_command.
** DATA: wr_data_changed TYPE REF TO cl_alv_changed_data_protocol.
*
* perform delete_row .
** Perform save_database.
** CALL METHOD o_alv->REFRESH_TABLE_DISPLAY.
** ENDCASE.
**
** ENDMETHOD. "handle_user_commandENDCLASS.
**ENDCLASS.
No comments:
Post a Comment