What ALV gives you for free, the three implementation styles, and how to build and adjust a field catalog.
Contents
ALV (ABAP List Viewer) displays internal tables as tables. Any reporting in ABAP will use it.
What you get without writing it
Column sorting, filtering, rearranging and resizing
Automatic subtotals and totals
Export to Excel, CSV and PDF
Saved display layouts (variants)
Row selection and double-click navigation
Print layout
Three implementations
Approach
Entry point
Character
Recommended?
Function module
REUSE_ALV_GRID_DISPLAY
Classic, verbose
Legacy
CL_GUI_ALV_GRID
Control based
Fine control, more code
For complex needs
CL_SALV_TABLE
SALV
Concise, covers most needs
Yes
A minimal SALV report
Displaying a table
DATA lo_alv TYPE REF TO cl_salv_table.
SELECT matnr, mtart, meins FROM mara
INTO TABLE @DATA(lt_mara) UP TO 100 ROWS.
TRY.
cl_salv_table=>factory(
IMPORTING r_salv_table = lo_alv
CHANGING t_table = lt_mara ).
lo_alv->get_functions( )->set_all( abap_true ).
lo_alv->get_columns( )->set_optimize( abap_true ).
lo_alv->display( ).
CATCH cx_salv_msg INTO DATA(lx_msg).
MESSAGE lx_msg->get_text( ) TYPE 'E'.
ENDTRY.
ALV allows users to freely customize column order and filters.
Quiz 3
What is the mechanism called that defines ALV display columns?
Quiz 4
Which class is recommended for ALV output in new development?
Quiz 5
REUSE_ALV_GRID_DISPLAY is a class-based ALV implementation.
Quiz 6
Arrange the implementation steps for displaying ALV using CL_SALV_TABLE.
Click items in the correct order
Hear when the paid version launches
A paid version is in preparation, with no ads, saved learning progress and many more practice questions. Leave your email and you will be told when it launches.
Your email address is used only to announce the paid version.