Skip to Content
0

Trigger event on alv volum header click - click_col_header

Nov 07, 2016 at 01:49 PM

122

avatar image

I want to trigger an even on ALV column header click.I used the event click_col_header of

cl_gui_alv_grid an But its not triggering.

capture.png

CLASS lcl_event_receiver DEFINITION INHERITING FROM cl_gui_alv_grid.
 PUBLIC SECTION.
 INTERFACES:
 if_alv_rm_grid_friend.
 METHODS:

 handle_double_click_capex
          FOR EVENT double_click OF cl_gui_alv_grid
          IMPORTING e_row
                   e_column,

 handle_hotspot_capex FOR EVENT hotspot_click OF cl_gui_alv_grid
                   IMPORTING e_row_id
                           e_column_id
                              es_row_no,
 handle_data_changed_capex FOR EVENT data_changed OF cl_gui_alv_grid
                         IMPORTING er_data_changed,
 handle_toolbar_capex FOR EVENT toolbar OF cl_gui_alv_grid
                      IMPORTING e_object,
 handle_user_command_capex FOR EVENT user_command OF cl_gui_alv_grid
                     IMPORTING e_ucomm.

 PROTECTED SECTION.
 METHODS:
 handle_click_col_header_capex FOR EVENT click_col_header OF cl_gui_alv_grid
                    IMPORTING col_id.


 PRIVATE SECTION.
 DATA:ls_stbl TYPE lvc_s_stbl,
 ls_mod_cells TYPE lvc_s_modi.
 CLASS-DATA:
 lv_row_id TYPE lvc_s_row,
 lv_col_id TYPE lvc_s_col.
ENDCLASS. "lcl_event_receiver DEFINITION
 SET HANDLER capex_event_receiver->handle_click_col_header_capex FOR lr_capex_grid.
 METHOD handle_click_col_header_capex.
  BREAK-POINT.
 ENDMETHOD.
capture.png (3.7 kB)
10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

2 Answers

Raymond Giuseppi
Nov 07, 2016 at 03:38 PM
0

Any reason to add the method in protected section, hoping to be allowed to use a protected event of the standard class thru inheritance (you didn't redefine method dispatch)

Isn't the click on header used to sort data from value of the column (layout fieldsgl_clk_hd) so triggers function code '&SORT' (cl_gui_alv_grid=>mc_fc_sort), you could try to intercept this function code in a public event like before_user_command (so no need to inherit from standard class)

Regards,
Raymond

Show 2 Share
10 |10000 characters needed characters left characters exceeded

Hi Raymond,

I tired SGL_CLK_HD in layout as you suggest.But i need to get the column id as well.

Thanks,

Noufal

0

Did you try a call of GET_CURRENT_CELL (which will execute protected method GET_CURRENT_CELL_ROW)

Regards,
Raymond

0
Monalisa Biswal Nov 07, 2016 at 06:34 PM
0
hi Check if after setting SGL_CLK_HD field in layout would work. Thanks, Mona
Share
10 |10000 characters needed characters left characters exceeded