Skip to Content
0
Sep 14, 2023 at 06:33 AM

3 methodes in one class

100 Views Last edit Sep 14, 2023 at 06:46 AM 2 rev

Hello Experts, Im trying to call 3 methodes in one class. so i habe a report wich is SALV and there is 3 cells each one should be clickable. one with link_click and the others with double_click.

TERMN : link_click

LIGHT : double_click

Bearbeiter: double_click_pool

this how should it be but in my case Light calls double_click and double_click_pool when i click on it.

Bearbeiter calls link_click.

could u guys help or tell me where my problem is?

class def. 
CLASS lcl_handle_events DEFINITION.
PUBLIC SECTION.
METHODS:
on_double_click
FOR EVENT double_click OF cl_salv_events_table
IMPORTING
row
column .
METHODS: on_link_click FOR EVENT link_click OF
cl_salv_events_table
IMPORTING row column.
METHODS:
on_double_click_pool
FOR EVENT double_click OF cl_salv_events_table
IMPORTING
row
column .
ENDCLASS.
here where i create the objekt
SET HANDLER event_handler->on_link_click FOR gr_events.
lr_column ?= lr_columns->get_column( 'TERMN' ).
lr_column->set_cell_type( if_salv_c_cell_type=>hotspot ).


 CREATE OBJECT event_handler.
SET HANDLER event_handler->on_double_click FOR gr_events. lr_column ?= lr_columns->get_column( 'LIGHT' ). lr_column->set_cell_type( if_salv_c_cell_type=>hotspot ). CREATE OBJECT event_handler. SET HANDLER event_handler->on_double_click_pool FOR gr_events. lr_column ?= lr_columns->get_column( 'BEARBEITER' ). lr_column->set_cell_type( if_salv_c_cell_type=>hotspot ). lr_salv->display( ). Implement cLASS lcl_handle_events IMPLEMENTATION. METHOD on_double_click. #logic ENDMETHOD. METHOD on_link_click. #logic METHOD on_double_click_pool. #logic ENDMETHOD. ENDCLASS.