Monday, 30 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.

1 comment:

  1. Hi Sabrina,
    I have an requirement to bring Custom BW embedded S/4HANA Hierarchy to BW4HANA system.
    Its built on Custom Info object in S4-BW embedded system and its available in RSH1.
    Can you suggest me can I create Hierarchy data-source by using this approach.

    Any suggestion highly appreciated.
    Thank you in advance

    ReplyDelete