Quantcast
Channel: SCN: Message List
Viewing all articles
Browse latest Browse all 8635

Re: ALV OO: select a cell(icon in the cell) in a report.

$
0
0

if you have used the cl_salv_table class then you can add doubleclick by declaring your local class as an eventhandler.

 

CLASS lcl_handle_events DEFINITION.

   PUBLIC SECTION.

     METHODS: on_double_click FOR EVENT double_click

                              OF cl_salv_events_table

                              IMPORTING row column.

ENDCLASS. "lcl_handle_events DEFINITION


DATA: event_handler TYPE REF TO lcl_handle_events.

DATA: gr_events TYPE REF TO cl_salv_events_table.


    gr_events = gr_table->get_event( ).

     CREATE OBJECT event_handler.

     SET HANDLER event_handler->on_double_click FOR gr_events.

 

In the local class implementation you do something like:

 

CLASS lcl_handle_events IMPLEMENTATION.

   METHOD on_double_click.


READ TABLE gt_output INTO wa_output INDEX row.  ( row is the line clicked)

if sy-subrc = 0.

case column (column is the cell within the line you have clicked)

when 'ICON' ( if that is your field name you used in your ALV structure)

...and do your thing here (execute function)

endcase.

 

etcetera


Viewing all articles
Browse latest Browse all 8635

Trending Articles