Entering content frameProcedure documentation Creating a Database View Locate the document in its SAP Library structure

Procedure

  1. Enter an explanatory short text in the field Short text.
  2. You can for example find the view at a later time using this short text.

  3. Define the tables to be included in the view in the Tables field of the Tables/Join conditions tab page.
  4. Keep in mind that you can only include transparent tables in a database view.

  5. Link the tables with join conditions.
  6. If there are suitable foreign keys between the tables, you should copy the join conditions from these foreign keys (see Structure link Foreign Key Relationships and Join Conditions).

    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 This graphic is explained in the accompanying textCopy. The join condition is now derived from the definitions in the foreign key.

    If you only want to see the foreign key relationship existing between two tables, you must first select these two tables (click on the first column of the input area Tables) and then choose Relationships.

  7. On the View fields tab page, select the fields that you want to copy to the view.
  8. 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 This graphic is explained in the accompanying textCopy.

    You can also include an entire table in the view (see Includes in Database Views).

  9. On the Selection conditions tab page, you can (optionally) formulate restrictions for the data records to be displayed with the view (see Maintaining Selection Conditions for Views).
  10. The selection conditions define the data records that can be selected with the view.

  11. With Goto ® Technical settings, you can (optionally) maintain the technical settings of the database view.
  12. You can define whether and how the database view should be buffered here. Proceed as for the technical settings of a table (see Structure link Maintaining Technical Settings). Note that only the settings for buffering can be maintained for database views.

  13. On the Maintenance status tab page, select the maintenance status of the database view.
  14. If the view contains more than one table, the maintenance status read only cannot be altered.

  15. Save your entries. You are asked to assign the view a development class.
  16. You can change this development class later with Goto ® Object directory entry.

  17. Choose This graphic is explained in the accompanying text.

Result

When a database view is activated, the corresponding view is also automatically created in the database if the base tables of the view were already created there.

At activation, a log is written; it can be displayed with Utilities ® Activation log. If errors or warnings occurring when the view was activated, they are displayed directly in the activation log.

If the base tables are not yet created in the database, this is recorded in the activation log. The view is nevertheless activated in the ABAP Dictionary. In this case you can create the relevant view on the database later with the database utility.

Other Options

See also:

Database Views

Leaving content frame