Exploring Hierarchy Processing

Objective

After completing this lesson, you will be able to explore hierarchy processing.

Hierarchy Management

Hierarchies are enabled for an entity type by changing the Hierarchies attribute to a value other than No hierarchy. The result is a hierarchy table that allows storing parent-child relations between entities of this entity type (and also between additional entity types if specified). A hierarchy can be defined as version, name, or edition dependent.

The screenshot shows the hierarchy settings in MDGIMG customizing with the values that you can assign as hierarchy type.

Additional Entity Types

A hierarchy may contain entities of additional entity types as nodes. These entity types are specified under Entity Types for Hierarchies (in addition to the hierarchy name). By default, Use has the value No Special Use. You can also choose the value, Hierarchy Name.

The screenshot shows the customizing settings for the Entity Types for Hierarchies.

In the example shown in the preceding figure, the entity type CCTR (Cost Center) has been specified as an allowed entity type within the Cost Center Group Hierarchy.

Another use case is to support text nodes.

Data model settings are:

  • Switch on hierarchies for entity types of usage and storage type 1.
  • Define hierarchies as edition-dependent.
  • Define hierarchies as version-dependent.

    The hierarchy version is a fixed and predefined CHAR field of length 3. The hierarchy version cannot be modeled as an entity type. It is globally defined and valid across data models

  • Hierarchies can be defined as hierarchy-name-dependent:
    • Hierarchies always have a name that is modeled as an additional entity type, regardless of whether the hierarchy is name-dependent or not.
    • The hierarchy name can have leading relations (additional key fields).
  • Additional entity types can be used as nodes within hierarchies. These types can be of usage and storage type 1, 2, or 3.
    • Example: Text nodes can be modeled as an entity type and entered as an additional entity type.
    • Constraint: Exactly one entity type must be of usage Hierarchy Name.

      Entity types used as hierarchy names must have superordinate entity types.

  • A hierarchy can have multiple key fields:

    Constraint: Key fields must also be key fields in the entity type for which the hierarchy is defined.

  • Hierarchy relations can have additional attributes.

Additional Attributes in the Hierarchy Relation

Hierarchy relationships can have additional attributes.

An attribute of the relationship can be specified by a data element or by a reference to an entity type. In this case, the data element is optional and taken from the entity type. You can specify an alternative data element if necessary.

The screenshots show the additional attributes for hierarchy settings. One screenshot shows the hierarchy attributes for data model 0G, Entity Type FRSI, Entity Type of Node Account. The other screenshot shows the Hierarchy Attribute for the Data Model YP, Entity Type ACCOUNT, Entity Type of Node ACCOUNT.

The second example in the preceding figure shows that if you want to add attributes to the relationship of the entity type for which the hierarchy has been defined, you must specify it again under Entity types for Hierarchies.

Attributes of the hierarchy relationship can be initially maintained during the insertion of an entity into the hierarchy. Later, the attributes can be changed by calling Change Hierarchy Attributes or Change Range from the context menu depending on whether a discrete entity value is specified or a range.

On the left side, the screenshot shows how to change the hierarchy attributes, whereas on the right side, the screenshot shows how to change the range.

Collective Processing: Capabilities

In general, hierarchies are maintained in the hierarchy view of the Collective Processing generic application. The main features are the following:

  • You can insert new or existing nodes. You can insert several nodes in one step.
  • You can move nodes (including subnodes) with arrow buttons. Drag-and-drop functionality is also supported.
  • You can find nodes in the hierarchy.
  • You can expand ranges to see which entities are currently assigned.

At runtime:

  • Like other master data hierarchies, they are maintained under the governance of change requests.
  • The hierarchy can form nets (a node can have multiple higher-level nodes).
  • Validations can be added in the rule service BAdI, for example, to enforce specific cardinalities like single higher-level nodes.
  • A search for nodes in the hierarchy can be performed.
  • Authorization can be granted on the level of arbitrary nodes of the hierarchy.
  • Version-dependent hierarchies can be copied to new versions.
  • Ranges can be expanded to see which entities are currently assigned.
The screenshot shows the Hierarchy Processing for Business Partner. In this case it's a supplier hierarchy for ASIA, with Japan as node and one supplier underneath. For Europe, there are two countries maintained :Germany and GB. For Germany, there is one supplier maintained. For GB, there's a further node available, which is EN with one supplier.

Collective Processing: Layout

The layout of the hierarchy view is derived automatically:

  • Columns for descriptions are included according to the text settings of all entity types specified for the hierarchy.
  • Columns for attributes of the leading entity type are included (unless disabled in the field property view by checking No Result List).

Maintenance UI:

  • Hierarchies are maintained in the hierarchy view of the collective processing application, which is generic and works for all data models. The UI supports drag-and-drop functionality.
  • Additional UI elements are available that can be added to the single item maintenance UI to maintain information on higher-level nodes and predecessors.

    Constraint: Currently these elements only support the entity type for which the hierarchy is defined.

