Passing Data by Program Statements
To pass individual output fields or additional information from a line to the corresponding processing block during an interactive event, use these statements:
-
HIDE
The HIDE statement is one of the fundamental statements for interactive reporting. You use the HIDE technique when creating a basic list. It defines the information that can be passed to subsequent detail lists.
-
READ LINE
Use the statements READ LINE and READ CURRENT LINE to read data from the lines of existing list levels. These statements are closely connected to the HIDE technique.
-
GET CURSOR
Use the statements GET CURSOR FIELD und GET CURSOR LINE to pass the output field or output line on which the cursor was positioned during the interactive event to the ABAP program.
-
DESCRIBE LIST
The DESCRIBE LIST statement allows you to import certain list attributes, such as the number of lines or pages, into program variables.
In the following sections you will find examples of the individual statements. The exact description of the respective syntax is available in the keyword documentation.
The HIDE Technique
The example below presents some of the essential features of interactive reporting. The basic list contains summarized information. With the HIDE technique, it is possible to branch to more detailed information on subsequent lists.
Reading Lines from Lists
All of the lists generated by a single program are stored internally in the system. You can therefore access any list in a program that was created for the same screen and that has not yet been deleted by returning to a lower list level. To read lines, use the statements READ LINE and READ CURRENT LINE.
To read a line from a list after an interactive list event, use the statement: READ LINE ...
To read a line twice in succession, use: READ CURRENT LINE ...
This statement reads a line read before by an interactive event (F2) or by READ LINE.
Reading Lists at the Cursor Position
To retrieve information about the current cursor position in an interactive event, use the GET CURSOR statement. You can retrieve information either about the current field or the current line.
For field information, use the variant:
GET CURSOR FIELD ...
For field information, use the variant:
GET CURSOR LINE ...
Determining the Attributes of Lists
If you need to know the attributes of list levels that were not stored in system variables during list creation, you can use the DESCRIBE LIST statement.
To retrieve the number of lines or pages of a list, use:
DESCRIBE LIST NUMBER OF LINES|PAGES n ...
To get the page number of a particular line number, use:
DESCRIBE LIST LINE lin PAGE pag ...
To get the properties of a particular page, use:
DESCRIBE LIST PAGE pag ...
Use DESCRIBE LIST for completed lists only, since for lists in creation (index is sy-lsind) some properties are not up to date.