Vous êtes sur la page 1sur 20

IBM Global Services

2005 IBM Corporation Table Control | 6.15 March-2005


Table Control
IBM Global Services
2005 IBM Corporation 2 March-2005 Table Control | 6.15
Objectives
The participants will be able to:
Know the advantages of using a table control
Create a table control in the Graphical Screen painter
Setting attributes of the Table Control
Paint fields for the table control
Adding title to a table control
Discuss about field selection column of a table control
Program the processing of a table control
Understand the field transport mechanism in the table control
Create table control variants
IBM Global Services
2005 IBM Corporation 3 March-2005 Table Control | 6.15
Table Control
Display data in tabular form.
User configurable.
Change multiple lines of a table
together.
Vertical/horizontal scrollbars.
Choose any number of key
(leading) columns to be fixed.
Cell attributes can be modified
during runtime.
Storing and loading of user-
specific column layout.
Fixed Leading
Columns
Automatic horizontal/vertical scrolling
Change/save table settings
Change column width
Mark columns/rows
IBM Global Services
2005 IBM Corporation 4 March-2005 Table Control | 6.15
Table Control (Contd.)
Display data in tabular form.
User configurable.
Change multiple lines of a table
together.
Vertical/horizontal scrollbars.
Choose any number of key
(leading) columns to be fixed.
Cell attributes can be modified
during runtime.
Storing and loading of user-
specific column layout.
Fixed Leading
Columns
Automatic horizontal/vertical scrolling
Change/save table settings
Change column width
Mark columns/rows
IBM Global Services
2005 IBM Corporation 5 March-2005 Table Control | 6.15
Creating a Table Control
IBM Global Services
2005 IBM Corporation 6 March-2005 Table Control | 6.15
Creating a Table Control
In the Screen Element Attributes window, assign a
name to the table control and set initial (static)
attributes.

Some attributes are With column headers, Resizing,
Separators, With title, Line selection column, No of
fixed columns etc.
IBM Global Services
2005 IBM Corporation 7 March-2005 Table Control | 6.15
Creating Table Control Fields
IBM Global Services
2005 IBM Corporation 8 March-2005 Table Control | 6.15
Creating Table Control Fields (Contd.)
IBM Global Services
2005 IBM Corporation 9 March-2005 Table Control | 6.15
Adding a table title
IBM Global Services
2005 IBM Corporation 10 March-2005 Table Control | 6.15
When creating a table control, the
system automatically proposes a
selection column.
A selection column allows users to
choose a line of the table control.
The selection column elements
behave like a checkbox.
The field name must be entered in the
attributes of the table control.
Creating Table Control: Fields Selection Column
IBM Global Services
2005 IBM Corporation 11 March-2005 Table Control | 6.15
Creating Table Control
Declare CONTROLS statement
with type TABLEVIEW.
The user can modify the Table
Control attributes at runtime.
Use REFRESH
CONTROL <table control>
FROM SCREEN <screen> to
reset a table control to its initial
attributes.
Type TABLEVIEW has a complex structure containing
individual fields and an internal table
*********************************
* INCLUDE SAPMZxxxTOP *
*********************************
CONTROLS: ITEMS TYPE TABLEVIEW
USING SCREEN '9005'.

IBM Global Services
2005 IBM Corporation 12 March-2005 Table Control | 6.15
Processing Table Control
Database
Screen
A Table control can be processed with or without an internal table:
*Processing without an internal table*

PROCESS BEFORE OUTPUT.
LOOP WITH CONTROL items.
MODULE ctrl_pbo.
ENDLOOP.

PROCESS AFTER INPUT.
LOOP WITH CONTROL items.
MODULE ctrl_pai.
ENDLOOP.

IBM Global Services
2005 IBM Corporation 13 March-2005 Table Control | 6.15
Processing Table Control (Contd.)
*Processing with an internal table*

PROCESS BEFORE OUTPUT.
LOOP AT itab WITH CONTROL items CURSOR items-CURRENT_LINE.
ENDLOOP.

PROCESS AFTER INPUT.
LOOP AT itab WITH CONTROL items.
MODULE ctrl_pai.
ENDLOOP.
The fields in the table control and the internal table work area needs to have the
same structure and names for automatic transport of data between the ABAP
program and the screen.
IBM Global Services
2005 IBM Corporation 14 March-2005 Table Control | 6.15
Field Transport in Table Controls
PBO
Transport ABAP table control
fields to screen fields
Transport remaining ABAP fields
to screen fields
PAI
Transport all fields except table
control and FIELD statement fields
Transport table control fields
Transport fields in FIELD
statements
IBM Global Services
2005 IBM Corporation 15 March-2005 Table Control | 6.15
Creating Table Control Variants
IBM Global Services
2005 IBM Corporation 16 March-2005 Table Control | 6.15
Demonstration
Creating a program to display the data in the YMOVIE table using a table control.
IBM Global Services
2005 IBM Corporation 17 March-2005 Table Control | 6.15
Practice
Creating a program to display the data in the YMOVIE table using a table control.
IBM Global Services
2005 IBM Corporation 18 March-2005 Table Control | 6.15
Summary
A table control is an area on the screen where the system displays data in a
tabular form. It is processed using a loop.
Lines in a table control may contain dictionary table fields, keywords, input/output
fields, radio buttons, checkboxes, radio button groups, and pushbuttons. A line
can be up to 255 columns wide. Each column may have a title.
When creating a table control, the system automatically proposes a selection
column.
A selection column allows users to choose a line of the table control.
When processing a table control in the program, you will also need to declare a
CONTROLS statement with type TABLEVIEW (in the TOP INCLUDE of your
program).
IBM Global Services
2005 IBM Corporation 19 March-2005 Table Control | 6.15
Summary (Contd.)
A Table control can be processed with or without an internal table.
You can use the Customizing button (in the top right corner) to save the
current setting (column widths and column positions) and use it as the initial
value for the next call.
IBM Global Services
2005 IBM Corporation 20 March-2005 Table Control | 6.15
Questions
What is a table control ?
Is it mandatory to use an internal table for processing a table control ?
What are the primary advantages of using table control ?