Добавил:
Upload Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
BC430_EN_Col62_FV_Part_A4_-_ABAP_Dictionary.pdf
Скачиваний:
204
Добавлен:
21.05.2015
Размер:
21.37 Mб
Скачать

BC430

Lesson: Performance During Table Access

Exercise 6: Performance Aspects with Table Access

Exercise Objectives

After completing this exercise, you will be able to:

Create indexes

Maintain the buffering attributes of a table

Business Example

In their daily work, airline employees need fast access to the data in the employee administration tables. In this exercise, access to the data in these tables should be speeded up.

The combination of first and last names is often used to access an employee's HR data. The last name is more often declared (specified in the access) than the first name. An index must be created for this.

To set up a flight crew, you have to assign employees (pilots and stewards) to flights. You need to create a table in which the employees involved and their functions can be entered for each flight.

Task 1:

Create an index that supports access to the combination of first names and surnames. Make sure that the index is created on the database.

The HR data of the employees is managed in Table ZEMPLOY##. You therefore need to create an index for this table.

1.Create an index for the ZEMPLOY## table. It has to contain the fields Client, Last name and First name. Arrange these fields in this order.

Note: The index is certainly not a unique index since there can be employees with the same first and last names. There is also no reason to create the index only on certain database systems.

Task 2:

Copy the table SFLCREW on to the table ZFLCREW##. Then activate the table ZFLCREW##.

1.Copy the table SFLCREW on to the table ZFLCREW##. Replace the existing data element for the employee number with your own data element.

Continued on next page

2006/Q2

© 2007 SAP AG. All rights reserved.

91

Unit 3: Performance During Table Access

BC430

Task 3:

Maintain the settings for buffering the ZDEPMENT## and ZFLCREW## tables.

Reconsider these settings you made for buffering tables ZDEPMENT## and ZFLCREW##. Keep the following information for using these tables in mind.

The airlines have between 10 and 30 departments. Only a few airlines (maximum 3) are managed together in the tables. The data about the crews of completed flights is stored in an archive file every three months. Table ZFLCREW## therefore has relatively few entries (at most 5,000 per airline).

Tables ZDEPMENT## and ZFLCREW## are accessed very frequently. Data records are read repeatedly from these tables.

One application server is used exclusively by the employees of an airline who work in administration. The flight crew data is only of internal interest within the airline. Since the airlines share some services, administrative employees of an airline often have to access departmental data of other airlines.

1.Maintain the settings for buffering the ZDEPMENT## tables in the Technical Settings.

Note: Since the contents of table ZDEPMENT## are rarely changed but frequently read, it is advisable to buffer the table.

2.Maintain the settings for buffering the ZFLCREW## tables in the Technical Settings.

Note: The data in table ZFLCREW## is often read repeatedly. By contrast, access to change the content occurs infrequently. You should therefore buffer the table.

Usually, only the data for one airline is needed on an application server. You should therefore buffer the table generically with the generic key Client and Airline.

3.Execute the program BC430_CHECK in transaction SE38.

BC430_CHECK checks whether your solutions are correct and fills the new table ZFLCREW## with the sample data needed for later exercises.

Caution: If you do the supplementary exercise, start this program only once you have completed the supplementary exercise.

Continued on next page

92

© 2007 SAP AG. All rights reserved.

2006/Q2

BC430

Lesson: Performance During Table Access

Task 4: (optional)

Create an index for the various areas of activity of an airline in the employee table. Make sure that this index is only created on the database systems MAXDB and SQL Server

Note: Using an index for the areas might result in a gain in performance when accessing the employee data, for example when all the pilots of an airline are frequently selected. When performance was measured on different database systems, improved performance was only registered with MAXDB and SQL Server database systems.

1.Display the index you created.

2.Create the new index only on the MAXDB and SQL Server database systems.

2006/Q2

© 2007 SAP AG. All rights reserved.

93

Unit 3: Performance During Table Access

BC430

Solution 6: Performance Aspects with Table Access

Task 1:

Create an index that supports access to the combination of first names and surnames. Make sure that the index is created on the database.

The HR data of the employees is managed in Table ZEMPLOY##. You therefore need to create an index for this table.

1.Create an index for the ZEMPLOY## table. It has to contain the fields Client, Last name and First name. Arrange these fields in this order.

Note: The index is certainly not a unique index since there can be employees with the same first and last names. There is also no reason to create the index only on certain database systems.

a)In display mode, go to the maintenance screen for table ZEMPLOY## and choose Indexes.

b)In the next dialog box, confirm that you want to create an index.

c)In the following dialog box, enter a three-character index ID and choose Continue.

d)Enter a short text in the maintenance screen of the index.

e)Choose Table fields. A list of all the fields in the table appears.

f)Select the fields Client, Surname and First name, and choose Copy. The fields are copied from the dialog box to the index in that order.

Note: If the First name field comes before the Last name field, you have to change the order of the fields. Do this by placing the cursor on the line with the First name field and choosing Cut. Now place the cursor on the first free line after the Last name field and choose Paste.

g)You should therefore leave the standard settings Non-unique index and

