02-25-2015 5:22 PM
I'm building a screen with tabstrip and several objects ALV, I create a event hotspot to use in all objects, I would like to know if is possible at moment of click in the row identify what object ALV was used.
Regards
Suzuki
02-26-2015 7:11 AM
Every event handler can receive the SENDER parameter, with this one you can switch between objects
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 sender,
(...)
CLASS lcl_event_receiver IMPLEMENTATION.
METHOD handle_double_click.
CASE sender.
WHEN grid51.
me->doubleclickedgrid1( index = e_row-index column = e_column).
WHEN grid2.
(...)
(Just replace double-click with hotspot event.)
Regards,
Raymond
02-26-2015 6:21 AM
Hi!
If you mean that you have an ALV on every tab and you want to distinguish between them - then yes, sure you can. For example, like that:
CASE tabstrip-activetab.
WHEN 'TAB01'.
la-la-la.
WHEN 'TAB02'.
la-la-la.
.....................
ENDCASE.
02-26-2015 7:11 AM
Every event handler can receive the SENDER parameter, with this one you can switch between objects
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 sender,
(...)
CLASS lcl_event_receiver IMPLEMENTATION.
METHOD handle_double_click.
CASE sender.
WHEN grid51.
me->doubleclickedgrid1( index = e_row-index column = e_column).
WHEN grid2.
(...)
(Just replace double-click with hotspot event.)
Regards,
Raymond
02-26-2015 6:57 PM
Raymond, thanks for your answer, will be easy to me using this parameter SENDER, I didn't know about this parameter.
thanks for all others replies.
Regards
Suzuki
02-26-2015 7:40 AM
Hi,
If you need hotspot .
Option 1 .
You can define multiple event receiver classes. Each one will handle a different ALV .
You will have multiple objects.
Option 2 .
You can define one event receiver class .
In the constructor pass a constant to be used later in the events .
You will have multiple objects .
Regards .
Code fragments for option 2 .
In the class:
At top:
At pbo: