ABAP ABAP GRID List Viewer (ALV) Creating and Displaying an ALV

30% OFF - 9th Anniversary discount on Entity Framework Extensions until December 15 with code: ZZZANNIVERSARY9


This example portrays the most simple ALV creation using the cl_salv_table class and no additional formatting options. Additional formatting options would be included after the TRY ENDTRY block and before the alv->display( ) method call.

All subsequent examples using the ABAP Objects approach to ALV creation will use this example as a starting point.

DATA: t_spfli       TYPE STANDARD TABLE OF spfli,
      alv           TYPE REF TO cl_salv_table,
      error_message TYPE REF TO cx_salv_msg.

" Fill the internal table with example data
SELECT * FROM spfli INTO TABLE t_spfli.

" Fill ALV object with data from the internal table
        r_salv_table = alv
        t_table      = t_spfli ).
  CATCH cx_salv_msg INTO error_message.
    " error handling

" Use the ALV object's display method to show the ALV on the screen
alv->display( ).

Got any ABAP Question?