
The interface IF_WD_CONTEXT_NODE_INFO is the interface of the metadata of a Context node and is used to describe what the data looks like.
Each context node contains a reference to a node info that contains the metadata. Below is the most important metadata that can be accessed using IF_WD_CONTEXT_NODE_INFO:
The GET methods retrieve the attributes of a context node and child nodes. The GETmethods are used to retrieve the single components of a context node.
GET Methods
| Method | Description |
|---|---|
|
GET_ATTRIBUTE GET_ATTRIBUTES |
Gets the information about one or all attributes. With GET_ATTRIBUTE the attribute is returned as WDR_CONTEXT_ATTRIBUTE_INFO. GET_ATTRIBUTES returns an object of type WDR_CONTEXT_ATTR_INFO_MAP, which is a table of type WDR_CONTEXT_ATTR_INFO. |
|
GET_ATTRIBUTE_NAMES |
This method returns the names of all attributes as a STRING_TABLE.
This method takes less time and uses less memory as the GET_ATTRIBUTES method because it does not provide so much information. Use GET_ATTRIBUTE_NAMES if you only need the names of the attributes. |
|
GET_ATTRIBUTE_FORMAT_PROPS |
This method reads special formatting properties for an attribute More information: Data Types in Context Nodes |
|
GET_CHILD_NODE GET_CHILD_NODES |
Retrieves one or all child nodes GET_CHILD_NODE gets the reference for one child node, and GET_CHILD_NODES retrieves a list with pairs of names and references for all child nodes. |
|
GET_ATTRIBUTE_VALUE_HELP |
This method gets the name of the input help for an attribute. |
|
GET_ATTRIBUTE_VALUEHELP_TYPE |
Retrieves the type of Input Help : The type can be, for instance, an ABAP Dictionary search help, an OVS input help, or even a user-defined input help. The input help can also be deactivated. |
|
GET_CONTROLLER |
Retrieves the associated controller to return the method in which the node is declared |
|
GET_NAME |
Retrieves the name of the context node |
|
‑{}‑GET_PARENT |
Retrieves the parent node of the context node. The method returns the reference for the parent node. |
|
GET_PRIMARY_ATTRIBUTE |
Primary attributes are only important for Configuration , since there is no support for primary attributes during runtime, only in the configuration framework. This method returns the name of the primary attribute of a node if one exists. |
|
GET_STATIC_ATTRIBUTES_TYPE |
Retrieves from the RTTI instance the statically declared attributes of the node. The method returns the type of the node as the RTTI_Reference. For more information about RTTI see the documentation for class CL_ABAP_TYPEDESCR in the system. |
|
FOLLOW_PATH |
This method follows the full path expression that you can use for separate calls to the target node. With this method you can get the reference to a node from another node that lies beneath the first node in the hierarchy (child node). |
Single components are retrieved using the respective name. Multiple components are retrieved using a table.
The HAS/IS methods are used to retrieve the different properties and statuses of a context node.
HAS/IS Methods
| Method | Description |
|---|---|
|
HAS_ATTRIBUTE_VALUE_HELP |
Queries whether an input help is available for the context attribute |
|
IS_ALIVE |
Method for checking whether the associated controller is still "alive", which means it can still be accessed, and has not been terminated with WDDOEXIT. |
|
IS_CHILD_NODE_RECURSIVE |
Queries whether the child node is recursive or not. See the relevant section under Context . |
|
IS_FINALIZED |
Establishes whether the node information and possible child nodes cannot be changed. |
|
IS_INITIALIZE_LEAD_SELECTION |
Establishes whether the lead selection is automatically initialized by the runtime, that is, whether it is always set. This corresponds to the Initialization Lead Selection property in the development environment. |
|
IS_MANDATORY IS_MULTIPLE |
Determines the number of node elements. As a result these two methods establish the Cardinality in the development environment (see also the relevant section in Context Node Properties ). IS_MANDATORY queries whether the current context node has at least one node element.This method is true if the node has cardinality 1..1 or 1..n, that is, at least one element must be created. IS_MULTIPLE specifies that the current context node can have multiple node elements, that is, if the cardinality is 0..n or 1..n. |
|
IS_MANDATORY_SELECTION IS_MULTIPLE_SELECTION |
Determines the number of node elements that can be selected in view elements. These two methods determine the selection cardinality in the development environment. IS_MANDATORY_SELECTION specifies that one node element must always be selected, that is, the node has selection cardinality 1..1 or 1..n. IS_MULTIPLE_SELECTION specifies that several node elements can be selected, that is, the selection cardinality is 0..n or 1..n. |
|
IS_MAPPING_COMPLETE |
Determines whether an external mapping is implemented or whether the caller component has executed the mapping. |
|
IS_SINGLETON |
Determines whether the context node is declared as a singleton (see also the relevant section in Context Node Properties ). So this method corresponds to the property Singleton in the development environment. A node with the property singleton exists at runtime only for the lead selection of the parent node. This allows the Web Dynpro runtime a context hierarchy with an optimized memory structure |
The ADD method allows attributes of a context node or child node to be added.
ADD Methods
| Method | Description |
|---|---|
|
ADD_ATTRIBUTE |
Adds a dynamic attribute. This corresponds in the development environment to the context menu Create → Attribute. It is important to create the structure fields NAME and (TYPE_NAME or RTTI). |
|
ADD_CHILD_NODE |
Adds an existing node to the tree. This can only be used for a node that was previously removed from the tree. Otherwise use ADD_NEW_CHILD_NODE. This corresponds in the development environment to the context menu Create → Node. |
|
ADD_NEW_CHILD_NODE |
Creates a node and attaches it to the tree. The name of the node must be unique in the controller. If you specify a DDICstructure for the node, you do not need to add the individual attributes separately afterwards - the framework does this. If you want to delete this node later (node info, and not the nodes that result from it), it is important that you set IS_STATIC to false when you create the node. Nodes declared in the workbench are always static. |
|
ADD_NEW_MAPPED_CHILD_NODE |
A node is created that is mapped to another node. Here only the name and mapping path are relevant. You do not need to create any attributes. The attributes from the original node are automatically copied over If the mapping path is specified, it is a standard Mapping . If the path is set to initial, an externally mappable node needs to be defined.See also External Context Mapping . To complete the mapping, you also need to call the method SET_MAPPING_COMPLETE. |
|
ADD_RECURSIVE_CHILD_NODE |
Adds a recursive child node. This corresponds to the context menu Create → Recursive Node in the development environment. |
The SET method allows attributes of a context node or child node to be set.
SET Methods
| Method | Description |
|---|---|
|
SET_ATTRIBUTE_FORMAT_PROPS |
Sets special formatting properties for an attribute More information: Data Types in Context Nodes |
|
SET_ATTRIBUTE_REFERENCE_FIELD |
For quantities and currencies the field containing the unit of currency or quantity can be entered here. Only a field from the same node is accepted. If the reference is defined in the ABAP Dictionary structure that the node uses, it does not have to be specified separately here. |
|
SET_ATTRIBUTE_REF_CALLBACK |
The application can use this to declare a method with which the element reference and attribute of a reference value for currencies and quantities can be determined. This is important, if, for example, several price entries are possible for one document currency. The callback method must have the following signature: FIELD_ELEMENT Importing type ref to IF_WD_CONTEXT_ELEMENT FIELD_NAME Importing type STRING REFERENCE_ELEMENT Exporting type ref to IF_WD_CONTEXT_ELEMENT REFERENCE_FIELD_NAME Exporting STRING |
|
SET_ATTRIBUTE_VALUE_HELP |
Input help can be set dynamically, that is, the assignment of an Input Help for a context attribute can be changed dynamically. You can change the type of input help (ABAP Dictionary search help, OVS input help, programmable input help component) as well as the name of the assigned input help. |
|
SET_ATTRIBUTE_VALUE_SET |
Sets the list of permitted values |
|
SET_FINALIZED |
Sets a property dynamically that cannot be set in the development environment: the node info can no longer be changed, it is constant. As soon as a node that had been set to the status where it can no longer be changed, but is then changed, an exception is triggered. |
|
SET_MAPPING_COMPLETE |
Completes the definition of an externally mappable node. See also: ADD_NEW_MAPPED_CHILD_NODE. This method was used for the external context mapping. The used component defines that a node is to have external mapping and the calling component must specify which node is used. It does this in the interface controller of the component usage and defines the controller and the path of the original node. |
|
SET_NULLABLE |
An attribute or all attributes can be declared in a way that differentiates between the initial value and the NULL value. |
The REMOVE method allows attributes of a context node or child node to be deleted.
Note that you cannot delete attributes that have been defined as static. You can only delete attributes that were created at runtime.
REMOVE Methods
| Method | Description |
|---|---|
|
REMOVE_ATTRIBUTE |
A dynamic attribute can be deleted again using this method. All nodes (runtime instances are invalidated) that reference to this node info. |
|
REMOVE_CHILD_NODE |
Deletes a child node if it is not declared as non-static (see ADD_NEW_CHILD_NODE). Node info created statically cannot be deleted. Note the following:
|
|
REMOVE_DYNAMIC_ATTRIBUTES |
Deletes all attributes declared dynamically. All nodes based on this node info are invalidated. |