ВУЗ: Не указан
Категория: Не указан
Дисциплина: Не указана
Добавлен: 03.04.2021
Просмотров: 2359
Скачиваний: 41
Unit 7: Views and Maintenance Views
BC430
2.
Transfer the fields from the tables in the view.
a)
Select
View fields
.
b)
Choose
Table fields
. In the next dialog box, mark table
ZEMPLOY##
and select
Choose
.
c)
All the fields of table ZEMPLOY## are listed. Mark the fields
Client
,
Airline
,
Personnel number
,
First name
and
Last name
. Select
Copy
.
The fields are now inserted in the view.
d)
Again choose
Table fields
. In the dialog box, choose table
ZDEPMENT##
and insert fields
Department telephone
and
Department
code
in the view as described above.
e)
Choose
Selection conditions
.
3.
Make sure that only flight personnel can be selected with the view. Define
this restriction via a selection condition.
You probably will have to (frequently) access the data using the view. The
selected data should therefore be buffered in order to increase performance.
Choose
full buffering
as buffering type.
a)
The restriction whether an employee belongs to the flight personnel
is contained in field
Area
in the ZEMPLOY## table. Enter this in
columns
Table
and
Field name
.
b)
Flight personnel are identified by the value
F
in field
Area
. Therefore,
enter
EQ
in the column
Operator
and
'F'
in the column
Compar.
Value
(incl. inverted commas) ein.
4.
Buffer the view.
a)
Choose
Goto
→
Technical settings
. The maintenance screen for the
technical settings of the view appears. With the exception of some
attributes that are meaningless for views and which are therefore not
displayed, the screen is analogous to the corresponding maintenance
screen for tables.
b)
Mark
Buffering switched on
and
Fully buffered
.
c)
Save the technical settings and return to the view maintenance screen.
d)
Activate the view.
188
© 2007 SAP AG. All rights reserved.
2006/Q2
BC430
Lesson: Views
Lesson Summary
You should now be able to:
•
Judge how a view is created from tables with join, projection, and selection
•
Create database views
•
Set up a link between foreign keys and join conditions
•
Use views in programs for data selection
•
Judge when to use maintenance views
•
Recognize the difference between an inner join and an outer join
2006/Q2
© 2007 SAP AG. All rights reserved.
189
Unit 7: Views and Maintenance Views
BC430
Lesson: Maintenance Views
Lesson Overview
In this lesson, you will become familiar with the possibility of generating
maintenance views for customer or customizing tables.
Lesson Objectives
After completing this lesson, you will be able to:
•
Create a maintenance view
•
Create simple maintenance views
•
Create complex maintenance views
Business Example
You should create simple views for the new DB tables to generate test data quickly
in your project.
Creating Maintenance Views
Figure 82: Collecting data with generated maintenance masks
190
© 2007 SAP AG. All rights reserved.
2006/Q2
BC430
Lesson: Maintenance Views
Data that is distributed on more than one table often forms a logical unit, called an
application object, for the user. You should be able to display, change and create
the data of such an application object together. The user usually is not interested
in the technical implementation of the application object, such as the distribution
of the data on several tables.
You can maintain complex application objects in a simple way using a maintenance
view. The data is automatically distributed on the underlying database tables.
All the tables used in a maintenance view must be linked with a foreign key. This
means that the join conditions are always derived from the foreign key in the
maintenance view. You cannot enter the join conditions directly as in a database
view.
A maintenance interface with which the data of the view can be displayed,
changed and created must be generated from the definition of a maintenance view
in the ABAP Dictionary.
When the maintenance interface is created, function modules that distribute
the data maintained with the view on the underlying tables are automatically
generated.
The maintenance interface is generated with the Transaction
Generate Table
View
(Transaction SE54) or from the view maintenance screen with
Utilities
→
Tab.maint.generator
.
Figure 83: Maintenance view from a maintenance view
2006/Q2
© 2007 SAP AG. All rights reserved.
191
Unit 7: Views and Maintenance Views
BC430
In a one-step maintenance view, the data of the table lines are represented as
TableControl. The key fields have a gray background and are not intended for
changes. The function fields have a white background and can be changed.
If you have created a two-step maintenance view, another screen can be opened
by double-clicking a table line in which the selected data record is presented in
a clear form.
Figure 84: Define maintenance view 1
When creating a maintenance view, you should note the following:
In Views, select maintenance view as the view type.
All key fields of the primary table must be contained in the view definition.
The client field must be included for client-dependent tables/views.
However, the field is not yet shown in the maintenance view.
For text tables as secondary tables, the language cannot be copied, as it is
filled with the logon language automatically during maintenance.
The key fields must be defined before the function fields.
Function fields and key fields cannot be mixed.
Using the maintenance status option, you can define the maintenance status for the
entire table/view. You have the following possibilities:
read only
read, change, delete and insert (default setting)
read and change
192
© 2007 SAP AG. All rights reserved.
2006/Q2