1. DESCRIBE
LIST NUMBER OF LINES lin.
2.
DESCRIBE LIST NUMBER OF PAGES n.
3.
DESCRIBE LIST LINE lin PAGE pag.
4. DESCRIBE LIST PAGE pag.
Returns the attributes of a list. All variants have the addition ...
INDEX idx
allowing you to determine the attributes of a particular list level (SY-LSIND
= 0,1,2,3,... ). All of the values returned in the following variants have the type I.
You should use this key word only in exceptional cases (e.g. when editing an 'anonymous' list in a program
other than that which generated the list). In all other cases, you should save the relevant values when
you generate the list.
Take care when attempting to retrieve the list attributes being set up (
...INDEX SY-LSIND), since some attributes (number of pages, number of lines, ...) may not have been updated yet.
DESCRIBE LIST NUMBER OF LINES lin.
Returns the number of lines in the list.
The Return Code is set as follows:
... INDEX idx
Returns the attributes of the list level idx (0, 1,2,3,...).
After line selection, determine the number of lines in the displayed list:
DATA: LN LIKE SY-PAGNO. ...
AT LINE-SELECTION.
DESCRIBE LIST NUMBER OF LINES LN.
The variable LN now contains the number of lines in the displayed list.
DESCRIBE LIST NUMBER OF PAGES n.
Returns the number of pages in the list.
The Return Code is set as follows:
... INDEX idx
Returns the attributes of the list level idx (0, 1,2,3,...).
After line selection, determine the number of pages in the displayed list:
DATA: PN LIKE SY-PAGNO. ...
AT LINE-SELECTION.
DESCRIBE LIST NUMBER OF PAGES PN.
The variable PN now contains the number of pages in the
displayed list (i.e. the contents of the system field SY-PAGNO after the list has been generated!).
DESCRIBE LIST LINE lin PAGE pag.
Returns the number of the page for the line lin in the list.
In interactive reporting, line selection causes a value to be assigned to the system field
SY-LILLI (absolute number of selected list line). The system
field SY-CPAGE contains the page number for the first
displayed line in the list. The selected line does not have to belong to this page (in cases where several
pages are displayed at the same time). The page number may be of interest even with direct reading of
lines (see READ LINE).
The Return Code is set as follows:
... INDEX idx
Returns the attributes of the list level idx (0, 1,2,3,...).
After line selection, determine the page number for the selected line (SY-LILLI):
DATA: PAGENUMBER LIKE SY-PAGNO. ...
AT LINE-SELECTION.
DESCRIBE LIST LINE SY-LILLI PAGE PAGENUMBER.
The variable PAGENUMBER now contains the page number for
the line SY-LILLI (i.e. the contents of the system field
SY-PAGNO when outputting the line SY-LILLI!).
DESCRIBE LIST PAGE pag
1. ...
INDEX idx
2. ...
LINE-SIZE col
3. ...
LINE-COUNT lin
4. ...
LINES lin
5. ...
FIRST-LINE lin
6. ...
TOP-LINES lin
7. ...
TITLE-LINES lin
8. ...
HEAD-LINES lin
9. ... END-LINES lin
Returns the attributes of the page pag in the list.
The Return Code is set as follows:
Addition 1 ... INDEX idx
Returns the attributes of the list level idx (0, 1,2,3,...).
... LINE-SIZE col
Returns the line length for the page pag (see NEW-PAGE...LINE-SIZE).
... LINE-COUNT lin
Returns the permitted number of lines for the page pag (see NEW-PAGE...LINE-COUNT).
... LINES lin
Returns the number of lines output on the page pag.
... FIRST-LINE lin
Returns the absolute line number of the first line of the page pag.
... TOP-LINES lin
Returns the number of lines output by page header processing (i.e. standard title + column headers + TOP-OF-PAGE).
... TITLE-LINES lin
Returns the number of lines output as standard title lines by page header processing (see NEW-PAGE...NO-TITLE/WITH-TITLE).
The value of TITLE-LINES is contained in TOP-LINES.
... HEAD-LINES lin
Returns the number of lines output as column headers by page header processing (see NEW-PAGE...NO-HEADING/WITH-HEADING).
The value of HEAD-LINES is contained in TOP-LINES.
... END-LINES lin
Returns the number of lines reserved for end-of-page processing (see END-OF-PAGE).
Determine the number of lines output on the third page of the basic list (SY-LSIND = 0) in the event TOP-OF-PAGE:
DATA: TOP TYPE I,
HEAD TYPE I,
TITLE
TYPE I,
REAL_TOP TYPE I.
DESCRIBE LIST INDEX 0 PAGE
3
TOP-LINES TOP
HEAD-LINES HEAD
TITLE-LINES TITLE.
REAL_TOP = TOP - TITLE - HEAD.
Determine the absolute number of lines in the displayed list:
DATA: LN TYPE I, "number of lines
on a page
FLN TYPE I, "number
of first line on a page
PN TYPE I, "number
of a page
LIST_LINES TYPE I. "total number of lines in list
Determine number of last page:
DESCRIBE LIST NUMBER OF PAGES PN.
Determine number of first line of last page and number of lines on that page:
DESCRIBE LIST PAGE PN FIRST-LINE FLN LINES LN.
Number of list lines = number of first line of last page + number of lines - 1.
LIST_LINES = FLN + LN - 1.
Or: Count lines of all pages in a loop:
CLEAR LIST_LINES.
DO PN TIMES.
DESCRIBE LIST PAGE SY-INDEX LINES LN.
ADD LN TO LIST_LINES.
ENDDO.
or:
DESCRIBE LIST NUMBER OF LINES LIST_LINES.
Transferring Attributes ofLists