Custom Hierarchy Extraction in SAP BW 7.3

14
Custom Hierarchy Extraction in SAP BW 7.3 (Part1) created by Bindu Priya Chaluvadi on May 2, 2012 3:59 PM, last modified by Bindu Priya Chaluvadi on Aug 10, 2012 10:38 AM Version 2 inShare Topic: The purpose of these articles is to Create a custom hierarchy in R/3 Create a Generic Hierarchy data source for the hierarchy created above in R/3 Load hierarchies in BW 7.3 using this Generic data source and hierarchy transformation System: SAP BI 7.3, ECC 6.0 Step by Procedure to Create a Custom Hierarchy in ECC: Lets take example of Company code. We want to see company code hierarchy in reports. Assume there is no standard hierarchy available for company code in ECC. Below steps show how to create a SET Hierarchy for company code in ECC. Goto t-code GS01, give the set name as the hierarchy name (top most node) you want to see and the Table as T001. Then click on Hierarchy maintenance which will ask for the field on which you want to create the set. Choose BUKRS since we want to create hierarchy for Company code. Then press enter.

description

Hierarchies in BW 7.3

Transcript of Custom Hierarchy Extraction in SAP BW 7.3

Page 1: Custom Hierarchy Extraction in SAP BW 7.3

Custom Hierarchy Extraction in SAP BW 7.3 (Part1)created by Bindu Priya Chaluvadi on May 2, 2012 3:59 PM, last modified by Bindu Priya

Chaluvadi on Aug 10, 2012 10:38 AMVersion 2inShare

Topic: The purpose of these articles is to 

Create a custom hierarchy in R/3 Create a Generic Hierarchy data source for the hierarchy created above in

R/3 Load hierarchies in BW 7.3 using this Generic data source and hierarchy

transformation System: SAP BI 7.3, ECC 6.0 Step by Procedure to Create a Custom Hierarchy in ECC: Lets take example of Company code. We want to see company code hierarchy in reports. Assume there is no standard hierarchy available for company code in ECC. Below steps show how to create a SET Hierarchy for company code in ECC. Goto t-code GS01, give the set name as the hierarchy name (top most node) you want to see and the Table as T001. Then click on Hierarchy maintenance which will ask for the field on which you want to create the set. Choose BUKRS since we want to create hierarchy for Company code. Then press enter. 

Page 2: Custom Hierarchy Extraction in SAP BW 7.3

    

You see the hierarchy maintenance screen where in enter the description for heirarchy header. 

 

Place the cursor on CC and click on 'Lower Level' to create nodes below CC. Example nodes as CC1, CC2 and CC3 along with their descriptions.Now we want to assign company code values to the nodes CC1, CC2 and CC3. Place the cursor on CC1 and click on 'Value/Interval'.And enter the company codes which should belong to the node CC1. Repeat the steps for nodes CC2 and CC3 and Save the Set. The t-codes GS02 can be used to change the set hierarchy.

Page 3: Custom Hierarchy Extraction in SAP BW 7.3

GS03 for displaying the hierarchy and GS04 for deleting the set hierarchy,. Finally the created hierarchy looks like this. 

 

Now the hierarchy is ready in ECC. How to extract this hierarchy to BW will be shown in my next documents. Part 2:

Custom Hierarchy Extraction in SAP BW 7.3 (Part2)created by Bindu Priya Chaluvadi on Aug 9, 2012 3:37 PM, last modified by Bindu Priya

Chaluvadi on Aug 10, 2012 10:36 AMVersion 2inShare

System: 

SAP BI 7.3, ECC 6.0 In my previous article, we have seen how to create a custom hierarchy in ECC.http://scn.sap.com/docs/DOC-27510 Here we talk about how to create a Generic hierarchy data source to extract this custom hierarchy in ECC. To create a generic hierarchy datasource for the set hierarchy created using GS01,goto the t-code BW07. Since the hierarchy is based on company code, choose the table T001 and field as BUKRS. 

Page 4: Custom Hierarchy Extraction in SAP BW 7.3

 

And give the name of the data source, and execute. Below pop up appears. Press YES. 

Then data source will be generated and available in RSA6. 

Page 5: Custom Hierarchy Extraction in SAP BW 7.3

 

The custom hierarchy exatraction using this data source can be tested in RSA3. 

 

And this data source has to be replicated and activated in BW. Next step is to create hierarchy transformation from this data source to the info object.

Page 6: Custom Hierarchy Extraction in SAP BW 7.3

Custom Hierarchy Extraction in SAP BW 7.3 (Part3)created by Bindu Priya Chaluvadi on Aug 10, 2012 10:42 AM, last modified by Bindu Priya

Chaluvadi on Aug 10, 2012 11:54 AMVersion 1

In this document, we will see 

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-27510http://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.

Lets assume that intervals are also permitted in the hierarchy. These are the hierarchy tab settings of master data ZCOMPCODE.

Page 7: Custom Hierarchy Extraction in SAP BW 7.3

Now, right click on the ZCOMPCODE hierarchy to create transformation. 

 

Choose the data source and source system.

Once the transformation is created, we can see the mappings between source and target segments, and we can access segments as below.

Page 8: Custom Hierarchy Extraction in SAP BW 7.3

 

 

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 

Page 9: Custom Hierarchy Extraction in SAP BW 7.3

All the fields other than ZCOMPCODE will be mapped automatically. 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. Also, We need to add a routine for mapping 0H_IOBJNM from IOBJNM.  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. So the below routine has to be included.

Texts for Text Node

Page 10: Custom Hierarchy Extraction in SAP BW 7.3

 

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. Texts for Hierarchy Level 

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.

Page 11: Custom Hierarchy Extraction in SAP BW 7.3

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. 

Page 12: Custom Hierarchy Extraction in SAP BW 7.3

Include the IP and DTP in a process chain. Any changes to the hierarchy can be done in ECC using GS02, and corresponding changes will be reflected in BW hierarchy. This concludes the topics of  

Create a custom hierarchy in R/3 Create a Generic Hierarchy data source for the hierarchy created above in R/3 Load hierarchies in BW 7.3 using this Generic data source and hierarchy

transformation