The screenshot shows the Financial Reporting Structure Item. There's one FRS0 baseline structure, which consists of one node FRSI0 with different accounts and account ranges underneath.

Pre-Delivered Models

The table shows the pre-delivered models.

Pre-Delivered Models

Data ModelEntity TypeVersion/Name DependentEdition Dep.
0GCCTRGNot Version-dependent / Cross-nameYes
0GCELEMGNot Version-dependent / Cross-nameYes
0GCONSGRPVersion-dependent / Not Cross-name (name dependent)Yes
0GFRSINot Version-dependent / Cross-nameYes
0GFSIVersion-dependent / Not Cross-name (name dependent)Yes
0GPCTRGNot Version-dependent / Cross-nameYes
BPBP_HEADERNot Version-dependent / Not Cross-name (name dependentNo

Extensibility - Adding a Hierarchy to Model MM

It is possible to extend the SAP hierarchy models or to create new hierarchy models within an SAP data model.

The following model extension use cases explain this in more detail:

  • Setting up a hierarchy in model MM (Material Domain) where no hierarchy is delivered by SAP.
  • Setting up an alternative hierarchy in model BP (Business Partner Domain).
  • Adding entity types as additional nodes in an SAP hierarchy.

A hierarchy can be added to model MM (Material Domain) by creating additional entity types (with the reuse area master data governance), one for the hierarchy and one for the name.

The figure shows the screenshots to create a hierarchy for data model MM.

In the following example, a work package hierarchy is set up where materials can be assigned. These work packages belong to design studies and depend on the year of the development. Therefore, another entity type for the year is created and maintained as a key field.

Three entity types are created:

  • One for the design study name (ZHRCHNAME)

  • One for the work packages (ZWPHIER)

  • One for the year (ZYEAR)

The hierarchy name ZHRCHNAME (which identifies the design study) and the entity type MATERIAL are then specified under Entity Types for Hierarchies.

Two relationships must be created to make the year a key field for the hierarchy.

Three entity types are created: one for the design study name (ZHRCHNAME), one for the work packages (ZWPHIER), and one for the year (ZYEAR).

In the screenshot, two entity types are created for data model MM. The first entity type is ZWPHIER, the second ZYEAR.

The hierarchy name ZHRCHNAME (which identifies the design study) and the entity type MATERIAL are then specified under Entity Types for Hierarchies.

For the data model MM, entity type ZWPHIER, two entity types of node are created. The first one is MATERIAL with the value, No special use, in the Use field; the second one is ZHRCHNAME with the value, Hierarchy Name, in the Use field.

Two relationships have to be created to make the year a key field for the hierarchy.

The screenshot shows the maintenance of the relationship between two entity types. From-Entity-Type is ZYEAR. Relationship is ZYEAR2STH and the To-Entity Type is ZHRCHNAME; Relationship Type is Leading and Cardinality is 1:N.

Extensibility - Adding a Hierarchy to Model MM

In the hierarchy view of collective processing, you can maintain names for the design studies, create work package hierarchies below them, and assign materials to the work packages.

Two design studies have been defined (CAR WING and REAR VIEW MIRROR).

The first one contains three work packages and two materials at the leaf level.

The second one contains two work packages. No materials are assigned so far.

The screenshot shows the definition of work packages as hierarchy for data model MM.

Using an Alternative Hierarchy in Model BP

In the collective processing UI, you can maintain hierarchies in different versions and for different purchasing organizations.

In this example, hierarchy version001 has been created for purchasing organization0001.

The screenshot shows a version 1 for the supplier hierarchy.

Adding an Entity Type to Hierarchy in Model BP

In the figure, in the screenshot labeled as 1, the new entity type ZTEXT serves as text node in the upper example. In the screenshot labeled as 2, the collective processing UI, you can then insert text nodes.

An additional customer-specific entity type can be added to the list of entity types for the hierarchy that is delivered for the entity type BP_HEADER.

The screenshot shows that it is possible to create an entity type of node ZTEXT for entity type BP_HEADER.

Function in Detail: Hierarchies

You can now assign Business Partners to hierarchies during Single-Object Processing (the Creation or Change processes).

The UI also offers a value help for the easy identification of the relevant parent node.

The screenshot shows that you can assign Business Partners to hierarchies during single-object processing.

New Upload Modes for Hierarchy Maintenance

Previously, there were only the upload modes Delete All and Overwrite or Add. The latter can only add new edges but not manipulate edges (delete edges and create new ones).

Additional upload modes for hierarchy maintenance are available: Move Children, Replace Nodes, Remove Edges.

The figure shows the new upload modes for hierarchy maintenance in the Upload Mode dropdown, as explained in the text.

Perform Supplier Governance - Hierarchy Maintenance

Business Example

You are acting as a strategic buyer in the procurement department. You are supposed to create a new supplier hierarchy for reporting or other purposes.