Sunday, 29 April 2018

How to use BW Infoobject hierarchy in ABAP CDS views

Introduction


◈ Hierarchies could be loaded or maintained manually in BW embedded in S/4HANA system.

◈ Considered approach is particularly relevant in case in S/4HANA there is embedded planning solution and you need to reuse existing hierarchy in analytical reports based on ABAP CDS views.

◈ Considered example will work correctly in case of simple parent-child hierarchies based on one characteristic, without text nodes or linked nodes.

Step-by-step

1.Consider infoobject MFICOCP04 “Reporting Section” and existing hierarchy in RSH1 t-code:



2. Create ABAP CDS views Dimension, Text, Hierarchy:





3. Analyse dimension VDM in RSRTS_ODP_DIS t-code and notice that hierarchy metadata is presented here.



4. Test of hierarchy display in RSRT:


5. Use annotations in analytics query to display hierarchy:

Below ABAP CDS view is needed to derive hierarchy name based on reporting year parameter, in example we had several hierarchies maintained for characteristic.



Analytical query code:


Note that derivation of hierarchy guid based on a hierarchy name may be not required in your case, just simplify solution (if needed)

Result


We considered creation of hierarchy ABAP CDS view based on BW Infoobject master data tables.

No comments:

Post a Comment