ARTICLE
Lists - Overview
Lists as Screens
By default, classic list (or lists for short) are
screens , which do not contain screen elements
in their display area, but text output defined with ABAP statements
instead. Lists are displayed as part of a special
list dynpro , which is a component of the
list processor system program.
Lists in ABAP Programs
An ABAP program can process multiple lists, which are stored in one or
more list buffers . Each time a
dynpro sequence is called, a new list
buffer is opened and assigned to this dynpro sequence. A single list
buffer can contain up to 21 lists: one basic list and 20 details lists.
A list index is assigned to each list, and this index organizes the
lists in the list buffer in hierarchical list levels. The first list of
a list buffer is the basic list with list index 0. All other lists,
whose list indexes are increased continuously starting at 1, are details
lists.
The output statements of an ABAP program write to the current list,
whose list index is determined by the sy-lsind system field. The
current list after the call of a dynpro sequence is the basic list. As
long as the basic list is not displayed, no other list levels can be
created.
Basic List
The basic list is displayed either implicitly during the processing of
an executable program (see SUBMIT ) or
explicitly using the LEAVE TO
LIST-PROCESSING statement. In both cases, the list processor is
called, which then sends the list to the list dynpro. Displaying this
list closes it in the list buffer. It can no longer be written to, but
it can be read or modified.
Detail Lists
Every user action on a displayed list, which triggers a list event for
which an event block is defined in the
ABAP program, creates a new details list. The list index of this details
list is always one more than the list index of the list on which the
event was triggered. This index is contained in the sy-listi
system field. The output statements of the event block write to the
current details list. If the event block is finished normally, the
details list is displayed automatically in the list dynpro.
User actions on displayed lists can cause a stack of up to 20 details
lists to be created in the list buffer. The list with the highest list
index ( sy-lsind ) is always the current list of the ABAP program,
while the list with the list index one below the highest (
sy-listi
) is displayed on the screen. In certain list processing statements,
the list index can be used to access all lists within the stack for
reading or changing.
The details list stack in a list buffer can be reduced in two ways:
A user action on a displayed details list is linked to function code
"BACK" . This function code causes the previous list to be
displayed and reduces the value of sy-lsind by 1. In the basic
list, "BACK" causes the current dynpro sequence to be exited.
Within an event block for a list event, a value is assigned to the
system field sy-lsind . If the value of sy-lsind after the
event block is closed is smaller than the list index of the current list
and greater than or equal to 0, then the current list replaces the list
of this list level and all lists whose list index is greater than the
value of sy-lsind are deleted from the list buffer. Other values
of sy-lsind are reset to the index of the current list after the
event block is closed.
Structure of a List
A list is made up of list rows with a fixed width of up to 1023
characters. The row width of the current list is stored in the
sy-linsz system field. The number of rows of a list is limited only
by the storage capacity of the system.
A list is divided into pages. Every list starts on page 1. The current
page of the current list is stored in the sy-pagno system field.
The output position on the current page in the list buffer is determined
by the list cursor, which is provided in the system fields sy-colno
(column) and sy-linno (row). A page can contain a maximum of
60000 rows. The number of rows per page is stored for the current list
in the sy-linct system field. The value 0 represents the maximum
number of rows per page.
On every page of a list, rows can be used for a page header and a page
footer. The rows of the page header of the basic list are by default
filled with a standard page header from the text elements of the ABAP
program. The standard page header consists of a standard title and can
contain column headings. The standard title is fixed so that it does not
disappear when the page is scrolled vertically on the screen.
In the list event TOP-OF-PAGE , the page
header can be filled with additional rows. The page footer can only be
filled only in the list event END-OF-PAGE
. The entire page header of the list displayed on top is fixed so that
it does not move when the page is scrolled vertically. The column
headings of the standard page header and the rows filled in
TOP-OF-PAGE are moved when the page is scrolled horizontally.
Spool Lists
The lists in the list buffer are screen lists. Their content is
displayed in the list dynpro after an implicit call of the list proc
essor in an executable program or
after an explicit call using LEAVE TO LIST-PROCESSING .
When lists are created, there is also the option of excluding individual
pages or all pages of one or more lists from the screen display and to
send them to the SAP spool system instead. This is done using the
addition PRINT ON of the statement
NEW-PAGE . All these pages together then form
the spool list.
See also Spooling Lists .
Characters in lists
Any character supported by the current
system codepage can be displayed in a list. The prerequisite here is
that a codepage or a font is defined in the output medium (GUI,
printer), into which the characters can be converted. Control characters
for line breaks or tabs are ignored in strings and cannot be displayed.
Nicht darstellbare Zeichen, d.h. Steuerzeichen und nicht konvertierbare
Zeichen, erscheinen in der Listenausgabe wie das Zeichen # .
Beispiel
The program
DEMO_CHARACTERS_IN_LISTS shows the current display of all
characters that are assigned to the hexadecimal codes "0000" to
"FFFF" in the current codepage.
Lists and ABAP Objects
The list processing statements covered in this section are based on
global data and events of the runtime environment and are no longer
completely supported in ABAP Objects and when using ABAP Objects.
Lists and Unicode
When a list is displayed or spooled, the contents stored in the list
buffer are copied to the list, with the following differences between
non-Unicode and Unicode systems :
In non-Unicode systems , every character requires as much space in
the list buffer as columns on the list. In single-byte systems, a
character occupies one byte in the list buffer and one column in the
list, while a character that occupies several bytes in the list buffer
in multi-byte systems also occupies the same number of columns in the
list. For this reason, all the characters stored in the list buffer are
displayed in the list in non-Unicode systems.
In Unicode systems , every character usually occupies one place in
the list buffer. On the list, however, a character can occupy more than
one column (especially Eastern Asian characters). However, since the
list only contains the same number of columns as there are positions in
the list buffer, this means the list can only display fewer characters
than are stored in the list buffer. The list output is shortened
accordingly (the page is displayed according to the
alignment ) and is flagged ( or
). On a displayed list, the entire list content can be
displayed by choosing System - List - Unicode Display .
For these reasons, the horizontal position of the list cursor is equal
to the output column of a displayed or spooled list only in non-Unicode
systems. In Unicode systems, this is only guaranteed for the top and
bottom output limits.
Documentation extract taken from SAP system, � Copyright SAP AG. All rights reserved