Creating Maintenance Views 

Procedure

  1. Select the object class View in the initial screen of the ABAP Dictionary, enter the view name and choose Create.
  2. A dialog box appears in which you must select the view type.

  3. Select the type Maintenance view and choose Create.
  4. The maintenance screen for maintenance views appears. You will see three input areas for tables, join conditions and view fields.

  5. Enter an explanatory short text in the field Short text.
  6. Under Tables, enter the primary table of the view.
  7. If required, include more tables in the view. In a maintenance view you can only include tables that are linked with foreign keys.
  8. Position the cursor on the primary table and choose Relationships. All existing foreign key relationships of the primary table are displayed. Select the required foreign keys and choose Copy. The secondary table involved in such a foreign key is included in the view. The join conditions derived from the foreign keys (see Foreign Key Relationship and Join Condition) are displayed.

    You can also include tables that are linked with a foreign key to one of the secondary tables already included. To do this, position the cursor on the secondary table and choose Relationships. Then proceed as described above.

    For maintenance and help views, there are certain restrictions on the foreign keys with which the tables can be included in the view (see Restrictions for Maintenance and Help Views). The foreign keys violating these conditions are displayed at the end of the list under the header Relationships with unsuitable cardinality.

  9. Select the fields that you want to include in the view.
  10. To do this, position the cursor on the table and choose TabFields. The fields of the table are now displayed in a dialog box. You can copy fields from here by marking them in the first column and choosing Copy.

    All key fields of the primary table must be included in a maintenance view. In addition, all key fields of secondary tables that are not involved in the foreign key (that is, which are not linked via a join condition to a key field already included in the view) must be included in the view.

    This ensures that the records inserted with a maintenance view can be written correctly in the tables contained in the view.

  11. Formulate the selection conditions. To do this choose Goto ® Selection condition.
  12. The input area for the selection conditions appears in place of the input area for the fields. Maintain the selection condition as described in Maintaining Selection Conditions of Views. You can then switch back to the fields display with Goto ® View fields.

  13. Activate the view with View ® Activate.
  14. A log is written during activation. You can display it with Utilities ® Activation log. If errors or warnings occurring when the view was activated, the activation log is automatically displayed.

  15. Go to Transaction SE54 with Environment ® Tab.maint.generator. From the view definition you can generate maintenance modules and maintenance interfaces that distribute the data entered with the view to the base tables of the view. You can find more information in Creating a Maintenance Dialog.

Other Options

Creating Documentation

You can create information about using the view with Goto ® Documentation. This documentation is output for example when you print the view.

Changing the Data Element of a View

Select the Mod column (modify) for the view field and press Enter. The Data element field is now ready for input. Enter the new data element there. This data element must refer to the same domain as the original data element. With the F4 help for the Data element field, you can display all the data elements that refer to the domain of the field.

If you want to assign the original data element again, you only have to reset the Mod flag and choose Enter.

Changing the Maintenance Status

The maintenance status defines how you can access the view data with the standard maintenance transaction (SM30). Choose Extras ® Maintenance status. A dialog box appears in which you can select the maintenance status of the view.

Defining the Delivery Class of the View

Choose Extras ® Delivery class. A dialog box appears in which you can enter the delivery class of the maintenance view.

Defining the Maintenance Attribute of a View Field

The maintenance attribute defines special access modes for the fields of the view. You can make the following entries in field F in the input area of the view fields:

Check Functions

With Extras ® Runtime object ® Check you can determine whether the definition of the view in the ABAP Dictionary maintenance screen is identical to the definitions in the runtime object of the view. With Extras ® Runtime object ® Display you can display the runtime object of the view.

Displaying the Foreign Keys of a View Field

If a foreign key that was automatically copied to the view definition during activation is defined for the field of the base table, you can display it. To do so, position the cursor on the view field and choose Extras ® Foreign keys.

Displaying the Foreign Key on which a Join Condition is Based

If a join condition was derived from a foreign key, you can display its definition. To do so, position the cursor on the join condition and choose Extras ® Foreign keys.

See also:

Maintenance Views

BC - Generating the Table Maintenance Dialog