SAP Function SCROLLING_IN_TABLE - Scroll internal tables according to SAP Style Guide

Parameter Reference Type Length Default Optional Text
ENTRY_ACT SYST-TABIX I 4 0 X Starting index
ENTRY_FROM SYST-TABIX I 4 1 X Start of table substructure
ENTRY_TO SYST-TABIX I 4 End of table substructure
LAST_PAGE_FULL 0 'X' X Indicator whether last page is full
LOOPS SYST-TABIX I 4 Number of entries per page
OK_CODE 0 SPACE X Function code for scroll operation
OVERLAPPING 0 SPACE X Indicator for overlapping scrolling
PAGE_ACT SYST-TABIX I 4 0 X Start page
PAGE_GO SYST-TABIX I 4 0 X Target page

Parameter Reference Type Length Text
ENTRIES_SUM SYST-TABIX I 4 Total number of entries of the table (sub-) structure
ENTRY_NEW SYST-TABIX I 4 Index of first entry to be output
PAGES_SUM SYST-TABIX I 4 Total no. of pages
PAGE_NEW SYST-TABIX I 4 Page scrolled to

Exception Text
NO_ENTRY_OR_PAGE_ACT no start index or page specified
NO_ENTRY_TO End of table substructure is zero
NO_OK_CODE_OR_PAGE_GO no function code or target page specified

Functionality
This function module supports scrolling in table structures accordingto the SAP R/3 standards (for more information please refer to theSAP Style Guide).
It is assumed that scrolling in internal tables is performed usingan index and an internal table.This function module does not perform scrolling directly but determinesthe index of the first table line to be output.
The following scrolling modes are supported:
- Scrolling with overlapp ,,(OVERLAPPING = 'X')
- Scrolling without overlap ,,(OVERLAPPING = ' ')
- Fill last page ,,(LAST_PAGE_FULL = 'X')
- Fill last page acc. to page ,,(LAST_PAGE_FULL = ' ')
You can define substructure within a table structure. A substructureis part of a table structure that allows scrolling. For example, thisis the case when several logical lists are stored in an internal tableand a list is displayed which should allow scrolling.
The scroll operation can be performed by going to a specific page orrelative to the starting point.

Example
DATA: FIRSTLINE LIKE SY-TABIX,
* Number of the first line issued
START LIKE SY-TABIX,
* Beginning of table substructure
MAXLINES LIKE SY-TABIX,
* Total no. of output lines
LOOPS LIKE SY-TABIX,
* No. of lines on the screen or of the STEP loop
CODE(4) TYPE C
* Possible values: 'P++', 'P+'; 'P+', 'P-', 'P--', ' '
PAGE_NUMBER LIKE SY-TABIX
* Current page no.
ENTRIES_SUM LIKE SY-TABIX
* Total no. of entries
PAGE_SUM LIKE SY-TABIX
* Total no. of pages
NEW_PAGE_NUMBER LIKE SY-TABIX.
* Target page no.
a) If scrolling is possible only page-wise
CALL FUNCTION 'SCROLLING_IN_TABLE'
EXPORTING
ENTRY_ACT = FIRSTLINE
ENTRY_FROM = START
ENTRY_TO = MAXLINES
LAST_PAGAE_FULL = ' '
LOOPS = LOOPS
OK_CODE = CODE
OVERLAPPING = ' '
* PAGE_ACT = PAGE_NUMBER
* can be specified instead of ENTRY_ACT
* PAGE_GO = NEW_PAGE_NUMBER
* can be specified instead of OK_CODE
IMPORTING
ENTRIES_SUM = ENTRIES_SUM
ENTRY_NEW = FIRSTLINE
PAGE_SUM = PAGE_SUM
PAGE_NEW = NEW_PAG_NUMBER
EXCEPTIONS
NO_ENTRY_OR_PAGE_ACT = 01
NO_ENTRY_TO = 02
NO_OK_CODE_OR_PAGE_GO = 03.
b) if positioning to individual entries is possible
CALL FUNCTION 'SCROLLING_IN_TABLE'
EXPORTING
ENTRY_ACT = FIRSTLINE
ENTRY_FROM = START
* if a substructure is used
ENTRY_TO = MAXLINES
LAST_PAGE_FULL = 'X'
LOOPS = LOOPS
OK_CODE = CODE
OVERLAPPING = 'X'
IMPORTING
ENTRIES_SUM = ENTRIES_SUM
* if a substructure is used
ENTRY_NEW = FIRSTLINE
EXCEPTIONS
NO_ENTRY_OR_PAGE_ACT = 01
NO_ENTRY_TO = 02
NO_OK_CODE_OR_PAGE_GO = 03.

Notes

  • If OVERLAPPING = 'X' applies, you can scroll once more from the last
  • page filled to a page containing only the last entry of the last page.This is necessary, for example, when the module is used in a casewhere inserting should be possible.
    • All exceptions are generated with RAISE and must be handled by the
    • calling program.

      Further information
      For more information about scrolling in table structures please referto the SAP Style Guide.

      Description
      The parameter contains the number of entries of the table structureor substructure the user is scrolling through.

      Description
      The parameter contains the index of the first entry to be output.

      Description
      The parameter specifies the number of pages in which you canpage.

      Description
      The parameter contains the scroll destination page number.

      Description
      The number of the current first output line is passed in the parameter.
      Alternatively the current page can be passed to the parameter PAGE_ACT.

      Value range
      Values between ENTRY_FROM and ENTRY_TO are valid. No check is made.

      Default
      By default, both PAGE_ACT and ENTRY_ACT have the values 0.At least one of the two parameters must be specified (and not be zero).

      Description
      This parameter only has to be specified when sub-structures are used.It specifies the index at which the sub-structurebegins.

      Value range
      Values smaller than ENTRY_TO are valid. No check is made.

      Default
      The parameter has the default value 1.

      Description
      This paramter determines the index at which the tabular structureor sub-structure ends.

      Value range
      Values greater than ENTRY_FROM are valid. No check is made.

      Default
      The parameter has no default, it must be specified.

      Description
      This parameter indicates whether the last page should be completelyfilled up when it is called.

      Value range
      'X',,= fill last page completely
      '',,= last page in paging sequence

      Default
      By default, the last page is completely filled.

      Description
      This parameter contains the number of records which are to be outputper page.

      Default
      The parameter has no default value, it must be specified.

      Description
      The parameter controls paging operations.

      Value range
      'P',,first page
      'P-',,previous page
      'P+',,next page
      'P++',,last page
      '',,paging by absolute page number specification
      ,,in this case, the absolute destination page number
      ,,must be passed to the parameter PAGE_GO.

      Default
      The parameter OK_CODE has the default value ' '.

      Description
      The parameter indicates whether the pages should be displayedoverlapping.
      Overlapping means that the last entry on the current page isthe first entry on the new page.

      Value range
      'X',,with overlapping
      ' ',,without overlapping

      Default
      Paging is without overlapping by default.

      Description
      This parameter passes the page number of the current page
      Alternatively, the current first output line can also be passed to theparameter ENTRY_ACT.

      Default
      Both PAGE_ACT and ENTRY_ACT have the default value 0. At least one ofthese two parameters must be specified and not be zero.

      Description
      The parameter contains the absolute destination page number.
      Alternatively the paging operation can also be controlled via theparameter OK_CODE.

      Default
      PAGE_GO has the default value 0.