Custom Hierarchy Extraction in SAP BW 7.3 (Part 3)
Custom Hierarchy Extraction in SAP BW 7.3 (Part 3)
Custom Hierarchy Extraction in SAP BW 7.3 (Part 3)
3
(Part3)
• Load hierarchies in BW 7.3 using this Generic data source and hierarchy transformation
How to create a custom hierarchy and generic hierarchy data source are described in the below documents.
http://scn.sap.com/docs/DOC-27510
http://scn.sap.com/docs/DOC-30686
Once the data source is replicated and activated in BW system, we will see all segments in the data source,
similar to a standard hierarchy data source.
Once the transformation is created, we can see the mappings between source and target segments, and we
can access segments as below.
Segments:
Hierarchy header
By default, hierarchy name and object id from source are mapped to the corresponding fields in the target.
If the hierarchy is version dependent, the source field VERSION has to be mapped.
If the hierarchy is time-dependent, DATEFROM and DATETO have to be mapped. And the corresponding
target fields will appear only if these version dependency and time dependency settings are checked in the info
object hierarchy tab properties shown above.
Hierarchy Description
The above mapping for hierarchy description ensures, texts for the hierarchy header are loaded.
Hierarchy Structure
The field ZCOMPCODE has to be mapped from NODENAME with 'Hierarchy Split' assignment.
This is because, the source field NODENAME can contain text nodes like CC1, CC2, CC3 (in our example)
and it will also contain company code values 1000, 1001, 1003 etc. And only the company code values should
be mapped to the field ZCOMPCODE. The rule type 'Hierarchy Split' ensures this split between Nodes and the
values, and transfers the values to ZCOMPCODE.
This is needed because, from the source the info object comes as 'BUKRS', but this info object is not a valid
info object. And the corresponding field in BW is ZCOMPCODE in our case.
This mapping is also automatic, this ensures texts for the hierarchy nodes are filled.
To Value of Interval
For intervals, We need to map LEAFTO to ZCOMPCODE and add a code in the start routine of the
transformation.
This is the code generated by system, but by default commented. We need to uncomment this.
This code ensures that the intervals are splits from Segment 5 and added as single values to Segment 3. And
the values are stored in LEAFTO.
But after loading the hierarchy, intervals are visible, not the individual values.
This segment loads texts to the hierarchy levels. I didn't use it, and left it unmapped.
Now we are done with mappings of segments. Activate the transformation and create a full DTP and activate.
Create an info package for the data source and choose the custom hierarchy that we wanted to load.
Now Execute the IP and DTP. You can see the hierarchy is loaded to ZCOMPCODE and appears as below.
Any changes to the hierarchy can be done in ECC using GS02, and corresponding changes will be reflected in
BW hierarchy.