SAP ABAP Syntax for Describe part Six

This post is in continuation with SAP ABAP SYNTAX FOR DESCRIBE PART FIVE.

Variant 4

DESCRIBE LIST PAGE pag

Additions


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

Effect

Returns the attributes of the page pag in the list.

The return code value is set as follows:


SY-SUBRC = 0 OK
SY_SUBRC = 4 Page does not exist
SY-SUBRC = 8 List does not exist

Addition 1

... INDEX idx

Effect

Returns the attributes of the list level idx (0, 1,2,3,...).

Addition 2

... LINE-SIZE col

Effect

Returns the line length for the page pag.

Addition 3

... LINE-COUNT lin

Effect

Returns the permitted number of lines for the page pag .

Addition 4

... LINES lin

Effect

Returns the number of lines output on the page pag .

Addition 5

... FIRST-LINE lin

Effect

Returns the absolute line number of the first line of the page pag .

Addition 6

... TOP-LINES lin

Effect

Returns the number of lines output by page header processing (i.e. standard title + column headers + TOP OF PAGE ).

Addition 7

... TITLE-LINES lin

Effect

Returns the number of lines output as standard title lines by page header processing .

Note

The value of TITLE-LINES is contained in TOP-LINES .

Addition 8

... HEAD-LINES lin

Effect

Returns the number of lines reserved for end-of-page processing .

Example

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.

Examples

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.

RELATED POST
SAP ABAP SYNTAX FOR DESCRIBE PART FIVE

No comments :

Post a Comment