Index on all database systems.

h)Activate the index. The index is automatically created on the database.

Continued on next page

94

© 2007 SAP AG. All rights reserved.

2006/Q2

BC430

Lesson: Performance During Table Access

Task 2:

Copy the table SFLCREW on to the table ZFLCREW##. Then activate the table ZFLCREW##.

1.Copy the table SFLCREW on to the table ZFLCREW##. Replace the existing data element for the employee number with your own data element.

a)In the initial screen of the the ABAP Dictionary, enter SFLCREW in the Database table field. Choose Copy.

b)In the next dialog box, enter the name ZFLCREW## in the to table field and choose Continue.

c)In change mode, go to the table maintenance screen and replace data element SEMP_NUM with the data element you created for the employee number.

d)Now activate the table.

Continued on next page

2006/Q2

© 2007 SAP AG. All rights reserved.

95

Unit 3: Performance During Table Access

BC430

Task 3:

Maintain the settings for buffering the ZDEPMENT## and ZFLCREW## tables.

Reconsider these settings you made for buffering tables ZDEPMENT## and ZFLCREW##. Keep the following information for using these tables in mind.

The airlines have between 10 and 30 departments. Only a few airlines (maximum 3) are managed together in the tables. The data about the crews of completed flights is stored in an archive file every three months. Table ZFLCREW## therefore has relatively few entries (at most 5,000 per airline).

Tables ZDEPMENT## and ZFLCREW## are accessed very frequently. Data records are read repeatedly from these tables.

One application server is used exclusively by the employees of an airline who work in administration. The flight crew data is only of internal interest within the airline. Since the airlines share some services, administrative employees of an airline often have to access departmental data of other airlines.

1.Maintain the settings for buffering the ZDEPMENT## tables in the Technical Settings.

Note: Since the contents of table ZDEPMENT## are rarely changed but frequently read, it is advisable to buffer the table.

a)In display mode, go to the maintenance screen for the table ZDEPMENT## and choose Technical Settings. The desired maintenance screen appears and you can switch to change mode here.

b)Select Buffering switched on. As no restrictions with regard to access exist and the table is small, select Fully buffered.

c)Activate the technical settings for table ZDEPMENT##.

2.Maintain the settings for buffering the ZFLCREW## tables in the Technical Settings.

Note: The data in table ZFLCREW## is often read repeatedly. By contrast, access to change the content occurs infrequently. You should therefore buffer the table.

Continued on next page

96

© 2007 SAP AG. All rights reserved.

2006/Q2

BC430

Lesson: Performance During Table Access

Usually, only the data for one airline is needed on an application server. You should therefore buffer the table generically with the generic key Client and Airline.

a)In display mode, go to the maintenance screen for the table ZFLCREW## and choose Technical Settings. The desired maintenance screen appears and you can switch to change mode here.

b)Select Buffering switched on. Select Generic buffering and choose 2 as the number of generic key fields.

c)Activate the technical settings for the table ZFLCREW##.

3.Execute the program BC430_CHECK in transaction SE38.

BC430_CHECK checks whether your solutions are correct and fills the new table ZFLCREW## with the sample data needed for later exercises.

Caution: If you do the supplementary exercise, start this program only once you have completed the supplementary exercise.

Task 4: (optional)

Create an index for the various areas of activity of an airline in the employee table. Make sure that this index is only created on the database systems MAXDB and SQL Server

Note: Using an index for the areas might result in a gain in performance when accessing the employee data, for example when all the pilots of an airline are frequently selected. When performance was measured on different database systems, improved performance was only registered with MAXDB and SQL Server database systems.

1.Display the index you created.

a)Choose Create in the dialog box. Include the fields Client, Airline, and Area in the index.

Note: This is not a unique index either.

The index is only created on the database if your training system is running on one of the selected database systems.

Continued on next page

2006/Q2

© 2007 SAP AG. All rights reserved.

97

Unit 3: Performance During Table Access

BC430

2.Create the new index only on the MAXDB and SQL Server database systems.

a)Select For selected database systems.

b)Then choose the arrow symbol in this line. Choose Selection list. Using the F4 help, select the identifiers for the database systems ADA for Adabas and MSS for SQL Server from the list.

c)Choose Continue.

d)Activate the index.

98

© 2007 SAP AG. All rights reserved.

2006/Q2

BC430

Lesson: Performance During Table Access

Lesson Summary

You should now be able to:

Judge when table accesses can be speeded up by using indexes

Create indexes in the ABAP Dictionary

Explain the different buffering types

Judge when it makes sense to buffer a table and which buffering type you should choose

Buffer a table using the technical settings

2006/Q2

© 2007 SAP AG. All rights reserved.

99

Unit Summary

BC430

Unit Summary

You should now be able to:

Judge when table accesses can be speeded up by using indexes

Create indexes in the ABAP Dictionary

Explain the different buffering types

Judge when it makes sense to buffer a table and which buffering type you should choose

Buffer a table using the technical settings

100

© 2007 SAP AG. All rights reserved.

2006/Q2

Соседние файлы в предмете [НЕСОРТИРОВАННОЕ]