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

/wp-content/uploads/2015/03/1_672601.png

If we need external characteristics in the hierarchy tree, we can include them by clicking on the tab button

/wp-content/uploads/2015/03/2_672623.png

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.

Select the check box -”Hierarchy is Flexible”, if we have compounding Attributes.

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.

/wp-content/uploads/2015/03/4_672625.png

File structure:

/wp-content/uploads/2015/03/5_672632.png

We can also create an example file to check the file structure by clicking on the tab button

/wp-content/uploads/2015/03/6_672634.png

Hierarchies are loaded as multiple segments. The different segments of this hierarchy are seen in the ‘Segments/Fields’ tab.

/wp-content/uploads/2015/03/7_672638.png

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,

/wp-content/uploads/2015/03/8_672639.png

Preview of different segments is possible in the ‘Preview’ tab.

/wp-content/uploads/2015/03/9_672640.png

If we select the segment – Node Intervals, it will show the  “To values”  in the intervals.

/wp-content/uploads/2015/03/10_672644.png

The structure of the file is as below –

  1. S.No

Field Name

Data Type

Length

Description

Comments

1

NODEID

NUMC

8

Node ID

2

IOBJNM

CHAR

30

Info Object Name

3

NODENAME

CHAR

32

Node Name

4

LINK

CHAR

1

Link name

5

PARENTID

NUMC

8

Parent Node

6

LANGU

LANG

1

Language Key

7

TXTSH

CHAR

20

Description – Short

8

TXTMD

CHAR

40

Description – Medium

9

TXTLG

CHAR

60

Description – Long

10

INTERVL

CHAR

1

Interval

11

/BIC/Z_PLANT

CHAR

8

Plant

From plant

12

TO_Z_PLANT

CHAR

8

Interval – Plant

To Plant

Sample File to load plant hierarchy is as below:

/wp-content/uploads/2015/03/11_672645.png

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

           data Z_PLANT will be reflected in the hierarchy.

Step 3: Create Info package and Click on Create Header (To maintain the Hierarchy technical name and Description).

/wp-content/uploads/2015/03/12_672646.png

You will find the Hierarchy name in the ” Hierarchy Selection ” Tab:

Step 4: Select the appropriate Hierarchy ( In our case it is INDIA)

/wp-content/uploads/2015/03/22_672656.jpg

Step 5: Create transformation for the hierarchy info object

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

/wp-content/uploads/2015/03/13_672657.png

Step 6: Create DTP  for hierarchy load

/wp-content/uploads/2015/03/14_672658.png

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.

/wp-content/uploads/2015/03/15_672659.png

If we select DTP error handling ‘Deactivated’, it will show the appropriate error message:

/wp-content/uploads/2015/03/16_672661.png

As seen in the screen below, the appropriate error message is shown in the case of duplicate nodes.

/wp-content/uploads/2015/03/17_672662.png

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:

/wp-content/uploads/2015/03/18_672663.png

You can also refer to the below helpful links:

http://scn.sap.com/docs/DOC-24996

http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/601b0771-92c4-2d10-a081-f947a516bd20?QuickLink=index&overridelayout=true&49267570152717

To report this post you need to login first.

4 Comments

You must be Logged on to comment or reply to a post.

  1. John Betterman

    Thanks, this is really useful information. Now, I can see that the values (nodes) for intervals are not there. How do you add them? Do you add them manually or there is a better way to automatically add them (if there are many)?

    (0) 

Leave a Reply