Show TOC

Creating and Maintaining Context NodesLocate this document in the navigation structure

Prerequisites

The Workbench must be in change mode if you want to create and maintain context nodes.

Create

To create a context node, choose Start of the navigation path Create Next navigation step Node End of the navigation path in the context menu of the CONTEXT root node.

The following options are available when you create a context node :

Node Name

Name of the node to be created (unique within the context, all uppercase letters).

Mandatory

Interface node

In the context of the component controller, for each node which should be created directly below the root node, you can choose whether it should be placed within the component only (default) or whether the node should also be included at the same time in the component interface, that is, the interface controller.

For notes further down in the hierarchy, this option is no longer available as all subnodes automatically assume the value of the parent node.

Optional

Input element (ext.)

At this point you can decide whether the new node should be available for an external mapping .

Optional

Dictionary structure

If your node should contain attributes from an existing Dictionary structure (such as a table), you can specify this structure here. You can also use F4 help.

Caution

If you link a node in this way to a structure from the Dictionary, you cannot add attributes from outside the structure to these nodes. You can however create further attributes at runtime.

Optional

Cardinality

Required node cardinality , which may differ from the default.

Optional

Selection

If you specify the selection cardinality, this determines how many instances of the node may be selected on the screen later for further processing.

The selection cardinality 0..1 means that a maximum of one table row can be selected if the node elements are displayed as a table. Its content can be processed in the next step. A selection cardinality 0..n means that any number of table rows can be selected.

Caution

You must not specify the selection cardinality so that it is inconsistent with the node cardinality.

For example, if a node has the cardinality 0..n, it is possible that it does not contain any instances at all. This means that the selection cardinality must not start with 1.

Optional

Init. lead selection

At runtime, exactly one of the element instances of a node has a special position. This is known as the lead selection .

The element that bears the lead selection can be addressed especially easily from the coding.

Many user interface elements are bound to attributes of the lead selection.

The content of a child node depends on the lead selection element of its parent node, provided that it has the property singleton .

The lead selection initialization property determines whether the lead selection should be set automatically as soon as it is required, but is not yet set. The first element of a node is always selected for the lead selection for this automatic initialization.

Caution

If this flag is not set, the lead selection has to be programmed manually. This is done either in the supply function of the relevant node or in its WDDOINIT method. The following two methods are available for this in the IF_WD_CONTEXT_NODE interface:

SET_LEAD_SELECTION and SET_LEAD_SELECTION_INDEX.

You can use their ELEMENT or INDEX parameters to select a node other than the first element of a node for the lead selection.

Default: Yes (lead selection automatic, and set to the first element of a node)

Optional

Singleton

The singleton property describes the relationship between a subnode and its parent node. The default ( Yes ) means that there is only one single instance of the node at runtime that is, the instance that belongs to the lead selection element of the parent node. However, it is also possible to allow several instances at the same time. In this case, choose No .

Optional

Note

Information about cardinality, singletons, and lead selection as well as a good example can be found in Context Nodes: Properties .

Supply function

You can specify the name of a supply function for this node. The corresponding method is created automatically and you can program it appropriately at a later point. You also have the option of creating the supply function beforehand ( Methods tab page ) and adding this using the F4 help when you create the node.

Optional

If you selected a Dictionary structure for your node, you can end the creation process by selecting the required attributes from this structure.

  1. Select Add Attributes from Structure .

    The structure you selected is shown in a table.

  2. Select the required attributes of the structure.

  3. Confirm your entries.

    The node is created and given the selected attributes. In this case, the creation processes for nodes and attributes are summarized in one step.

If you did not select a Dictionary structure for your node, end the creation process by selecting Continue (Enter). The node is created below the root node and you can now add an attribute in a separate step.

Creation Using a Wizard

Proceed as follows to create a context nodue using the wizard:

  1. Select the root node CONTEXT and in the context menu select Start of the navigation path Creat Using Wizard Next navigation step Copy Node from Other Context End of the navigation path.

  2. To copy a context node using the wizard, using F4 select the name of the Web Dynpro component from whose context you want to copy the node in the following dialog window.

  3. From the component you just specified, select the controller whose context node you want to copy. This node can originate from a controller context or from the context of a view. Root nodes cannot be copied, however.

  4. You can affect the structure of the object you want to copy. For example, you can decide whether or not you want to copy all attributes in addition to all child nodes of the node to be copied.

  5. Confirm your entries.

    You will see a new window that displays the selected node hierarchies, where you can select the node to be copied.

  6. Double-click on the selected node to display a copy of the context that you are currently processing.

Creating a Recursion Node

You can create what is called a Recursion Node in each node below the root node.

Recursion nodes enable nodes to be nested iteratively. The node that is used for recursion is always a predecessor of the new node. This does not have to be the direct predecessor node in the hierarchy, however, the node to be repeated can also be located several hierarchy levels higher than the recursion node that will be created.

The newly created recursion node is always a reference to the predecessor node and therefore cannot be processed separately. Instead it takes on the properties and functions of the node to be repeated.

Proceed as follows to create a recursion node:

  1. Select the node to be repeated.

  2. From the context menu for the node, choose Start of the navigation path Create Next navigation step Recursion Node End of the navigation path.

  3. Enter a name for the recursion node and select the node to be repeated from the selection list.

  4. Confirm your entries.

The recursion node you have just created is displayed using a special icon and is added to the node hierarchy.

Defining a Mapping

The context menu of a context node contains the Define Mapping entry.

The definition of a mapping between two context nodes is described under: Defining Mapping .

Properties Table of the Context Node

Once you have created a node for a context, its properties are listed in a table at the bottom of the Editor.

You have the option of changing these node properties, as long as the Workbench is in change mode.

Note

If you specified a Dictionary structure during the creation process of a context node, you can include additional components of this structure in your context node from the properties table. To do this, in the Dictionary Structure row, click on the pushbutton on the right hand side. This displays the table of the structure components. As mentioned previously, it is not possible to include in a node any attributes whose type does not correspond to a component of the selected structure.