The ABAP List Viewer (ALV) is a powerful reporting tool in SAP that displays data in a structured grid or table format. It comes with many built-in features such as sorting, filtering, subtotals, totals, column resizing, and even options to export reports to Excel or PDF—all without the need for additional coding. ALV reports are highly user-friendly, enabling business users to analyze and work with data in a way that feels similar to Excel. From a development perspective, ALV can be easily implemented using standard function modules or object-oriented classes like CL_SALV_TABLE, making it both efficient for developers and convenient for end users.
Code:
REPORT ztest_program_2.
*— Internal Table & Workarea
DATA: gt_mara TYPE TABLE OF mara,
gs_mara TYPE mara.
*— Select Data
SELECT * FROM mara INTO TABLE gt_mara UP TO 50 ROWS.
*— Display Using SALV
DATA lo_alv TYPE REF TO cl_salv_table.
cl_salv_table=>factory(
IMPORTING
r_salv_table = lo_alv
CHANGING
t_table = gt_mara ).
lo_alv->display( ).
Ouput: