SAP ABAP Syntax for Describe part five
Variant 2
DESCRIBE LIST NUMBER OF PAGES n.
Addition
... INDEX idx
Effect
Returns the number of pages in the list.
The return code value is set as follows:
SY-SUBRC = 0 OK
SY-SUBRC <> 0 List does not exist (only with the addition INDEX )
Addition
... INDEX idx
Effect
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!).
Variant 3
DESCRIBE LIST LINE lin PAGE pag.
Addition
... INDEX idx
Effect
Returns the number of the page for the line lin in the list.
Note
SY-SUBRC = 0 OK
SY_SUBRC = 4 Line does not exist
SY-SUBRC = 8 List does not exist
Addition
... INDEX idx
Effect
Returns the attributes of the list level idx (0, 1,2,3,...).
Example
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 !).



0 comments:
Post a Comment