Show TOC

Loading Data as SubtreesLocate this document in the navigation structure

Use

After loading a hierarchy, you are able to store it as a subtree, provided that a hierarchy already exists under the specified technical name in the BW system and this target hierarchy contains the root nodes of the subtree hierarchy that you want to load.

You use subtree hierarchies, for example, to combine hierarchies from various source systems in a single BW system.

Prerequisites
  1. Every subtree hierarchy must have the same technical name as the target hierarchy. Where necessary, you have renamed the subtree hierarchy in accordance with the load process (seeTab Page Select Hierarchy). The loaded hierarchy is only saved as a subtree if a hierarchy for the hierarchy basic characteristic already exists in BW under the specified key (the key consists of the technical name of the hierarchy, a to-date, and a hierarchy version). By flagging the Subtree Insert or the Subtree Update option, you tell the BW system to include the loaded hierarchy in a target hierarchy with the same technical name.
  2. If you want to include a hierarchy as a subtree in a target hierarchy, the root node of the subtree hierarchy must be included as a node in the target hierarchy. It must also have the same technical properties as this target hierarchy node. In both the target hierarchy and subtree hierarchy this interface node relates to the same InfoObject. It has the same technical name in the target hierarchy as it has in the subtree hierarchy and has the same to-date when the variables are time dependent.
  3. The target hierarchy must not contain any additional subtree hierarchy nodes, unless it satisfies the prerequisites of a valid double-node in the new complete hierarchy.
Features

When you load a hierarchy and execute a subtree insert, the hierarchy is included as a subtree in an existing hierarchy, without the system deleting any nodes from the target hierarchy.

Caution

If a subtree is inserted a second time, each subtree hierarchy node under the interface node of the target hierarchy is duplicated, causing the loading process to terminate.

When you load a hierarchy and execute a subtree update, the hierarchy is included as a subtree in an existing hierarchy. The system replaces the old subtree with the new one.

Caution

If a subtree update is executed again, all the nodes under the interface node in the target hierarchy are deleted before the new subtree is inserted.

Activities

In the scheduler, on the Select Hierarchy tab strip, carry out the following steps to store a hierarchy as a subtree in a BW system.

  1. After loading, change the technical name of the subtree hierarchy into the technical name of the target hierarchy. Choose Rename Hierarchy After Loading and enter the technical name.
  2. Choose the Subtree Insert update method if you want to include the hierarchy as a subtree in an existing hierarchy, without the system deleting any nodes from the target hierarchy.

    or

    Choose theSubtree Update update method, if you want to include the hierarchy as a subtree in an existing hierarchy and you want the system to delete the old subtree and replace it with the new one.

Example

Example 1

The scenario, on which this example is based, is that the hierarchies for InfoObject 0CUST_SALES have text nodes as root nodes and these are represented by the InfoObject 0HIER_NODE with the characteristic value ~ROOT. Otherwise, the hierarchies would consist only of nodes that can be posted to from the InfoObject 0CUST_SALES

If the InfoObject 0SOURCESYSTEM is compounded with 0CUST_SALES, you are able to combine hierarchies from various SAP systems into a single hierarchy in a BW system. If a hierarchy is uploaded, the InfoObject 0SOURCESYSTEM is filled automatically with the corresponding source system ID. If identical nodes arrive from different source systems, the compounding with the 0SOURCESYSTEM prevents the nodes being duplicated in the target hierarchy. In this example, the interface node is the root node of the 0CUST_SALES hierarchy.

In the InfoPackage for the corresponding source system, you select the name of the hierarchy that you want to load. In this example, the same technical name is always used in the various source systems and suggested by the system as the default technical name. On theSelect Hierarchy tab strip in the scheduler, you specify that you want the uploaded hierarchies to always be given the same technical name in BW, if this is not already the case. You can also set the update method here.

If, after a full update, the subtree insert option is used to store all additional hierarchies as subtrees of one of these hierarchies, you end up with a hierarchy with a root node, under which hang all the nodes that used to hang under the root nodes of the hierarchies specific to the source system.

If you use the subtree update option, you get a target hierarchy containing only the most recently loaded subtree. This is because all the nodes under the interface node are deleted before the new subtree is added.

Example 2

This example assumes that there are different SET hierarchies for the InfoObject 0COSTCENTER, such as for Europe, Mexico, and USA. It is also assumed that the nodes of one hierarchy do not appear in any other hierarchy.

In BW, in the hierarchy maintenance screen, you create a WORLD hierarchy with three interface nodes belonging to the SET hierarchies mentioned above. On theSelect Hierarchy tab strip in the scheduler, you specify that, after loading, you want the three SET hierarchies to be stored as a subtree under the same technical name as the WORLD hierarchy.

When the SET hierarchies are loaded, you get a hierarchy, under whose root nodes the three hierarchies Europe, Mexico and USA hang.

If you use the subtree insert option in this example, the scenario must be recreated the next time you upload, otherwise, the hierarchies will be duplicated. You recreate the scenario by deleting the nodes and subtrees that hang under the interface nodes, before you reload the data.

If you use the subtree update option, you are able to reload the individual hierarchies as many times as you like, because the old subtree is deleted each time.