Hierarchy Flat File Loading
Hierarchy Flat File Loading
Introduction:
Certain reporting scenarios in SAP BW require hierarchical representation of master data. To enable these
master data in BW there has to be maintained as hierarchies. Examples of few hierarchies are Material, GL
Account, Cost Center, Organization structure etc.
In BW, the characteristic hierarchies are enabled in the tab ‘Hierarchy’. Depending on the requirement, the
properties could be selected. This document describes loading/maintaining of a non-time dependent hierarchy
with intervals. We are considering flat file loading scenario in the version of SAP BW 7.3.
Step 1: Create the Info object bearing hierarchy and choose the desired properties
If we need external characteristics in the hierarchy tree, we can include them by clicking on the tab button
Step 2: Create the Flat file data source
While creating the Data source, if we select “hierarchy is flexible”, the Data Source will be created with the new
structure, if we leave it blank the Data Source will be created with the old structure.
The checkbox ‘Intervals permitted in hierarchy’ is enabled when we click on ’Read Info Object properties’, as we
have already selected this option in info object definition.
File structure:
We can also create an example file to check the file structure by clicking on the tab button
Hierarchies are loaded as multiple segments. The different segments of this hierarchy are seen in the
‘Segments/Fields’ tab.
Segments are created based on the hierarchy properties. For example, we got the 5th segment ‘Node Intervals’,
as we are creating a hierarchy with intervals,
Preview of different segments is possible in the ‘Preview’ tab.
If we select the segment – Node Intervals, it will show the “To values” in the intervals.
The structure of the file is as below –
Note: The sample file above has texts as well in row no. 16 , these are loaded only till PSA and will not be
reflected in the hierarchy. But the texts maintained for the master
Step 3: Create Info package and Click on Create Header (To maintain the Hierarchy technical name and
Description).
You will find the Hierarchy name in the ” Hierarchy Selection ” Tab:
All the segments have the corresponding mappings done in transformations. For this scenario of hierarchy with
intervals, we need to do the mapping from TO_Z_PLANT to Z_PLANT as it is not auto-generated
Step 6: Create DTP for hierarchy load
The setting for DTP error handling has to be ‘Deactivated’. If we set it as ‘No update, No reporting’ we cannot see
the exact error when hierarchy data load fails.
If we select DTP error handling ‘Deactivated’, it will show the appropriate error message:
As seen in the screen below, the appropriate error message is shown in the case of duplicate nodes.
Based on the error displayed, we have to ask the business to correct the data in the Flat File and we have to
reload it.
After loading the data hierarchy we can see single nodes and intervals as shown below: