How To Activate functions like Filter, Sort, Layout etc in OO ALV

 How To Activate functions like Filter, Sort, Layout etc in OO ALV

To activate the ALV tool bar functions we have to call get_functions from ALV instance and call method set_all with abap_true.

REPORT ztest_ppk.

DATA: lo_alv   TYPE REF TO cl_salv_table.


DATA: lo_functions TYPE REF TO cl_salv_functions_list.


START-OF-SELECTION.

  SELECT * FROM spfli INTO TABLE @DATA(lt_spfli).

  IF sy-subrc IS INITIAL.

    cl_salv_table=>factory(
      IMPORTING
        r_salv_table   = lo_alv
      CHANGING
        t_table        = lt_spfli[]
    ).

    lo_functions = lo_alv->get_functions( ).

    lo_functions->set_all( abap_true ).

    lo_alv->display( ).

  ENDIF.

Output:


Post a Comment

Previous Post Next Post