SAP ABAP show / view a table. Using ALV

Use the following code to view a table inside of an ABAP program.

SELECT * FROM spfli INTO TABLE @data(itab) UP TO 100 ROWS.DATA: go_alv TYPE REF TO cl_salv_table.CALL METHOD cl_salv_table=>factory
IMPORTING
r_salv_table = go_alv
CHANGING
t_table = itab.
go_alv->display( ).

The program assume you have a table “spfli” from the example database usal used in the SAP environment. If not just replace with any other table name.

I hope it helped. Happy coding.

--

--