Creating a UI for Hierarchies
This document describes how to extend a UI for single-object processing using the MDG Web Dynpro application USMD_OVP_GEN
with UI components to display and process hierarchy assignments.
Hierarchy assignments are included in the example configuration USMD_SF_OVP_CARR_02
of the generic MDG Web Dynpro application USMD_OVP_GEN
in package MDG_FND_SAMPLE_IMPLEMENTATIONS
.
You have completed the following:
You can use an active MDG data model with at least one entity type with storage and use type 1. You have assigned a business object type code (OTC) to this entity type.
This MDG data model contains a hierarchy type that defines entities of this type as possible nodes.
For more information, see the Data Modeling section in Configuring Hierarchy Types
The data model is in the customer namespace. If the data model is not in the customer namespace follow the description in Creating genIL Components and Transaction Handler Manually.
You can use a configuration of the generic MDG Web Dynpro application USMD_OVP_GEN
that includes an FPM overview page (OVP) FPM_OVP_COMPONENT
to which you can add the UIBB. You can open and edit the configuration of this page in the FPM editor. Alternatively, you can create Customizing for this configuration.
For more information, see Creating User Interfaces for Single Object Processing.
Hierarchy Assignment List
The following describes how to add the hierarchy assignment list to the UI.
Create a new configuration for the list component FPM_LIST_UIBB_ATS
using the feeder class CL_USMD_HRY_ASSIGNMENTS
.
In the configuration of the list component, enter the following values for the parameters of the feeder class:
Component
Enter ZHP<data_model>
. This is the genIL component for hierarchy processing that was created for your MDG data model, with <data_model>
being the ID of your MDG data model.
Object Name
Enter Hras<Hierarchy Type>_<Entity Type>
in this field. Replace <Hierarchy Type>
with the hierarchy type for which you want the assignments of the entities specified with <Entity Type>
to be processed. Hras
stands for hierarchy assignments.
Editable
Select the Edit
checkbox.
Columns
For a default configuration, add the following fields as columns:
Field Name | Header | Display Type | Comment |
| Changes | Image | Change assignment indicator |
| Hierarchy | Input Field | Name of hierarchy |
| Description | Input Field | Description of hierarchy |
| Parent Type | Dropdown List | Entity type of the parent node |
| Parent Node | Input Field | Parent node |
| Description | Input Field | Description of parent node |
| Previous Type | Dropdown List | Entity type of predecessor node |
| Previous Node | Input Field | Predecessor node |
| Description | Input Field | Description of predecessor node |
Additionally, you can use the following fields:
Field Name | Header | Display Type | Comment |
| Hierarchy Version | Dropdown List | Include this field for hierarchy types that are version-dependent. |
| In Range | Checkbox | Include this field for hierarchy types that allow ranges. The field indicates whether the node is assigned due to the definition of a range. |
| Is Fragment | Checkbox | Indicates that the node belongs to a fragment of a hierarchy type. In this case, the field HRYNAME is empty and no action on the assignment is possible, with the exception of deleting the assignment. |
Furthermore, you can configure all hierarchy attributes, defined in the hierarchy type for this node type, as columns. Alternatively to adding the hierarchy attributes as columns, you can also create an edit page for the hierarchy attributes. For more information, see the Using an Edit Page for the Hierarchy Attributes section in this document
Caution
The highlight changes function uses the tooltip to inform the user about the previous value. This is not possible if a fixed value for the tooltip is either entered in the UI configuration or in the UI Customizing. In this case, the fixed value is displayed.
Row Actions
Add the following row actions to the list:
Action | Image | Label | Comment |
| ~Icon/MultipleNode | not available | Opens a dialog box to display or change the assignment in the hierarchy. |
If you want to use an edit page for the hierarchy attributes, add row actions to display the edit page.
Action | Image | Label | Comment |
| ~Icon/Edit | not available | Opens the edit page in edit mode. |
| not available | Details | Opens the edit page in display mode. |
Toolbar
Add the following buttons to the toolbar:
Text | Image Source | Tooltip | FPM Event ID | Comment |
New | ~Icon/NewItem | New |
| Creates a row for a new hierarchy assignment. |
Delete | ~Icon/Delete | Delete |
| Deletes the selected hierarchy assignments. Select |
Next Hierarchy Changes | not available | Next Hierarchy Changes |
| Only for edition-dependent hierarchies: Opens a dialog box displaying a list of editions with hierarchy changes later in the validity period of the object. |
Add the list component to the FPM OVP on which you want the hierarchy assignments to be displayed.
In the wiring of the page, create a wire for the hierarchy assignment list using the connector class CL_MDG_BS_CONNECTOR_BOL_REL
and the following parameters:
Source Component
: FPM_FORM_UIBB_GL2 (example) and Source Config Name
: USMD_SF_CARR_FORM (example)
Enter the component that displays the entity for which you want the assignments to be shown. This could be a form component on the page, for example.
Port Type
: Lead Selection
and Port Identifier: Standard
Relation Name:
Hras<Entity Type>2<Hierarchy Type>Rel
. Replace <Hierarchy Type>
with the hierarchy type for which you want the assignments of the entities specified with <Entity Type>
to be processed. Hras
stands for hierarchy assignments. For example, HrasCARR2CARRRel: Here, the entity type has the same ID as the hierarchy type.
In the toolbar schema of the FPM OVP, add the following button for the hierarchy assignment list UIBB:
Text | Image Source | Tooltip | FPM Event ID | Comment |
Edit | ~Icon/Edit | Edit |
| Switches the UIBB into edit mode. |
Now, you have configured a user interface that can be used to process hierarchy assignments.
In the following you find information on advanced configuration topics.
Using an Edit Page for the Hierarchy Attributes
If you want to use an edit page to process the hierarchy attributes of the assignment, proceed as follows:
Create a new configuration for the form component FPM_FORM_UIBB_GL2
using the feeder class CL_MDG_BS_GUIBB_FORM
.
In the configuration of the form component, enter the following values for the parameters of the feeder class:
Component
Enter ZHP_<data_model>
. This is the genIL component for hierarchy processing that was created for your MDG data model, with <data_model>
being the ID of your MDG data model.
Object Name
Enter Hrat<Hierarchy Type>_<Entity Type>
in this field. Replace <Hierarchy Type>
with the hierarchy type for which you want the hierarchy attributes of the assigned entities specified with <Entity Type>
to be processed. Hrat
stands for hierarchy attributes.
Editable
Select the Edit
checkbox.
Fields
Add the required hierarchy attributes to the layout of the form.
Add an edit page to the FPM OVP with which you want the hierarchy assignment to be processed.
Add the form component that you have created in step 1 to the edit page.
In the wiring of the page, create a wire for the form in the edit page using the connector class CL_MDG_BS_CONNECTOR_BOL_REL
and the following parameters:
Source Component
: FPM_LIST_UIBB_ATS
and Source Config Name
: enter the configuration ID of the hierarchy assignment list.
Port Type
: Lead Selection
and Port Identifier: Standard
Relation Name:
Hras<Hierarchy Type>_<Entity Type>2HratRel.Replace<Hierarchy Type>
with the hierarchy type and <Entity Type>
with the entity type for which you want to process hierarchy attributes. For example: HrasFSCHEDGRP_PFLIX2HratRel for hierarchy type FSCHEDGRP and entity type PFLIX.
Restricting Entity Types for Usage as Parent Node or Previous Node
If you want to ensure that specific entity types cannot be used for the parent node or the previous node of a hierarchy assignment, proceed as follows:
Create a custom feeder class for the hierarchy assignment list by inheriting from the SAP defined class.
Redefine method DEFINE_INVALID_NODE_TYPES
.
The method shall be used to fill class attributes MT_INVALID_PARENT_TYPES and/or MT_INVALID_PREVIOUS_TYPES with entity types that must not be used as parent respectively previous nodes.
The generic SAP feeder class does not add any entries to the tables. This is a task for an application specific feeder class.
For example, the MDG-F hierarchy assignment list for cost centers in a cost center group hierarchy might add the cost center as invalid parent type, since cost centers must always be hierarchy leaves.
Check sub-classes of the SAP class for sample implementations.
The method is called once during the INITIALIZE phase. The information is used in two points in time:
It restricts the values in the dropdown list box for the parent type or the previous type.
It is handed over as event parameter to the hierarchy assignment search pop-up. The pop-up uses the information for the Assign as …
buttons.
Define the custom feeder class in your hierarchy assignments list UIBB.
Restricting the Number of Nodes Displayed in the Dialog Box
You can set the default value for the Maximum Number of Search Results
parameter that is used by the search pop-up.
The hierarchy search pop-up works with two different modes. Users can either display a full hierarchy by defining only the hierarchy name as search criterion, or a partial hierarchy by defining search attributes of objects that might be part of the hierarchy.
If the user defines any object specific attributes, the search is executed in a two-step approach. First, a common search for objects is executed. In that case, the Maximum Number of Search Results
parameter is required to limit the amount of objects. Second, it is checked if the returned objects are part of the desired hierarchy.
The parameter is not displayed on the search UIBB. In case of displaying the complete hierarchy, the parameter is not taken into account. In case of searching for objects in a hierarchy, a visible parameter might confuse the user. The expectation can be that the parameter controls the value of matches being displayed in the hierarchy tree. This is not the case, because of the two-step search approach described above.
You can redefine the current method in a specific feeder class to change the value of the parameter. Note, that a higher value might have a negative impact on the search performance.
Create a custom feeder class for the hierarchy assignment list by inheriting from the SAP defined class.
Redefine method ADD_SEARCH_CRITERIA_MAX_HITS
and return the value that should be used as maximum number of search results.
Define the custom feeder class in your hierarchy assignment list UIBB.
Sequence of Attributes in Search Criteria
The search criteria in the hierarchy assignment pop-up are sorted in the following sequence:
Attributes with fixed values that cannot be changed by the user
Mandatory attributes: For example, the hierarchy name
Key attributes
Attributes that occur in all entity types of the hierarchy type
Attributes of the main entity as defined with parameter USM_OTC
of the Web Dynpro application
Attributes of other entities in the hierarchy type
With method DEFINE_SEARCH_CRITERIA_MODE
of class CL_USMD_HRY_ASSIGNMENTS
, you can change the standard order of displayed search criteria using object-specific feeder classes.