Ansicht
Dokumentation

ABENDDIC_REPLACEMENT_OBJECTS - DDIC REPLACEMENT OBJECTS

ABENDDIC_REPLACEMENT_OBJECTS - DDIC REPLACEMENT OBJECTS

TXBHW - Original Tax Base Amount in Local Currency   CL_GUI_FRONTEND_SERVICES - Frontend Services  
This documentation is copyright by SAP AG.
SAP E-Book

- Replacement Objects

A CDS view can be assigned to a transparent DDIC database table and DDIC database view in ABAP Dictionary as a replacement object using the name of its CDS entity. A prerequisite is that the structure type defined by the CDS view matches the structure of the DDIC database table or DDIC database view as follows:

  • The number of components must match.
  • It must be possible to assign a component of the CDS view to each component of the DDIC database table or DDIC database view:

  • For all other components of the DDIC database table, an identically named element of the CDS view must exist.

The order of the components in the DDIC database table and the CDS view does not need to match.
  • The technical type properties built-in data type, length, and number of decimal places must match for all assigned components.
  • The CDS view cannot have any input parameters.
  • It is not possible to have both a replacement object defined and table buffering switched on for a DDIC database view whose maintenance status is modifiable.

If a DDIC database table or a DDIC database view is accessed and a replacement object is assigned to the table or view in the following cases, the replacement object is evaluated instead of the DDIC database table or DDIC database view:

All other access types are still performed on the DDIC database table or DDIC database view, such as:

  • Writes in

Writes of this type produce a syntax check warning.
  • Use in other database objects, such as:
  • Use as a data source of a view defined on the database

  • Access from database procedures or database functions

Here it is not important how the database object was created, which means that, in addition to native views, the views defined for DDIC database views in ABAP Dictionary or for CDS views on the database also do not access the replacement object. A similar principle applies to AMDP procedures and AMDP functions. Even if is used to access a DDIC database view in ABAP Dictionary, a CDS view, or a CDS table function comprising DDIC database tables with replacement objects, no redirection is performed. In these cases, the replacement object must be accessed directly. For DDIC database views, a replacement object can be created that performs this task without the need to modify the programs.
  • Access types other than with , for example:

When a replacement object is defined for a DDIC database table for a DDIC database view, the system checks whether the specified CDS view meets the prerequisites. If a CDS view used as a replacement object is changed later and the prerequisites are no longer met, a runtime error DBSQL_REDIRECT_INCONSISTENCY occurs when an read is performed on the DDIC database table or on the DDIC database view.

No replacement objects can be defined for global temporary tables. In customer systems, replacement objects can only be defined for self-defined database views and not for DDIC database tables.

If there is a diversion to a CDS view for which one or more CDS roles are defined as part of the CDS access control, the associated access conditions are not evaluated when the replacement object is accessed.

Notes

  • Extreme care should be taken when specifying a replacement object for a DDIC database table or a DDIC database view. Incorrect usage can cause inconsistencies.
  • Replacement objects are mainly intended for existing aggregate tables. These are DDIC database tables, which contain aggregated data from other tables. Instead of aggregating data in an ABAP program and writing data to an aggregate table, which can be exclusively accessed by reads in programs, the aggregation can be performed for every read using the CDS view. This prevents redundant data from being stored. In addition, aggregation on the database can improve performance if it is necessary to read large volumes of data for aggregation in ABAP. Replacement objects can make this possible without invalidating the programs.
  • A prerequisite for assigning a replacement object to an existing DDIC database table or DDIC database view is that the CDS view returns the expected data and that, apart from aggregation, only reads are performed on the aggregate table.
  • Once a replacement object is defined, no further writes should be performed on an aggregate table. These writes produce a syntax check warning and are scheduled to be disallowed in an upcoming release.
  • Make sure that, apart from the use of , no other type of access is performed on an aggregate table with a replacement object. More specifically, CDS views used as a replacement object are not allowed to access the replaced object, because the content is usually no longer updated.
  • It is not advisable to transport table content for which a replacement object is defined. This content is scheduled to no longer be transported in an upcoming release.
  • Table buffering should be deactivated for an aggregate table for which a replacement object is defined to prevent buffer invalidations.
  • In customer systems, it may be useful to define a replacement object for a self-defined DDIC database view, if a replacement object was defined for one of their basis tables at SAP. In this case, the replacement object of the view must access the replacement object of the basis table.
  • If a DDIC database table or a DDIC database view, which a replacement object is defined for, is extended in a follow-on system, the assigned CDS view must also be extended accordingly with EXTEND VIEW.
  • Frameworks that use , such as Data Browser, automatically access replacement objects if these objects are defined for a DDIC database table or a DDIC database view. Frameworks that use Native SQL or AMDP, such as the RAP query engine, have to make sure that they access a replacement object rather than the DDIC database table or the DDIC database view.
  • If possible, programs that previously directly accessed aggregate tables or views with aggregate tables as base tables should be modified in such a way that they access the CDS views used as replacement objects directly. However, this cannot generally be done by simply replacing the data source in the SELECT statements concerned, for example because a client-dependent CDS view has no client column and therefore the target objects used no longer match. In addition, when a CDS view is accessed directly, the CDS roles defined for this CDS view have an effect.
  • Replacement objects cannot be defined for the following:

Replacement Object for Database Table






BAL Application Log Documentation   PERFORM Short Reference  
This documentation is copyright by SAP AG.

Length: 12738 Date: 20240423 Time: 151605     sap01-206 ( 180 ms )