ALV with IDA(ALVonHANA)-10

alv-idaEnabling Double Click event & Handling 

 

 

 

Interface IF_SALV_GUI_TABLE_IDA provides method  DISPLAY_OPTIONS  which returns the reference of interface IF_SALV_GUI_TABLE_DISPLAY_OPT to enable double click event.

12

Interface IF_SALV_GUI_TABLE_DISPLAY_OPT  provides events DOUBLE_CLICK 

3

Event parameters.

4

To enable double click on the UI interface IF_SALV_GUI_TABLE_DISPLAY_OPT provides method ENABLE_DOUBLE_CLICK

5

The event parameters returns reference to the interface  IF_SALV_GUI_ROW_DATA_IDA which provides method GET_ROW_DATA to read the values of the double clicked row.

67

Code:


CLASS lcl_handle_dc DEFINITION.
  PUBLIC SECTION.
  METHODS double_click
        FOR EVENT double_click OF if_salv_gui_table_display_opt
        IMPORTING ev_field_name eo_row_data.
ENDCLASS.

CLASS lcl_handle_dc IMPLEMENTATION.
  METHOD double_click.
    DATAls_sflight TYPE sflight.
   CHECK ev_field_name ‘CARRID’.
* read the row data
   eo_row_data->get_row_data(
     EXPORTING
       iv_request_type if_salv_gui_selection_ida=>cs_request_typeall_fields
     IMPORTING
       es_row ls_sflight ).
* Display the row data
cl_salv_ida_show_data_row=>displayiv_text ‘Flight Row Info’ is_data ls_sflight ).
  ENDMETHOD.
ENDCLASS.

START-OF-SELECTION.
DATAlr_salv TYPE REF TO if_salv_gui_table_ida,
      lr_handle TYPE REF TO lcl_handle_dc.
cl_salv_gui_table_ida=>create(
  EXPORTING
    iv_table_name       =  ‘SFLIGHT’
  RECEIVING
    ro_alv_gui_table_ida lr_salv ).

DATA(lr_displr_salv->display_options).
* Enable double click
lr_disp->enable_double_click).
CREATE OBJECT lr_handle.
SET HANDLER lr_handle->double_click FOR ALL INSTANCES.

* Display ALV
lr_salv->fullscreen)->display).


8

Output: Double click on a row.

910


 

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s