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

Lists

Background

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

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

Rule

Use SAP List Viewer

Do not use classical lists. If dynpro-based, classical UI technologies are still used, SAP List Viewer (ALV) or other GUI control-based technologies should be used instead of classical lists in production programs.

Details

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

The concept of classical lists is therefore mostly incompatible with the ABAP Objects concept, and classical lists cannot be encapsulated 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, other methods are possible, such as Textedit Control or Browser Control (or its wrapping in dynamic documents) for the formatted output of non-tabular content. As before, accessibility must be guaranteed here.

Note

For simple console output, XML-based output streams can also be used. An example of this is shown by the class CL_DEMO_OUTPUT_STREAM. The class CL_DEMO_OUTPUT demonstrates possible applications of this class. It is used in programs in the ABA Example Library.

Bad example

Executing the program DEMO_CLASSICAL_REPORTING produces 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 produces ALV lists with the same content and the same functions as the classical lists in the previous example. ALV lists replace classical lists in those cases in which classical dynpros are still used.