ARTIClE
Table Control with Scrolling
This example demonstrates program driven scrolling in table controls.
ABAP_SOURCE_CODE
ABAP_EXEC
ABAP_DESCRIPTION
The table control flights is defined and can be resized .
The fields of the table control are copied from the DEMO_CONN
structure in the ABAP Dictionary. The first two columns are lead
columns. The corresponding fields are output fields. A title list,
column headers, and a selection column are available. The selection
column is assigned component MARK , of type CHAR , length 1,
from the structure
DEMO_CONN . One column and multiple rows can be selected.
In the flow logic of screen 100, one loop is executed in the PBO
and another in the PAI using the table control flights . In
the PBO loop, a module is called to fill the table control from
table itab of the ABAP program. In the PAI loop, a module
is called to modify table itab .
Before the PBO loop, the current number of rows in the internal
table itab in the component lines of the control structure
flights is stored in the status_0100 module. This means
the system can set up the scroll bar properly.
In the PBO loop, in the fill_table_control module, work
area demo_conn is filled with values from the internal table; the
row index corresponds to the actual table control row.
In the PAI loop, in the read_table_control module, the
current number of loops sy-loopc in the table control is stored
in an auxiliary variable. This number depends on the screen size. The
row of the internal table with the row index that corresponds to the
current table control row is overwritten by the contents of the work
area demo_conn . In this way, user entries in the input fields of
the control are copied to the internal table. A flag is set in the
column MARK of the internal table indicating whether the table
control row is selected or not.
After the PAI loop, the user entries are processed in module
user_command_0100 . The GUI status SCREEN_100 enables the
corresponding function codes. It is possible to scroll vertically and
horizontally, and to jump to the first or last page. Scrolling is
enabled by setting component top_line of the control structure
flights . For horizontal scrolling, the auxiliary variable filled
in the PAI loop using sy-loopc is used as the increment.
Documentation extract taken from SAP system, � Copyright SAP AG. All rights reserved