SAP ABAP Enhancements

«« Previous
Next »»

A structure, database table, or database view in ABAP Dictionary created in a system can be enhanced in a different system using customizing includes, append structures, or append views without making any modifications. Customizing includes indicate points already marked by SAP for enhancements, whereas append structures can be appended anywhere.

  • Customizing includes


A customizing include is a structure in ABAP Dictionary whose name has the prefix CI_ for customers and SI_ for partners and is in the customer namespace. Customizing includes can be included in structures and database tables delivered by SAP. The customizing includes in structures and database tables delivered by SAP are usually empty. They are not associated with existing structures and reserve only the names of the structures instead. In customer or partner systems, these includes can be enhanced as part of an enhancement category in customizing by creating the included customizing includes and using customizing transactions to give them components. Any existing transparent database tables are not transformed, which can produce different orders of the fields in the dictionary and on the database.

A customizing include can be included in multiple database tables or structures. Its enhancement is then applied to all database tables or structures in which it is included. An empty customizing include of a database table or structure does not need to be enhanced.

Enhancements of a delivered structure or database table using a customizing include are not modifications. If a customizing include is used to add fields to a database table or structure in the standard system, these fields are inserted automatically in the new structure or database table delivered by SAP in an upgrade.

  • Append structures


An append structure is a structure in ABAP Dictionary appended to another structure or database table and which appends their components to them. Append structures can be added to structures and database tables delivered by SAP in customer systems. An append structure is assigned to exactly one table or structure. There can, however, be more than append structure for a table or structure. The components of append structures must meet the prerequisites for table fields.

The following enhancements can be made to a database table or structure using an append structure:
  • Insert new components (if permitted by the enhancement category)
  • Define foreign keys for existing fields of a database table
  • Bind search helps to existing components
All enhancements are part of the append structure, which means that any changes made to these enhancements are made only using the append structure. The same applies to transports. When a database table or structure is activated, all associated append structures are found and their components are appended to the database table or structure. Any foreign keys or search help bindings added using the append structure are also appended. When an append structure is activated, the assigned database table or structure is adapted to the changes made. Any existing tables are not converted, which can produce different orders of the fields in the dictionary and on the database. When a structure or database table with append structure is copied, the appended fields, foreign keys, and search helps become real elements of the target of the copy.

The following must be noted when using append structures to enhance database tables:
  • Append structures can only be appended to transparent tables.
  • No append structures can be appended to database tables with the type LCHR or LRAW, since these fields must always be the last field of the table.
  • Fields appended to a database table using an append structure can be added to its secondary indexes. No secondary index can be defined for the append structure itself.
  • A binding of a check table or search help that already exists for a field of the database table cannot be modified using the append structure.
The enhancement of SAP structures or SAP tables using append structures in customer systems does not constitute a modification. Append structures created in for SAP objects in customer systems are in the customer namespace (or in the namespace of a partner of a special development project) and hence are protected from being overwritten by upgrades. It is advisable to create the components of append structures of this type with names from the customer namespace too to avoid naming conflicts. After an upgrade, the associated append structures are appended again to tables modified by SAP.

Note

The same structure can be appended to multiple database tables or structures by including it in the individual append structures as an include structure.

  • Append views


Database views delivered by SAP can be enhanced by partners and customers using views known as append views, without making any modifications. The name of an append view is subject to the same rules as the name of a classic view and should be located in the customer namespace (or in the namespace of a partner or special development) to protect it against being overwritten by upgrades or new releases.

Further fields from basis tables in the database view can be added to append views as view fields. Append views cannot be used to add further basis tables to the view or to modify the join conditions or selection conditions of a database view. An append view is assigned to exactly one database view. More than one append view can be created for a database view.

If an append view is activated, an append structure with this name is created in ABAP Dictionary whose components are the additional view fields of the append view.

If a database view is activated, all append views for this view are found and their fields are appended to the database view. The append structure of the append view is added to the structure of the database view. If an append view is created or modified, the associated database view is adjusted to this change automatically when the append view is activated.

Notes
  • Append views are possible only for database views and not for other views.
  • In the case of CDS views, CDS view enhancements are a separate option for enhancements and work in the similar way to append views. When a CDS view enhancement is created, an append view is created that enhances the CDS database view.
Example

The database view DEMO_ORIGINAL is enhanced using the append view DEMO_APPEND_VIEW. The program DEMO_APPEND_VIEW uses SELECT to access the enhanced view and also displays the components of the structures in question.

«« Previous
Next »»

No comments:

Post a Comment