Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Get object ALV selected in tabstrip with several objects ALV.

edson_suzuki
Explorer
0 Kudos

  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

1 ACCEPTED SOLUTION

raymond_giuseppi
Active Contributor
0 Kudos

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

4 REPLIES 4

nikolayevstigneev
Contributor
0 Kudos

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.

raymond_giuseppi
Active Contributor
0 Kudos

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

0 Kudos

  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

rosenberg_eitan
Active Contributor
0 Kudos

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: