Skip to content

ABAP Keyword Documentation →  ABAP Programming Guidelines →  Architecture →  User Interfaces 

Lists

Other versions: 7.31 | 7.40 | 7.54

Background

A list is a medium used for the structured and formatted output of data. The following lists are available in ABAP:

  • Classical lists, which are written to a list buffer using ABAP statements and displayed on a special list dynpro.
  • Output of the SAP List Viewer (ALV), which is displayed in GUI controls during the processing of classical dynpros. You access ALV lists via classes, such as CL_SALV_TABLE (non-hierarchically tabular lists), CL_SALV_HIERSEQ_TABLE (hierarchically sequential lists), or CL_SALV_TREE (hierarchically tabular lists).

Classical lists are the only option to send ABAP data from ABAP programs directly to the SAP spool system as print lists. If you use SAP List Viewer, the lists that are displayed in the viewer are automatically converted to classical spool lists during printing.

Rule

Use SAP List Viewer

Do not use classical lists. If you still deploy dynpro-based, classical UI technologies, you should use the SAP List Viewer (ALV) or other GUI control-based technologies instead of classical lists in productive programs.

Details

Using classical lists is no longer recommended for the following reasons:

  • The processing of lists is based on global data and events of the ABAP runtime environment.
  • The list buffer that is used for classical lists is bound to an executable program or a dynpro sequence and not to classes and objects.
  • It is almost impossible to separate presentation logic and application logic when writing to lists.
  • The UI of a classical list is not standardized and thus usually not accessible.

The concept of classical lists is therefore mostly incompatible with the ABAP Objects concept, and you cannot encapsulate classical lists in function groups as easily as classical dynpros and selection screens.

While the application developer must ensure accessibility in classical lists with a great deal of effort, the ALV lists automatically comply with the accessibility requirements because the ALV already provides the required services, such as user-specific settings.

Exception

Small helper programs that are not intended for live use in application systems can continue to use classical lists for system-related console output. The WRITE list statement here assumes the same role as System.out.println(...) in Java or printf in C.

In cases in which an ALV output seems to be overdimensioned, you can also deploy other means, such as Textedit Control or Browser Control (or its wrapping in dynamic documents) for the formatted output of non-tabular content. As before, it is up to you to ensure accessibility here.

Bad example

Executing the program DEMO_CLASSICAL_REPORTING results in a classical list output. However, according to the above rule, using classical lists in application programs is no longer recommended.

Good example

Executing the program DEMO_ALV_REPORTING results in ALV lists with the same content and the same functionality as the classical lists in the previous example. ALV lists replace classical lists in those cases in which classical dynpros are still used.