Exercise (Chapter 8):
In this exercise, you will create a view that provides an overview of courses (identified by course number), the course titles, faculties which offer them (need both faculty number and name) and the professors (identified by professor number) responsible for teaching those courses.
Objectives
After completing this exercise, you will be able to:
Create a view
Use the ABAP Data Browser to test your view
If you need help with this exercise, the solutions can be found in Development Class YDATADICTIONARY.
Estimated time to complete this exercise: 30 minutes
Exercises
The following exercises provide practice working with the concepts learned in Chapter 9.
Chapter 8, Exercise 1
In this exercise, you will create a view.
Hint: Follow the step-by-step instructions that follow to help creating your view.
Step 1 Create a view that provides the course number, the course titles, faculties which offer them (need both faculty number and name), and the professors (identified by professor number) responsible for teaching those courses. Define a view (YXXVIEW) that fulfills those requirements.
Choose the type of view carefully. The requirement calls for multiple tables to be included in the view. Maintenance status is “R” for read-only. The tables you will need to use are UKURS and UFACH.
Step 2. Using the data that exists in the tables, test your view. Execute your view through the ABAP Data Browswer (transaction SE16)
HINTS FOR CREATING THE VIEW.
2. From the Dictionary objects list choose View. Then type in a name for the view. Finally, click on the create button.
3. Choose a View Type. If the desired fields are from multiple tables choose DATABASE as the view type. If the desired fields are from a single table choose PROJECTION as the view type. Which type should we use for this exercise?
4. Enter a descriptive text for the view.
6. After you have entered your primary table, click on the "Relationships" button.
7. The following screen appears, showing all secondary tables that already have a FK relationship build to the primary table. Click the checkbox next to the secondary table
you wish to use and click the copy button.
8. Your screen should now look similar to this. The secondary table(s) you chose will be listed immediately after the primary table.
9. Now you are ready to choose the table fields to include in your view. Click the "View
flds" tab. Then click the "Table fields" button.
A popup window with the names of the tables you previously selected will come up. Double click on the name of your primary table. The next screen will allow you to choose the fields. Check off the fields you want to include and click the copy button.
Repeat Step 9 for all your secondary tables.
Once you have inserted all the fields you want to include, activate your view by pressing the Activate button.
To view the contents of your view, click the "Contents" button, which is the right most button on the application toolbar. This will take you directly to the Data Browser Selection Screen. Hit F8 (or execute) at this screen, and the contents of your view will be displayed.
Tip: You can also access the Data Browser through transaction SE16.
The ABAP Dictionary ABAP Exercises
March, 2001
p:\instruct\courses\abap\bc030\Ch3ffEx.doc Page 8
5. Enter the primary table in the Tables column
Exercise
Chapter 8