Hierarchy Loads using Transformation from Version BW 7.3 onwards.
Here I am trying to load hierarchies from one object to another Info provider specific object in BW 7.4
I have covered below 2 scenarios in the below example :
Scenario 1 : If the Source Object has NO External Hierarchy object.
Scenario 2 : If the Source Object has an External Hierarchy object.
Scenario 1 : If the Source Object has NO External Hierarchy object.
Source Info object : Y_ACC
Target Info Object : Z_ACC
LOOP AT SOURCE_PACKAGE_3 ASSIGNING <SOURCE_FIELDS_3>.
if <SOURCE_FIELDS_3>-H_IOBJNM <> '0HIER_NODE'.
<SOURCE_FIELDS_3>-H_IOBJNM =’Z_ACC'.
endif.
ENDLOOP.
Note : SOURCE_FIELDS_3 represents segement 3 ( Hierarchy Structure )
Provide the Application component and InfoArea name where you need this Characteristics to be displayed as Infoprovider.
Once the characteristic is defined as info provider specific you can see the same object in the Info provider under the specified Info area ( under Infoprovider ) and Application component ( under infosources )
In the above screen shot we have attributes, Hierarchies and Texts because we have enabled them in the infoobject Properties under Master Data/Texts tab ( with Master Data and With Text ) and in the Hierarchy tab ( With Hierarchy )
Now we connect Target object with Source object using Transformation.
Right click on the Hierarchy Target Object ( Z_ACC ) and select Create Transformation from the context menu as specified below :
Any Hierarchy has the following segments 5 Segments :
- 1. Hierarchy Header
- 2. Hierarchy Description
- 3. Hierarchy Structure
- 4. Texts for Text Node
- 5. Texts for Hierarchy Level
Under each segment the mapping between Source and Target is Direct assignment. Please check the below screen shots for the mapping under each segement.
1. Hierarchy Header
2. Hierarchy Description
3. Hierarchy Structure
4. Texts for Text Node
5. Texts for Hierarchy Level
Scenario 2 : If the Source Object has an External Hierarchy object.
Note : Y_SET is an external object for Source Object Y_AUD.
Z_SET is an external object for Target Object Z_AUD.
Steps are same as specified above except in the start routine you need to also map external BW Target Object to Source Object.
Please check below for the Start routine code and also the screen shot of source and Target Objects.
The Start routine code is as follows :
LOOP AT SOURCE_PACKAGE_3 ASSIGNING <SOURCE_FIELDS_3>.
if <SOURCE_FIELDS_3>-H_IOBJNM EQ 'Y_AUD'.
<SOURCE_FIELDS_3>-H_IOBJNM ='Z_AUD'.
else.
if <SOURCE_FIELDS_3>-H_IOBJNM EQ 'Y_SET'.
<SOURCE_FIELDS_3>-H_IOBJNM ='Z_SET'.
endif.
endif.
ENDLOOP.
In my next document I will update the details of how to upload hierarchies from DSO which has Node id and Parent id.