Файл: BC430_EN_Col62_FV_Part_A4_-_ABAP_Dictionary.pdf

ВУЗ: Не указан

Категория: Не указан

Дисциплина: Не указана

Добавлен: 03.04.2021

Просмотров: 2288

Скачиваний: 40

ВНИМАНИЕ! Если данный файл нарушает Ваши авторские права, то обязательно сообщите нам.
background image

Unit 7: Views and Maintenance Views

BC430

First of all, via SE54, you must generate a maintenance view for every table/view
involved, in order to then combine these in SE54 in a view cluster.

You subsequently maintain the data with transaction SM34 and by specifying
the cluster name.

Figure 89: Advantages

198

© 2007 SAP AG. All rights reserved.

2006/Q2


background image

BC430

Lesson: Maintenance Views

Exercise 12: Maintenance Views

Exercise Objectives

After completing this exercise, you will be able to:

Create simple and complex maintenance views.

Business Example

You should create simple views database tables to generate test data quickly in
your project.

Task 1:

Create a maintenance view with the name ZPARTNER##, with which you can
easily maintain new business partners.

Note:

The business partners are entered in table SBUSPART. A business

partner can be either a flight customer or a travel agency. If it is a travel
agency, there will be a corresponding entry in table STRAVELAG.

The view should also permit you to maintain tables SBUSPART and
STRAVELAG at one time. Include all the necessary fields of the tables
in the view.

You want to maintain the data in tables SBUSPART and STRAVELAG
together in the maintenance view. If you wanted to enter a new partner
directly, you would first have to enter it in table SBUSPART. Only then
could you enter the corresponding data in table STRAVELAG (because of
the existing foreign key check between SBUSPART and STRAVELAG).

1.

Generate the maintenance interface. Use the following parameters:

Function group

ZZBC430##

Authorization group

SUNI

Maintenance type

one-step

Overview screen

100

2.

Include the fields of both tables in the view.

3.

Generate a maintenace interface for the view.

4.

Then maintain the data of a new travel agency using the enhanced table
maintenance. Choose

System

Services

Table maintenance

Enhance.

Tab.maint.

.

Continued on next page

2006/Q2

© 2007 SAP AG. All rights reserved.

199


background image

Unit 7: Views and Maintenance Views

BC430

Task 2:

Bundle maintenance view in a view cluster.

Note:

You want to serve several maintenance views of dependent tables

on one single transaction screen. To do this, create a complex maintenance
view over several customer tables. In this exercise, use the table from the
flight data model again. You will copy these tables including their entire
content on the customer namespace.

1.

First of all copy the tables SCARR, SPFLI and SFLIGHT into the customer
namespace with attached monitor number (ZCARR##, ZPFLI## und
ZFLIGHT##). Maintain the foreign keys appropriately in the new tables.

2.

Copy the content of the original tables into the newly created tables using a
report.

3.

Create a two-step maintenance view (screen numbers e.g. 100 and 110)
for every table copied.

4.

Create a view cluster with the name

ZPC_FLIGHT##

.

5.

Give a meaningful short description in the header entry.

6.

Change to the object structure and enter the following new entries:

View/Tab.

Short description

Prede-

cessor

Dep

Pos

ZCARR##

Carriers

ZCARR##

R

1

ZPFLI##

Flight connections

ZCARR##

S

2

ZFLIGHT##

Flights of the connection ZPFLI##

S

3

7.

Generate the field dependencies for every entry in the list.

8.

Activate the view cluster

9.

Generate a new entry for an airline and create two flights each for these two
new flight connections. Output the new entries via a report in a list.

200

© 2007 SAP AG. All rights reserved.

2006/Q2


background image

BC430

Lesson: Maintenance Views

Solution 12: Maintenance Views

Task 1:

Create a maintenance view with the name ZPARTNER##, with which you can
easily maintain new business partners.

Note:

The business partners are entered in table SBUSPART. A business

partner can be either a flight customer or a travel agency. If it is a travel
agency, there will be a corresponding entry in table STRAVELAG.

The view should also permit you to maintain tables SBUSPART and
STRAVELAG at one time. Include all the necessary fields of the tables
in the view.

You want to maintain the data in tables SBUSPART and STRAVELAG
together in the maintenance view. If you wanted to enter a new partner
directly, you would first have to enter it in table SBUSPART. Only then
could you enter the corresponding data in table STRAVELAG (because of
the existing foreign key check between SBUSPART and STRAVELAG).

1.

Generate the maintenance interface. Use the following parameters:

Continued on next page

2006/Q2

© 2007 SAP AG. All rights reserved.

201


background image

Unit 7: Views and Maintenance Views

BC430

Function group

ZZBC430##

Authorization group

SUNI

Maintenance type

one-step

Overview screen

100

a)

Mark the object type

View

in the initial screen of the ABAP Dictionary.

Enter the object name

ZPARTNER##

and choose

Create

.

b)

Select the view type in the dialog box. Mark

Maintenance view

and

select

Choose

.

c)

Enter a short text in the next screen. When defining the maintenance
view, you first of all copy the SBUSPART table.

d)

Enter the

SBUSPART

table in the

Tables

field. The key fields of this

table are automatically included in the view as fields.

e)

Place the cursor in the

Tables

field on the

SBUSPART

entry. Choose

Relationships

.

A dialog box appears listing all existing foreign key relationships of
table SBUSPART to other tables.

f)

In the dialog box, mark the foreign key relationship for the
STRAVELAG table and choose

Copy

.

g)

The join conditions are created from the foreign key. The join
conditions have the following form:

SBUSPART-MANDANT = STRAVELAG-CLIENT
SBUSPART-BUSPARTNUM = STRAVELAG-AGENCYNUM

2.

Include the fields of both tables in the view.

a)

Click on tab page

View fields

. Position the cursor on table SBUSPART

and choose

Table fields

. A list of all the fields of the table appears.

Choose

Select all

and then

Copy

.

b)

Include all the fields of the STRAVELAG table with the exception of
the fields

CLIENT

and

AGENCYNUM

in the view in the same way.

These fields are linked to the corresponding fields of table SBUSPART
with the join conditions and therefore should not appear in the view.

c)

Activate the view.

Continued on next page

202

© 2007 SAP AG. All rights reserved.

2006/Q2