Beruflich Dokumente
Kultur Dokumente
Applies to
SAP R/3, SAP BIW 3.5, SAP NetWeaver 7.0
For more information, visit the Business Intelligence homepage.
Summary
This document talks about the architecture that we can use for extracting the custom hierarchy, which is
maintained in custom table or in standard SAP tables for which no data source is provided by SAP as part of
business content.
Author Bio
Nilesh Ahir has completed his masters in Software System from BITS Pilani. He has total 4
years of SAP experience. He has been working as SAP NW BI Application consultant for
IBM India for last one year. Prior to this he was working with Intel India. He has experience in
ABAP, BW3.5 / BI7.0 and Data mining. He has worked on other non–SAP technologies like
TIBCO and web services.
Table of Contents
Introduction ......................................................................................................................................................... 3
Business Scenario .............................................................................................................................................. 4
Alternatives Available ...................................................................................................................................... 5
Problem with Existing SAP Functionality ........................................................................................................ 5
Existing File Based Architecture Used for Loading Custom Hierarchy .............................................................. 5
Disadvantages of Using File Based Architecture ............................................................................................ 6
Proposed Architecture ........................................................................................................................................ 6
Advantages of New Proposed Architecture .................................................................................................... 6
Detailed Architecture ....................................................................................................................................... 7
Explanation of Detailed Architecture ............................................................................................................... 8
Step by Step Implementation Guide ............................................................................................................... 8
Limitations ....................................................................................................................................................... 9
Related Content ................................................................................................................................................ 10
Appendix ........................................................................................................................................................... 11
Disclaimer and Liability Notice .......................................................................................................................... 17
Introduction
Hierarchies are the parent child relationship between different things. In layman terminology - a series of
ordered groupings of people or things within a system.
We have hierarchies in SAP R/3 system maintained in Standard SAP tables and for them data sources are
provided by SAP as part of business content. These hierarchies are called as SAP Standard Hierarchies.
Where as we can have our own hierarchies which may or may not stored in Standard SAP tables, these are
called as Custom Hierarchies.
Root Node
World
Level 1
Geo Hierarchy
Business Scenario
We want to extract custom hierarchy, which is maintained in custom tables or in SAP standard tables for
which no data source is provided by SAP as part of business content.
For example: Commodity schema hierarchy - A Commodity Schema is the complete list of commodity codes
representing all commodities which an Organization uses for indirect materials like stationary items, laptops
etc.
This is a custom hierarchy and every organization has its own hierarchy
chy structure.
Commodity
Schema root
node
Stationary
Laptops
items
Cafeteria Other
items eg electronic
paper cups good
Alternatives Available
SAP BW/BI will allow you to load hierarchy by following two ways –
1. By using standard SAP data source – as there is no standard data source provided by SAP for our
custom hierarchy, this option is no more feasible.
2. By using file interface – this is the only alternative available with us to load custom hierarchies. But
this involve lots of complexity, dependencies and it is time consuming.
SAP BW/ BI
SAP R/3 Application DS System
System Server
Landscape for loading the custom hierarchies using flat file interface
Proposed Architecture
Following is the proposed architecture for loading custom hierarchies.
As per the architecture, we will create a generic data source for the custom hierarchy that will behave similar
to standard SAP hierarchy data source. We will use this generic data source for extracting the custom
hierarchy using standard data staging ETTL process.
SAP BW/ BI
SAP R/3 System
System DS
Landscape for loading the custom hierarchies using generic data source
Detailed Architecture
FM : ZFM_HIER_WRAPPER
FG :
ZBW_CUSTOM_HI
ERARCHY
FORM : EXTRACT_HIER
YCUSTOM_
HIER
Decision for which FM to
call
SAP R/3
System
ZFM_DS_TEST FM 2 FM 3
SAP / Custom
DataBase
Tables holding
Hierarchy
Inforamtion
Note: Pass the name of Hierarchy while executing the info package and it should be same as that of data source for
custom hierarchy in SAP R/3
Note: For second data source for custom hierarchy follow the steps from 6 to 16.
Limitations
This architecture support only extraction of hierarchies that are not version dependent.
Related Content
SAP Library – BIW3.5 - Architecture
SAP Library – BIW3.5 - Hierarchies
SAP Library – BIW3.5 – Loading Hierarchies
Appendix
1.1 Structure of YCUSTOM_HIER table
Note: Name of Data source should same as name of custom hierarchy. At extraction level in selection screen we have to
mention the name of Hierarchy which is mandatory.
Also maintain the FM name that will be used for extracting the custom hierarchy.
e.g.
1.2 Pseudo code for program for generating the generic data source for custom hierarchy.
Use following pseudo code for generating the DS for Custom Hier
*&---------------------------------------------------------------------*
*& Report ZBW_CREATE_CUST_HIER_DS
*&
*&---------------------------------------------------------------------*
*&
*&---------------------------------------------------------------------*
REPORT ZBW_CREATE_CUST_HIER_DS.
tables :
roohiecat,
roohiecom,
rodchabas,
roosfield,
roosource,
roosourcet,
roosseg,
rohiebas.
start-of-selection.
append t_roohiecat.
IF subrc = 0.
* Hierarchy not found
RAISE hierarchy_tab_not_found.
ENDIF.
pt_foldert .
Else .
Pv_subrc = 1 .
ENDIF.
Endform.
1.5 Pseudo code for Function module specific to your custom hierarchy (ZFM_DS_TEST).
* Build custom logic in this function module and fill the internal tables passed
to it in required format.
* Fill internal tables e.g. pt_hienode & pt_foldert
1.6 Screen shot of program for creating generic data source for custom hierarchy