Overview
The SyWay project will make use of Global Hierarchies to organise dimension values into logical groupings for reporting. The candidates for this approach have been captured in this related document: Reporting Hierarchies - Google Sheets
The purpose of this document is to provide additional guidance as to how to set up and maintain hierarchies.
The ‘Manage Global Hierarchies’ app
Hierarchies are created and maintained using the ‘Manage Global Hierarchies’ app, the standard SAP help for which can be found here.
Hierarchy Types
Before a hierarchy can be built a hierarchy type is needed. The hierarchy type defines the dimension (also known as characteristic and business entity) or combination of dimensions that can be included in the hierarchy. Multiple hierarchies can be built on each ‘hierarchy type’.
Hierarchies On Standard Hierarchy Types
There are a number of standard hierarchy types with standard hierarchies. These are automatically included in reports. This is achieved via a link between the hierarchy in the app and its inclusion in CDS dimension views e.g. I_PRODUCT
Custom hierarchies can be created on standard hierarchy types and they will also automatically be available for reporting.
Non-standard Hierarchy Types
Hierarchies may be required for dimensions, or combinations of dimensions, for which there is no existing hierarchy type. Custom hierarchy types must be defined to support these hierarchies. Eg vendor/supplier.
Non-standard hierarchy types will require custom development and therefore a request Jira will need to be created.
Simple (single dimension based) custom hierarchy types
These can be created through the ‘Manage Global Hierarchies’ app. However, these non standard hierarchies will only be available in reports e.g. Custom Analytical Queries or Std CDS views after completing these steps:
- Configuration of Business Entities: Global Hierarchies
- Configure Hierarchy Types
- Creation of the necessary cds views
- Hierarchy specific views for the Hierarchy, Nodes and texts.
- CDS view for a custom dimension e.g. zsupplier
- Extending reporting cds views with the custom dimension.
- These custom field extensions must be performed at the correct base level so that they are included in the datasphere extraction
- Creating the Global Hierarchy using the Maintain Global Hierarchies app.
- Activated hierarchies will appear in tables hrrp_node and hrrp_directory
More complex needs
If a hierarchy needs to have levels that are other dimensions, this can be accommodated via configuration (transaction UHIMG).
E.g. a product hierarchy that is based on both material type and material group, or customer hierarchy based on sales org, distr channel, division
Additional reading
SAP Manage Global Hierarchies Help
2922493 - Extensibility with Hierarchies
ExtendGlobalHierarchiesWithCustomHierarchy.pdf
Note that there is a where clause not explained in the document to avoid reading the not assigned node.
Sample Code
Example of code to be used in CDS views for custom hierarchy types. N.B. the standard documentation does NOT include the last where clause which is essential for the code to function.