ALV with IDA(ALVonHANA)-13

alv-ida

Toolbar in ALV

 

 

Program to display ALV.

12

We can display/hide the standard toolbar buttons.

3

Output- Few buttons are invisible.

4

It is also possible to hide all the toolbar fields.

5

Output- No standard toolbar buttons.

6

Code: We can add a new button 0n the toolbar ans also handle its selection/click


CLASS lcl_handle_button_click DEFINITION.
  PUBLIC SECTION.
  METHODShandle FOR EVENT function_selected OF if_salv_gui_toolbar_ida
                  IMPORTING ev_fcode.
ENDCLASS.

CLASS lcl_handle_button_click IMPLEMENTATION.
  METHOD handle.
    CASE ev_fcode.
      WHEN ‘DELE’.
       MESSAGE ‘DELETE BUTTON CLICKED’ TYPE ‘I’.
      WHEN OTHERS.
    ENDCASE.
  ENDMETHOD.
ENDCLASS.

START-OF-SELECTION.
DATAlr_salv TYPE REF TO if_salv_gui_table_ida.
DATAlr_toolbar TYPE REF TO if_salv_gui_toolbar_ida.
DATAlr_handle TYPE REF TO lcl_handle_button_click.

cl_salv_gui_table_ida=>create(
  EXPORTING
    iv_table_name       =  ‘SFLIGHT’
  RECEIVING
    ro_alv_gui_table_ida lr_salv ).

lr_toolbar lr_salv->toolbar).
lr_toolbar->add_button(
  EXPORTING
    iv_fcode     ‘DELE’
    iv_icon      =  ‘@11@’ “‘ICON_DELETE’
    iv_quickinfo ‘Delete’ ).
CREATE OBJECT lr_handle.
SET HANDLER lr_handle->handle FOR ALL INSTANCES.
lr_salv->fullscreen)->display).


Output:

78


 

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