SAP SELECT CDS HIERARCHY



Get Example source ABAP code based on a different SAP table
  



SELECT, FROM cds_hierarchy

ABAP_SYNTAX
... cds_hierarchy$[sql_para$] ...

What does it do?
Specifies a CDS hierarchy cds_hierarchy as an SQL hierarchy hierarchy in an AB_SQL query. The CDS hierarchy is specified using its name cds_hierarchy defined after DEFINE HIERARCHY. If the CDS hierarchy has input parameters, actual parameters must be assigned to these in a parenthesized list sql_para.
The rows of the tabular result set of a CDS hierarchy specified as a data source are the hierarchy nodes of the SQL hierarchy and their columns are composed of the elements of the CDS hierarchy and the additional hierarchy columns that can be used to access the hierarchy attributes of the data source of the CDS hierarchy.



Latest notes:

When a CDS hierarchy is accessed, the hierarchy columns are read regardless of whether hierarchy attributes are listed in the element list. If a hierarchy attribute is defined as an explicit element of the CDS hierarchy, it is possible to access both the element and the additional hierarchy column in AB_SQL .
NON_V5_HINTS
ABAP_HINT_END

ABAP_EXAMPLE_VX5
Specifies a CDS hierarchy DEMO_CDS_SIMPLE_TREE as a data source of a SELECT statement in the class CL_DEMO_HIERARCHY_TREE with parameter passing and explicit access to the hierarchy columns.
ABEXA 01237
ABAP_EXAMPLE_END