Get Example source ABAP code based on a different SAP table
VERSION 5 OUT
ABAP_DDIC - Dependency Rules A dependency rule is a HANA tuning object> for which an instance is created on an SAP HANA database>. A dependency rule is defined for one or more DDIC database tables. From a relational expression of a selection condition, it derives an additional condition for these DDIC database tables. The SAP HANA database optimizer evaluates this rule when the DDIC database tables are read. If possible, it creates the additional selection conditions and uses AND> to join it with the other conditions. ABAP Dictionary dependency rules are defined using the
Dictionary DDL for defining dependency rules>
ABAP_CAUT It cannot be guaranteed that the SAP HANA database evaluates a dependency rule correctly and creates the required additional selection condition. In queries with common table expressions>, alias names, and so on, it can occur that the optimizer does not detect the selection condition in question. For this reason, dependency rules must only be defined in ways that do not modify the result set and that are solely intended for internal optimization. When a DDIC database table is accessed by an application program, the result must always be the same, regardless of any dependency rules. This is the only way to avoid producing results that are dependent on the behavior of the optimizer.
Latest notes:
Dependency rules usually join semantic columns of a DDIC database table with technical columns of the same table. Semantic columns contain regular data and technical columns contain data used for internal database processes. ABAP programs should not access the data in technical columns in most cases. A dependency rule can be used to create additional selection conditions for technical columns from existing selection conditions for semantic columns. This modifies access to the table in a transparent way for the ABAP program.
One important application for dependency rules is the optimization of access to deprecated data > in DDIC database tables> where data aging> is enabled. In this case, dependency rules join the temperature column> of a DDIC database table with regular date columns in the table.
In all SQL reads on DDIC database tables, the SAP HANA database optimizer evaluates their dependency rules. This is done regardless of the access type> and covers access with AB_SQL , AMDP, and Native SQL, plus access to views that have a DDIC database table as a data source. Dependency rules are not evaluated in reads not made using SQL (such as in calculation views).
Partners and customers cannot currently define their own dependency rules. BEGIN_SECTION SAP_INTERNAL_HINT In fact, dependency rules were invented for data aging. But the concept is general, powerful, and dangerous. You can define any syntactically allowed dependency rules for any database table. If the dependency rule affects the result set of a query, the reason might be hard to find. Therefore, only few chosen developers are allowed to create dependency rules. END_SECTION SAP_INTERNAL_HINT ABAP_HINT_END