This action might not be possible to undo. Are you sure you want to continue?
ASAP FOR THE BW ACCELERATOR
BUSINESS INFORMATION WAREHOUSE
Information about and Examples of Using Hierarchies in the SAP BW
SAP (SAP America, Inc. and SAP AG) assumes no responsibility for errors or omissions in these materials. These materials are provided “as is” without a warranty of any kind, either express or implied, including but not limited to, the implied warranties of merchantability, fitness for a particular purpose, or non-infringement. SAP shall not be liable for damages of any kind including without limitation direct, special, indirect, or consequential damages that may result from the use of these materials. SAP does not warrant the accuracy or completeness of the information, text, graphics, links or other items contained within these materials. SAP has no control over the information that you may access through the use of hot links contained in these materials and does not endorse your use of third party web pages nor provide any warranty whatsoever relating to third party web pages.
AND SAP AG TABLE OF CONTENTS . INC.BUSINESS INFORMATION WAREHOUSE – HIERARCHIES ©2000 SAP AMERICA.
1. 1. but should apply to all versions of BW. A hierarchy in the SAP BW has the following properties: • Hierarchies are created for base characteristics (characteristics involving master data) in the SAP BW. • Several hierarchies can be defined for a single characteristic. and are therefore valid for all InfoCubes and can be modified.BUSINESS INFORMATION WAREHOUSE .0B. One example of a base characteristic is the cost center (InfoObject 0COSTCENTER). Hierarchies for the cost center can then be applied to both sender and receiver cost centers.1 Software Version Supported This document was written specifically for BW version 2. Definition and Terms 2. • Hierarchies are saved in special master data tables of a characteristic.2 Definition and Properties A hierarchy models the grouping and structuring of a characteristic by individual evaluation criteria.0B. • A hierarchy can contain a maximum of 98 levels. The following diagram shows an example of a hierarchy in the BEx Analyzer: 3 . based on specific examples.2 • • • References Loading InfoSource Data via Flat Files Multi-Dimensional Modeling with BW Authorizations and Roles 2 Introduction. 2. • Hierarchies can be loaded from an R/3 System or from a file.1 Objectives The aim of this documentation is to explain the various options for modeling data using hierarchies in the SAP Business Information Warehouse.HIERARCHIES 1 Introduction This document provides background information on hierarchies used in the SAP Business Information Warehouse. This document is written for software version 2. or can be manually created and changed in the BW. They behave the same as master data.
or as attributes of a characteristic. 4 . As the diagram shows. a hierarchy also differs from a modeled hierarchical structure in the dimensions and attributes displayed in the BEx.BUSINESS INFORMATION WAREHOUSE .HIERARCHIES Hierarchical structures can also be modeled within an InfoCube. which is not contained in the SAP BW standard (see Chapter 4). Hierarchical structures that are modeled in dimensions cannot be changed without a comprehensive realignment. in the dimensions. Hierarchical structures are not the subject of this documentation and will not be mentioned further.
1.3. We differentiate between two different types of nodes: • Nodes that can be posted to Nodes that can be posted to are themselves valid characteristic values of the base characteristic.3 Hierarchy Level All the nodes that have the same spacing to the roots form a hierarchy level. Intervals in hierarchies must be allowed during InfoObject maintenance. a leaf cannot have any children. They are also displayed as nodes – that is. When intervals are involved.3. the name of this characteristic node is taken from the master data table (text table. 5 . 2. but cannot be allocated several times to the same node. 2. please note that these intervals are resolved in the presentation hierarchy and do not have any texts of their own.1.g. When a characteristic node is presented. The roots of the hierarchy have level 1. The values of leaves that appear several times are only taken into account once in the higher-level nodes. a name must be defined directly as a text. 2. Accordingly. A leaf can appear several times in the same hierarchy.HIERARCHIES 2. New characteristic values are arranged automatically. sales with subsidiaries and corporate group itself • Nodes that cannot be posted to An object that does not refer to the characteristic on which the hierarchy is based. The level of a node measures the spacing between that node and its root.4 Leaf A leaf is an object that is a characteristic value of the base characteristic. and can therefore have values in the fact table.2 Root All nodes that do not have parents are called roots.3. Intervals can be modeled in hierarchies when many leaves (which describe an interval) are assigned to a node.1. We differentiate between characteristic nodes and text nodes.3. corporate group with subsidiaries. however. the characteristic attributes of the characteristic to which the hierarchy applies is located at the last level in the hierarchy (e.1 Terminology Nodes Nodes are objects that form a hierarchy.1. Examples: customer hierarchy. for example. A node can have children (additional sub-nodes). For text nodes. nodes that can be posted to are displayed as leafs containing the facts saved directly for this characteristic value.3 2. Examples are cost element hierarchies or quarterly hierarchies that are described by intervals.1. an aggregation of the values of all the children of the node that can be posted to. In general. characteristic attributes = leaves). Please note that the value of a node that cannot be posted to is calculated exclusively as the aggregation of the values from the children of that node. In contrast to nodes that can be posted to. A characteristic node is defined by a characteristic and the values of that characteristic. 2. values can be saved for these nodes in the fact table. When the data is presented in the BEx Analyzer Workbook. region in the customer hierarchy).3.BUSINESS INFORMATION WAREHOUSE . a hierarchy only has one root. Usually.5 Interval Describes a set of leaves through the upper and lower limits.
InfoObject) must be unique (on a given key date). version. The values of all other nodes are determined by aggregating the leaves and nodes that can be posted to. and key date.6 Balanced and Unbalanced Hierarchies Balanced and unbalanced hierarchies balanced hierarchy unbalanced hierarchy A typical balanced hierachy is a geographic hierarchy with levels such as continent – country – state – region – city A special type of unbalanced hierarchies might occur if different sources can provide information only at different levels (for example one source can deliver data at material level while the other deliver data only at material group level) ©SAP AG 2000 (Joachim Mette) / 1 Remarks • The fact table contains values exclusively for leaves and the nodes that can be posted to.1. • • 6 . Every node (node name. A hierarchy is uniquely identified by its name.3.BUSINESS INFORMATION WAREHOUSE .HIERARCHIES 2.
you can specify the “Start expand level”. Only nodes that have values are displayed. If you do not want the presentation hierarchy to start with the root node. have the breakdown in the rows correspond to the hierarchical arrangement of the characteristic values. which you can expand down to the individual leaf level. in the upper-most node of the hierarchy. Use the context menu (right mouse button) to maintain the “Properties” of the characteristic. The additional breakdown of a further characteristic in the rows is not possible (with the exception of batch printing). You select a presentation hierarchy for a characteristic when you define a query. and then the “Key date” for evaluating the hierarchy. You can first select the “Hierarchy name”. Lastly.BUSINESS INFORMATION WAREHOUSE .1 Presentation Hierarchy To use a hierarchy as a presentation hierarchy. the start level is the spacing to this node. you can restrict the expansion in the rows of the BEx Analyzer workbook by a node in the hierarchy. There are a number of options for selecting a “presentation hierarchy” at the bottom of the window.HIERARCHIES 3 Using Hierarchies in a Query 3. You have to set the “Active” flag for a hierarchy before you can evaluate it in the BEx Analyzer workbook. 7 . The value of a key figure is displayed first. and is followed by all the children of that node. then the “Version”. the number of levels to display when running the query. The values of the nodes in a level are calculated by aggregating all the nodes that can be posted to and leaves of the underlying levels. In this case.
HIERARCHIES You can also specify variables when you select a hierarchy.BUSINESS INFORMATION WAREHOUSE . The following technical InfoObjects are available for this purpose: • • 0HIER_VERS: Hierarchy version 0DATE: Calendar day 8 .
use the contextsensitive menu in the workbook. you can also change the position of a hierarchy root node in the workbook. 9 . To select this function.0 enables you to hide nodes that only contain a single leaf. You can define these settings as default values in the hierarchy definition.HIERARCHIES Starting in BW Release 2.0. Another new feature in BW Release 2. This makes a bottom-up evaluation possible.BUSINESS INFORMATION WAREHOUSE .
BUSINESS INFORMATION WAREHOUSE . selecting the key figures “Sales” and “Order quantity” with a filter on node “Asia”. as a filter in a query. The following options are available for restricting a hierarchy node: • • • • Setting a filter in the query Limiting the characteristic to one hierarchy node in the row/column definition Limiting a structure element to one hierarchy node Creating a restricted key figure that is limited to one hierarchy node You can use a different hierarchy to present the data in all these cases. In the process.2 Hierarchy Filter Function A node in a hierarchy can be used for selection like a characteristic value. and the “Material hierarchy” is displayed as the presentation hierarchy for the analysis. both the node and the hierarchy can be determined through variables.HIERARCHIES 3. Example: Sales and order quantity for customers in Asia – that is. 10 .
BUSINESS INFORMATION WAREHOUSE . he or she only has to choose a version in order to select the correct cost center hierarchy. the cost center hierarchy in both actual and plan versions – for simulation purposes. Alternatively.1 Node Name A node is identified by its name (or by the InfoObject that acts as the node). From the technical perspective. with the corresponding sales figures. and are not added several times. and Mexico are grouped together under NAFTA. Canada. If a node appears several times in a hierarchy. This causes the node to inherit the entire substructure of the original node. the aggregation is corrected accordingly.HIERARCHIES 4 Special Properties of Hierarchies 4. This means the node name must be unique in the hierarchy. The countries USA. you can use two different hierarchy structures with two different names to achieve this. If both nodes appear in the same place in the hierarchy. 4. you can assign one name and use two versions to model the “actual” and “planned” variants. to define a cost center report in which the name of the cost center hierarchy is predefined and a variable is defined for the “version” (parameter variable for InfoObject “0HIER_VERS”). Please note that values from nodes/leaves that are assigned several times are only counted once. when the enduser runs the query. for example. The hierarchy shown above contains an economic structure in addition to the geographical structure. These countries are also assigned to the respective continents.2 Version You sometimes have to analyze a characteristic under different hierarchical structures – for example.3 Time Dependent Hierarchies 11 . This enables you. Then. 4. you must set the “link indicator”.
Please note that there is no link between the temporal component of the data (document date of the key figure) and the validity interval of a node/leaf within the hierarchy structure. 2000 to December 31.HIERARCHIES Time dependent hierarchies were not taken into account in the information above. The key date of the query (global query properties) and the key date of the hierarchy are completely independent of one another.01.1999 01. #1002 (Greg Hunter): Sales Rep. Until now. the structure of a hierarchy always represented the present status. Hierarchy key date December 31.00 In the hierarchy defined with a “time-specific structure”. If you change the hierarchy. To model the historical view. 1999 2. 1002 1002 0CALDAY 01. and to sales region “Canada” from January 1. 9999. 2000 12 . you either have to model the hierarchy time-dependent or create a second version. Hierarchy key date December 31. 1999. 1980 to December 31. then all the key figures are displayed for the modified structure.00 300. Example: The fact table contains two entries for Sales Rep. by moving a leaf to another node.BUSINESS INFORMATION WAREHOUSE .2000 Currency USD USD Revenue 400. 1. Greg Hunter is assigned to sales region “USA” from January 1. The data is evaluated in the hierarchy structure for the requested key date chosen for the hierarchy.01. Sales Rep. for example.
4. If you do not define a key date for a hierarchy. then the execution date of the query applies for the hierarchy. 13 . it will be evaluated on the key date that is defined in the query properties (menu item in the Query Builder). Hierarchy key date December 31.HIERARCHIES 3. If no key date has been defined in the query properties. 2000 and filter value for 0CALDAY = January 1. You can also use a variable to determine the key date. The enables the user to choose a key date for query analysis (or have the system determine one automatically). the query definition can include a key date – in addition to the hierarchy name and version – on which the hierarchy will be evaluated.3.BUSINESS INFORMATION WAREHOUSE . 2000 This means if the time characteristic is not restricted.1 Key Date Evaluation When time-specific hierarchies are involved. all the values of a node/leaf in the fact table will be aggregated under the hierarchy structure that is valid as of the selected key date.
and you want to record a history. There is no difference between the two options in the results of the query. which means you can skip levels . time dependency has been implemented in two different ways. which means you can skip levels 14 • Hierarchy applies to the • InfoObject. aggregates can be used for the hierarchy. This type of time dependency is called “time-specific hierarchy structure” in InfoObject maintenance. 1. and can therefore be evaluated for the InfoObject for all InfoCubes Aggregates must be used to achieve high-performance analyses Drill-down path is predefined by the hierarchy structure • The hierarchy can only be evaluated in the InfoCube • • High-performance analyses are possible without using aggregates • • • The drill-down path is not • predefined. if you extract the hierarchy structure from the OLTP system monthly. you can model the time dependency in the hierarchy name. The following aspects can help you decide which data model to use: Hierarchy • • The “as posted” view is not possible Different views of the data – such as version. only the aggregates that are grouped by the characteristic values can be used. the hierarchy name is used to determine a structure. In this variant. When a time-specific hierarchy structure is involved. we recommend modeling the time dependency in the hierarchy name. the structure is evaluated at the query runtime. 2. 4. and can therefore be evaluated for the InfoObject for all InfoCubes Aggregates must be used to achieve high-performance analyses The drill-down path is not predefined. you can also model a hierarchical structure in the dimensions or via the attributes of a characteristic. For example. 5 Aspects of Data Modeling As an alternative to using external hierarchies. Time-specific hierarchy structure Each parent-child relationship has a defined time interval for which this relationship is valid.3. Time-specific hierarchy name The key (identifier) of the hierarchy structure.HIERARCHIES 4. The respectively valid hierarchy structure is determined from the name and the key date. key date – are possible Hierarchy in dimension • Only the “as posted” view is possible Hierarchy via attributes • • The “as posted” view is not possible Different views of the data are not possible. which consists of the name and version. which is then evaluated with the key date.BUSINESS INFORMATION WAREHOUSE .3. You cannot use any aggregates that contain pre-summarized data in the levels.2 Time Dependency: Technical Background For performance reasons. In this case. This type of time dependency is called “time-specific hierarchy name” in InfoObject maintenance. In this case. is extended with the validity interval. only the view that is valid in the characteristic master record on the evaluation date The hierarchical structure is modeled in the master data.3 Recommendation for Using Time-dependent Hierarchies For hierarchy structures that are constant for longer periods of time (such as a month or more).
a hierarchy should not contain more than 100. the reading of data on demand (2) provides much better performance than reading all the data (1). which means only leveled hierarchies are possible Duplicate lesaves are only taken into account “as posted” Reorganization is not possible without reloading the InfoCube • • Duplicate leaves are taken into account wherever they appear The hierarchy can be changed quickly • • • • 6 Performance 6.2 Size of a Hierarchy For performance reasons. A query that contains two or more free characteristics from different dimensions (such as “Customer” and “Product”). For queries about such large hierarchies. When expanding a hierarchy node. the data for the entire – meaning completely expanded – hierarchy is requested for a hierarchy drilldown. new data is read for each navigational step.1 Read Mode for a Query You can set the read mode per query or for all queries in the transaction RSRT (Query Monitor). the children of the node are then respectively read on demand.000 leaves. 6. aggregates should be created a middle level of the hierarchy and the start level of the query should be smaller or the same as this aggregate level. all new navigational states are aggregated and calculated from the data of the main memory. Therefore. which is needed for all possible navigational steps in the query. If the hierarchy grows larger. • Reading on demand when expanding the hierarchy: When reading data on demand (2). free characteristics.HIERARCHIES Hierarchy • Non-leveled hierarchies are possible Hierarchy in dimension • Hierarchy via attributes The different attributes of the dimension correspond to the levels of the hierarchy. the read on demand when expanding the hierarchy method (3) should be set. all of the fact table data. will probably only be efficiently executable in this mode. which means only leveled hierarchies are possible Duplicate leaves are not possible Reorganization is possible by selecting additional attributes The different attributes of the • dimension correspond to the levels of the hierarchy. if possible. 15 . For large hierarchies. The most suitable aggregate table is used and. This read mode should especially be considered for queries with many. For the read on demand when expanding the hierarchy (3). The data for identical navigational states is buffered in the OLAP processor. BW supports the following three read modes: • Reading all of the data When executing the query in the Business Explorer. Therefore. the data is aggregated by the database along the hierarchy and is sent to the start level of the hierarchy (highest node) in the OLAP processor. In general.BUSINESS INFORMATION WAREHOUSE . as the aggregates can only be optimally used when reading the data on demand. you should add a level that can be used as a navigation attribute or separate characteristic in the dimension. is read in the main memory area of the OLAP processor. already aggregated in the database. • Reading the data on demand: The OLAP processor only requests the corresponding fact table data that is needed for each navigational state of the query in the Business Explorer.
How can you set a focus on a partial hierarchy? If you restrict a characteristic to one hierarchy node in the rows (you can also use a variable to do this). all the nodes have to be resolved down to leaf level and selected individually from the database. 6. Objvers <-> HIESID. key date <-> HIEID (Char25) /BIC/Imerkmal: inclusion table Child . see chapter 3. administration information is contained in table RSRHIEDIR_OLAP: HIEID. row. and then break down the rows by the same characteristic. 8. In this case. During the actual reading. If a hierarchy with a time-specific structure is involved. 7 FAQ .2).. In this case. .1 Loading Hierarchies from a File The loading of hierarchies from files is defined in the Accelerator “Loading InfoSource Data via Flat Files”. the hierarchy definition is saved in the tables listed below: • • • /BIC/Hmerkmal: hierarchy table. the inclusion table is used to resolve the nodes to the extent necessary. If you use a characteristic to restrict a structure element in a hierarchy.3 Performance Involving Multiple Use of a Hierarchy within a Query Hierarchy nodes can be used to select any kind of object (restricted key figure. . the hierarchy structure is translated to the inclusion table. you can use variables to restrict the large hierarchy user-specifically. key date. the inclusion table is generated at the query runtime (this information is contained in table RSRHIEDIR_OLAP). SVER /BIC/Smerkmal: SID table for leaves (SID >=0) /BIC/Kmerkmal: SID table for nodes (SID < 0) 16 . only the sub-tree below the selected node is displayed in the Excel list.HIERARCHIES Still. Technically. we recommend creating one large hierarchy in the system instead of several small hierarchies. and the hierarchy is also selected as the presentation hierarchy.3 Saving Hierarchy Information in the BW When you activate a hierarchy..Parent (Succ Pred) in SID .2 Hierarchies and Authorizations Authorizations involved with hierarchies are described in the Accelerator “Authorizations and Roles”. and the results are buffered in a temporary table. this will result in poor performance. this table is joined with the corresponding dimension (or SIDTab).BUSINESS INFORMATION WAREHOUSE . and the hierarchy is not available for the requested key date.!. 8. version. ?. When you run a query with a hierarchy. in the first step. 8 Technical Details 8. administration information is contained in table RSHIEDIR: hierarchy name.
BUSINESS INFORMATION WAREHOUSE .HIERARCHIES 17 .
This action might not be possible to undo. Are you sure you want to continue?
We've moved you to where you read on your other device.
Get the full title to continue listening from where you left off, or restart the preview.