Reading Internal Tables

Use

The number of selected entries in the internal table can differ. Therefore, you must print the table in your form line by line. To do this, create either a table node or a loop node in your form:

  • The table node, unlike the loop node, allows you to define a table layout. It you want to print one internal table as a table in the form, use the table node.
  • If you need data from several internal tables that all depend on one another, you can use the loop node to access the second internal table (see: Combining Loops and Tables).

To access internal tables you use the Data tab, which exists for loop nodes as well as for table nodes. The procedure below therefore applies for both node types. On the Data tab, you can also specify sort criteria.

Prerequisites

You created a table or loop node in the navigation tree.

Procedure

  1. In the global definitions create a work area for your internal table. You can also use a field symbol. If you pass the table at the form interface using the Tables tab, you need no work area because these tables automatically have a header line.

    Field symbols point to the current line instead of copying it into a work area. If you display very wide tables, this method increases performance considerably.

  2. Got to the Data tab of your loop or table node and mark Internal Table .

    Otherwise the loop is deactivated. For table nodes this makes sense, because you can use the layout of the node without any loop.

  3. Enter the name of the internal table you passed at the form interface.
  4. Enter the assignment type ( INTO or ASSIGNING ) and a work area (structure with the same type as the table line or the field symbol). If you use a table with header line, as work area specify the internal table name again.
  5. If desired, use the input fields Line and To to limit the lines of the internal table you want to read.
  6. Use the group box WHERE Condition to select a particular part of the data in the internal table. Describe the conditions as you do on the Conditions tab.

Result

At runtime, the data is selected according to your settings. After processing the loop, the output area contains the last selected entry (or the field symbol points to this entry, respectively). In the node within the loop you can access the current work area and display the fields of the work area. For both the loop and the table node, these are their inferior nodes. You can set the output events for the header and footer areas in more details (see also: Processing Loops and Tables).