SAP SELECT HIERARCHY NAVIGATORS
Get Example source ABAP code based on a different SAP table
SELECT>, FROM hierarchy_navigator> ABAP_SYNTAX ... hierarchy_node_navigator>
$| hierarchy_agg_navigator> ... >
What does it do?
Specifies a hierarchy navigator> as a data source data_source>> in an AB_SQL query>.
A hierarchy navigator accesses a SQL hierarchy> and evaluates it. There are different kinds of hierarchy navigators:
Hierarchy node navigators> hierarchy_node_navigator>> select certain hierarchy nodes and their properties.
Hierarchy aggregate navigators> hierarchy_agg_navigator>> select certain hierarchy nodes and apply additional aggregate functions> to them.
The tabular result contains the hierarchy nodes selected by the hierarchy navigator>. The columns of the tabular result include the additional hierarchy columns> of the SQL hierarchy specified after SOURCE>, as well as any other hierarchy columns that are specific to the hierarchy navigators where applicable.
The same applies to the additional hierarchy columns as when accessing a SQL hierarchy hierarchy>>:
If *> or ...~*> is specified in the SELECT> list>, they are not read and are not part of a structure or internal table created using an inline declaration @DATA$|@FINAL(...)> in the INTO> clause >.
They can, however, be listed explicitly in the SELECT> list and, like any column in the result set, can be used for columns colname>> specified in the other clauses of the query.
A hierarchy navigator exposes all associations of the SQL hierarchy used implicitly and leaves its association target> unchanged.
Latest notes:
Hierarchy navigators do not create any SQL hierarchies:
They cannot be specified as a source in hierarchy navigators.
They cannot be exposed as a CTE hierarchy >.
On SAP HANA databases>, the result sets of the hierarchy navigators are based on the use of the identically named hierarchy navigation functions. For more information, see the SAP HANA documentation>.
Since hierarchies generated from the START WHERE> condition are buffered on the database, it is advisable to use hierarchy navigators to evaluate a SQL hierarchy. For example, finding the descendant nodes of a node with the hierarchy node navigator> HIERARCHY_DESCENDANTS>> is more efficient than generating a new SQL hierarchy with this node as a root node. Furthermore, the hierarchy navigators add hierarchy columns that are not readily available otherwise.
NON_V5_HINTS
ABAP_HINT_END