Skip to Content
Technical Articles
Author's profile photo Mrinal Gandotra

Create SAP MDG custom hierarchies and datasources

Hello SAP community,

This blog post aims to cover the process to create and activate custom hierarchies and data sources which can be used by the BW (Business warehouse) for SAP MDG to SAP BW data extraction for reporting.

Using transaction code GS01, we can create set hierarchy for our custom hierarchy structure. We need to provide the table name along with the field name based on which we want to create the Set hierarchies. As soon as the set name is created, we can further create the set names under the head hierarchy and we can directly assign groups and the leafs to this set name.

We can see this information in SAP standard SET tables: SETHEADER, SETGROUP and SETLEAF.

Like we visualize profit center hierarchy structure using KCH3 and cost center hierarchy structure using KSH3 transaction codes, similarly we can visualize newly created custom hierarchy structure using transaction code GS03 by giving the newly created setname.

We can create the Hierarchy data source using transaction code BW07 and we can activate the data source using transaction code RSA5 and can extract the data using transaction code RSA3.

RSA3 transacion code to extract the data from data source:

NOTE: BW07 is only for hierarchy sets constructed using GS01 transaction code.

Another way of activating data source is by generating the data sources structures of the custom entity types in data modelling. You can go to transaction code MDGIMG and scroll down to node generate data model specific structures as highlighted in the below screenshot.

For more info,


Hope you will find this information useful.

Please like, share and comment.
If you have anything else please feel free to ask any question or add points.(

Happy Learning !!

Thanks & Regards,
Mrinal Gandotra
SAP MDG consultant


Assigned Tags

      You must be Logged on to comment or reply to a post.
      Author's profile photo Ajay Gopal
      Ajay Gopal

      Good info Mrinal but this info only serves GUI side because when we talk about MDG, then it should be enabled E2E.

      i have worked on multiple custom objects in MDG with hierarchy processing using MDG user interface but there is lot of challenges on data replication of hierarchy data.

      Did you explored anything this?



      Author's profile photo Mrinal Gandotra
      Mrinal Gandotra
      Blog Post Author

      Hi Ajay,

      Thanks for going through my blog.

      As mentioned in the blog that we can generate the structures for data source in MDGIMG data modelling and we can activate the data source in RSA5 and that data source will be activated and visible in RSA3 where you can extract the data and data can be replicated to BW for reporting. I explored only this, if you have any other information, please share 🙂