SAP ABAP show / view a table. Using ALV

Dr. Viktor Walter-Tscharf1 MIN. LESEZEIT

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.