Start of Content Area

Background documentation Declaration of the Context  Locate the document in its SAP Library structure

Declaration of the Context at Design Time and Runtime

When working with the context, it is important to distinguish between the meaning of the word 'context' at design time and at runtime.

At design time, the context represents a description of the structure of the required value sets. Each attribute is typed and is only available once. At runtime, these structured shells are filled vith values. A multitude of values can be contained in the context for a single attribute when, for example, depicting tables. You can use the cardinality of a context node to determine at design time whether or not you want to permit a multiple value set for a context attribute at runtime.

Note In ABAP programming, the cardinalities 0..n and 1..n correspond to the declaration of an internal table. The cardinality 1..1 corresponds to the declaration of a structure. 

 

Context nodes with a cardinality of 0..n or 1..n are designated as multiple nodes. This means that a single context attribute of a multiple node can adopt a multitude of values at runtime. To enable you to work sensibly in this kind of multidimensional context, the Web Dynpro ABAP Framework provides the singleton and leadselection properties. These two concepts are described in Context Node: Properties in the architecture manual for Web Dynpro in the NetWeaver Developer's Guide using an example.

 

Filling the Context with Values at Runtime

There are several possibilities for filling a context with values at runtime.  However, a method is called in each case. One of these options is the supply function.

 

Common Usage of Context Elements by Several Contexts

To enable the parallel use of context elements in different views and the transportation of values from one context to another, Web Dynpro provides the context mapping function. The architecture handbook for Web Dynpro contains a section called Data Binding and Mapping. It schematically depicts the principles of data transport from a UI element such as an input field to the context of the component controller (or vice versa).

 

Creating Contexts

The tools manual for Web Dynpro for ABAP contains a description of the tools that you use to declare a context and define a mapping. When you create a context node you can influence the result in many ways, such as by binding the structure of the node to be created to an existing structure in the ABAP dictionary. This can be beneficial in many ways, since it means that not only the structure of the context is generated automatically. In addition, all existing texts for, for example, column headers or labels, help texts, and value helps are proposed for use. 

 

Note For practical information on declaring and programming contexts, see Programming Notes for Web Dynpro ABAP Applications in Context.

 

End of Content Area