Writing Data to Existing Context Elements
Use
The two previous sections described the procedure for reading the current values of context elements in a controller method. These values can now be processed within the method. The following information describes the reverse procedure - passing values from the method to a context element. There are two different situations, as described below.
Passing Values to an Existing Element
In this case, the element whose values are to be set already exists. The individual context attributes are initialized for this element and can contain a value. The SET_ATTRIBUTE and SET_STATIC_ATTRIBUTES methods of IF_WD_CONTEXT_NODE and IF_WD_CONTEXT_ELEMENT interfaces is used to set or overwrite the values of the element. The following applies in this case too: Provided the INDEX parameter is not used, the lead selection element is automatically addressed (more information: Reading the Attribute Value of a Context Element).
In our example, several values of element 1 in the EXAMPLE method are to be set. Element 1 already exists at runtime.


The method call is the same as for the read procedure. Since the direction of the transfer of the local variable value is reversed in this case (from the EXAMPLE method to the context), the formal parameter of the GET_STATIC_ATTRIBUTES method is an importing parameter. The SET_ATTRIBUTE method is used to set a single attribute value.
More Information
For more information about interfaces and methods, see the relevant system documentation.