Posts

Using SALV (object oriented model) has many advantages:

  • Simplified design: This Model uses a highly integrated object oriented design which provides the simplicity to programmers to develop the ALV.
  • Unified Object models: This model has only one main class which will get and set the parameters of entire layout.

All Classes has static method FACTORY which will get back the instance of the ALV. Like for the simple table dispaly we must call the method CL_SALV_TABLE=>FACTORY to get the instance of the ALV.

SALV class

SALV class

 

Simple case to display table:

DATA lo_salv TYPE REF TO cl_salv_table.
TRY.
cl_salv_table=>factory(
IMPORTING
r_salv_table = lo_salv
CHANGING
t_table = lt_sflight ).
CATCH cx_salv_msg INTO lx_msg.
ENDTRY.

lo_salv->display( ).

Add standard PF Status

DATA: lo_functions TYPE REF TO cl_salv_functions_list.
lo_functions = co_salv->get_functions( ).
lo_functions->set_default( abap_true ).