Professional Documents
Culture Documents
Contents:
The structure of the context Context mapping Internal mapping
After completing this topic, you will be able to: Understand the structure of the context Use the context editor Use internal context mapping
Other WD Controllers
Custom Controller
Component Usage
Other WD Components
Node
Attribute
Context Root Node Context menu on the Context Root Node
Context Node:
Are arranged hierarchically and are permitted to have children Children of a node may be entities known as other nodes or attributes Metadata description declared manually or derived from a Dictionary Structure
Context Attribute:
Stores runtime data or references to runtime data Based on DDIC Types
Context Metadata
Context Root (c=1..1, s=true)
FLIGHTS (c=0..n, s=true) BOOKINGS (c=0..n, s=false) BOOKID CUSTOMID CLASS
Node Metadata (c=cardinality, s=singleton) IF_WD_CONTEXT_NODE_INFO (interface) Attribute Metadata (data type) WDR_CONTEXT_ATTRIBUTE_INFO (structure) A node collection
PASSNAME
CARRID CONNID FLDATE
PRICE
All context nodes are collections. A node collection is composed of elements, where an element is an aggregation of the nodes immediate children (attributes and/or other nodes). The cardinality property controls the number of elements a node collection may hold at runtime.
Design time
SAP AG 2005, Title of Presentation / Speaker Name / #
Context Root Node c=1..1, s=true Default Element 1 = Element created by an application at runtime = Element created by the WDF at context initialisation time
Independent Node
Context Root Node c=1..1, s=true Default Element 1 = Element created by an application at runtime = Element created by the WDF at context initialisation time = Element at the lead selection
c=1..n, s=true ..n 2 c=0..n, s=true ..n 2 1 Independent Node Default 1 Element
Node collection contains a default element. Can contain as many elements as required.
Independent Node
SAP AG 2005, Title of Presentation / Speaker Name / #
Context Metadata
Context Root (c=1..1, s=true) FLIGHTS (c=0..n, s=true) BOOKINGS (c=0..n, s=false)
Default Element
FLIGHTS
CARRID CARRID 2 CONNID CARRID CONNID 1 CONNID FLDATE
..n
BOOKID
CUSTOMID CLASS PASSNAME CARRID CONNID FLDATE PRICE
BOOKINGS
BOOKID ..n BOOKID 2 CUSTOMID BOOKINGS BOOKID ..n BOOKID 1 CUSTOMID BOOKID 2 CUSTOMID BOOKID ..n CUSTOMID BOOKID 1 BOOKID 2 CUSTOMID CUSTOMID BOOKID 1 CUSTOMID CUSTOMID CUSTOMID
BOOKINGS
Design Time
SAP AG 2005, Title of Presentation / Speaker Name / #
Runtime
Context Metadata
Context Root (c=1..1, s=true) FLIGHTS (c=0..n, s=true) BOOKINGS (c=0..n, s=true)
Default Element
FLIGHTS
CARRID CARRID 2 CONNID CARRID CONNID 1 CONNID FLDATE
..n
BOOKID
CUSTOMID CLASS PASSNAME CARRID CONNID FLDATE PRICE
BOOKINGS
BOOKID ..n BOOKID 2 CUSTOMID BOOKID 1 CUSTOMID CUSTOMID
Design Time
SAP AG 2005, Title of Presentation / Speaker Name / #
Runtime
FLIGHTS
CARRID CARRID 2 CONNID CARRID CONNID 1 CONNID FLDATE
..n
This design of context structure both copies the way users handle business data, and causes the Web Dynpro application to consume significantly less memory.
BOOKINGS
BOOKID ..n BOOKID 2 CUSTOMID BOOKID 1 CUSTOMID CUSTOMID
Supply Function
Context Root
This supply function is called by the runtime when the data of the context node is required
Especially useful in combination with singleton nodes
FLDATE
BOOKINGS
BOOKID ..n BOOKID 2 CUSTOMID BOOKI 1 CUSTOMID D CUSTOMID
Context Mapping
Context mapping is the primary mechanism for sharing data between different controllers. Advantages: Data is automatically available to all controllers using the mapping relationship Only one copy of the data is ever maintained
Data can be mapped selectively, thus reducing the amount of data in a controllers context to the minimal set required to fulfil a task
Context Mapping
After the mapping the mapped structure appears in the target context
Drag and drop structure or create a node and define the mapping
Context Root
FLIGHTS BOOKINGS
Context Root
FLIGHTS
BOOKINGS
Controller Usage Declaration BOOKID CUSTID CLASS PASSN CARRID CONNID FLDATE PRICE
BOOKID
CUSTID CLASS PASSN CARRID CONNID FLDATE PRICE
You should now be able to understand: The Structure of the Context Internal Context Mapping