Você está na página 1de 20

IBM Global Services

Table Control

Table Control |

Dec-2008

2005 IBM Corporation

IBM Global Services

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

Table Control |

Dec-2008

2005 IBM Corporation

IBM Global Services

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 userspecific column layout.
Fixed Leading
Columns

Change/save table settings


Change column width

Automatic horizontal/vertical scrolling

Mark columns/rows

Table Control |

Dec-2008

2005 IBM Corporation

IBM Global Services

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 userspecific column layout.
Fixed Leading
Columns

Change/save table settings


Change column width

Automatic horizontal/vertical scrolling

Mark columns/rows

Table Control |

Dec-2008

2005 IBM Corporation

IBM Global Services

Creating a Table Control

Table Control |

Dec-2008

2005 IBM Corporation

IBM Global Services

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.

Table Control |

Dec-2008

2005 IBM Corporation

IBM Global Services

Creating Table Control Fields

Table Control |

Dec-2008

2005 IBM Corporation

IBM Global Services

Creating Table Control Fields (Contd.)

Table Control |

Dec-2008

2005 IBM Corporation

IBM Global Services

Adding a table title

Table Control |

Dec-2008

2005 IBM Corporation

IBM Global Services

Creating Table Control: Fields Selection Column

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.

10

Table Control |

Dec-2008

2005 IBM Corporation

IBM Global Services

Creating Table Control

*********************************
* INCLUDE SAPMZxxxTOP *
*********************************
CONTROLS: ITEMS TYPE TABLEVIEW
USING SCREEN '9005'.

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

11

Table Control |

Dec-2008

2005 IBM Corporation

IBM Global Services

Processing Table Control


A Table control can be processed with or without an internal table:

*Processing without an internal table*

Screen
Database

PROCESS BEFORE OUTPUT.


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

l ta
rna
e
t
n
I

ble

d
hea
h
t
i
w

er

der
der
hea
hea
with
le with
T able
al
al Tab
tern
In
Intern

12

Table Control |

Dec-2008

2005 IBM Corporation

IBM Global Services

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.

13

Table Control |

Dec-2008

2005 IBM Corporation

IBM Global Services

Field Transport in Table Controls


PBO
Transport ABAP table control
fields to screen fields
Transport remaining ABAP fields
to screen fields

14

Table Control |

PAI
Transport all fields except table
control and FIELD statement fields
Transport table control fields
Transport fields in FIELD
statements

Dec-2008

2005 IBM Corporation

IBM Global Services

Creating Table Control Variants

15

Table Control |

Dec-2008

2005 IBM Corporation

IBM Global Services

Demonstration
Creating a program to display the data in the YMOVIE table using a table control.

16

Table Control |

Dec-2008

2005 IBM Corporation

IBM Global Services

Practice
Creating a program to display the data in the YMOVIE table using a table control.

17

Table Control |

Dec-2008

2005 IBM Corporation

IBM Global Services

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).

18

Table Control |

Dec-2008

2005 IBM Corporation

IBM Global Services

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.

19

Table Control |

Dec-2008

2005 IBM Corporation

IBM Global Services

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 ?

20

Table Control |

Dec-2008

2005 IBM Corporation

Você também pode gostar