Views
March-2005 Views | 2.15.03
Objectives
• The participants will be able to :
– Create different type of views in database.
– Understand the difference between database &
projection view.
March-2005 Views | 2.15.03 2
Creating a view: Step 1
March-2005 Views | 2.15.03 3
Select radio button
“View”
Click on Create button
Provide a custom
name
Different types of views: Step2
March-2005 Views | 2.15.03 4
Select the view type
Click on the “Copy”
button
Defining primary & secondary tables:
Step3
March-2005 Views | 2.15.03 5
Primary table
Secondary table
Defining relationship for selected
tables: Step 4
March-2005 Views | 2.15.03 6
Relationship
Defining view fields : Step 5
March-2005 Views | 2.15.03 7
View fields for
primary table
View fields: Step 6
March-2005 Views | 2.15.03 8
All view fields from primary & secondary
tables displayed on screen
March-2005 Views | 2.15.03 9
Defining selection criteria: Step 7
Selection
conditions
March-2005 Views | 2.15.03 10
Defining maintenance status : Step 8
View
maintenance
March-2005 Views | 2.15.03 11
Code to demonstrate use
of database views
Demonstration
• Step by Step creation of a Database View.
March-2005 Views | 2.15.03 12
Practice
• Step by Step creation of a Database View.
March-2005 Views | 2.15.03 13
Summary
•There are different types of views for efficiently
extracting data from the database.
•For creating a view , one needs to define the
primary and secondary tables, define the
relationship for the selected tables, define the
view fields, define the selection criteria and
define the maintenance status.
March-2005 Views | 2.15.03 14
Questions
•What are the different types of views ?
•What is meant by defining selection criteria of
a view ?
•What is meant by defining maintenance status
of a view ?
March-2005 Views | 2.15.03 15

VIEWS

  • 1.
  • 2.
    Objectives • The participantswill be able to : – Create different type of views in database. – Understand the difference between database & projection view. March-2005 Views | 2.15.03 2
  • 3.
    Creating a view:Step 1 March-2005 Views | 2.15.03 3 Select radio button “View” Click on Create button Provide a custom name
  • 4.
    Different types ofviews: Step2 March-2005 Views | 2.15.03 4 Select the view type Click on the “Copy” button
  • 5.
    Defining primary &secondary tables: Step3 March-2005 Views | 2.15.03 5 Primary table Secondary table
  • 6.
    Defining relationship forselected tables: Step 4 March-2005 Views | 2.15.03 6 Relationship
  • 7.
    Defining view fields: Step 5 March-2005 Views | 2.15.03 7 View fields for primary table
  • 8.
    View fields: Step6 March-2005 Views | 2.15.03 8 All view fields from primary & secondary tables displayed on screen
  • 9.
    March-2005 Views |2.15.03 9 Defining selection criteria: Step 7 Selection conditions
  • 10.
    March-2005 Views |2.15.03 10 Defining maintenance status : Step 8 View maintenance
  • 11.
    March-2005 Views |2.15.03 11 Code to demonstrate use of database views
  • 12.
    Demonstration • Step byStep creation of a Database View. March-2005 Views | 2.15.03 12
  • 13.
    Practice • Step byStep creation of a Database View. March-2005 Views | 2.15.03 13
  • 14.
    Summary •There are differenttypes of views for efficiently extracting data from the database. •For creating a view , one needs to define the primary and secondary tables, define the relationship for the selected tables, define the view fields, define the selection criteria and define the maintenance status. March-2005 Views | 2.15.03 14
  • 15.
    Questions •What are thedifferent types of views ? •What is meant by defining selection criteria of a view ? •What is meant by defining maintenance status of a view ? March-2005 Views | 2.15.03 15

Editor's Notes

  • #4 Go to ABAP Dictionary: Initial Screen (Transaction Code SE11). Select the ‘View’ radio button. Then, type in a custom name for the View. Click on the create button.
  • #5 Four different view types are supported. These differ in the way in which the view is implemented and in the methods permitted for accessing the view data. Database views are implemented with an equivalent view on the database. Projection views are used to hide fields of a table (only projection). Help views can be used as selection method in search helps. Maintenance views permit you to maintain the data distributed on several tables for one application object at one time. Database views implement an inner join. The other view types implement an outer join. Choose a View Type in this Pop-up screen. 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.
  • #6 Keep in mind that you can only include transparent tables in a database view For DATABASE view there will be one primary table and there can be zero, one or more secondary tables. The first table listed is automatically considered as the other primary table. List any desired secondary tables immediately after the primary table.
  • #7 If there are suitable foreign keys between the tables, you should copy the join conditions from these foreign keys Place the cursor on a table name and choose Relationships. All foreign keys to other tables defined for this table are displayed. Select the foreign keys and choose Copy. The join condition is now derived from the definitions in the foreign key.
  • #8 On the View fields tab page, select the fields that you want to copy to the view. Choose Table fields. All the tables contained in the view are displayed in a dialog box. Select a table. All the fields contained in this table are displayed. You can copy fields by selecting them in the first column and choosing Copy. You can also include an entire table in the view
  • #10 On the Selection conditions tab page, you can (optionally) formulate restrictions for the data records to be displayed with the view.The selection conditions define the data records that can be selected with the view.
  • #11 On the Maintenance status tab page, select the maintenance status of the database view. If the view contains more than one table, the maintenance status read only cannot be altered. Save your entries. You are asked to assign the view a Package. Activate the view.