!--a11y-->
Part 4: Implementing the Data
Transport 
To make the value of the CARRID attribute visible in the context of the SEARCH view for the context of the DISPLAY view, first you need to create a cross-view context.
1. In the object list, double-click on the ComponentController object. The Editor displays the context of the component controller.
2. Select the context root node that is still empty and open its context menu.
3. Use the Create using a Wizard entry to copy the data node from the SEARCH view (or from DISPLAY) to the root node of the context of the component controller.
4. Save your changes and switch to the object list by double-clicking on the display of the SEARCH view, located on the Context tab page.
The Editor, which is divided into two, displays the context of the component controller on the right-hand side.
Define a
mapping for
the DATA node of the view context to the node with the same name of the
component controller context:
5. To do this, select the DATA node of the component controller and hold down the mouse button to drag it to the DATA node of the view context. When you let go of the mouse button, the mapping that was defined by this operation is displayed by a small black arrow in the icon for the view context node. The mapping path to the node of the component controller is also specified in the properties table for this node.
The value that the CARRID attribute obtains at runtime can be passed forwards to the component controller using the mapping. Save the view.
6. Open the DISPLAY view by double-clicking on it in the object list and switch to the Context tab page.
7. Define mapping for the DATA node of the view context to the node of the component controller context with the same name.
The value for the CARRID attribute, which the component controller receives from the SEARCH view, can be passed to the context of the DISPLAY view in this way. Next, its FLIGHTS context node must be equipped with a supply function.
8. Select the FLIGHTS node and enter “getflights” in the Supply Function line in the properties table.
9. The required method is automatically created when you save, and you return to the ABAP Editor by double-clicking on the name of the function to add code to the GETFLIGHTS method (see below for the source code).
You have now designed the layout of the two views and implemented the data transport.
To complete the application, continue with Part 5: Setting Up Navigation
method GETFLIGHTS.
data: datanode type ref to if_wd_context_node,
value type string,
flighttab type standard table of sflight.
* Import the reference to the node of the local context:
datanode = wd_context->get_child_node( name = 'DATA' ).
* Because of the mapping to the 'DATA' node of the component controller,
* this node contains the value that was entered by the user for the
* 'CARRID' attribute.
* This value will then export the following step:
datanode->get_attribute( exporting name = 'CARRID' importing value = value ).
* The internal 'flighttab' table can now be filled:
select * from sflight into table flighttab
where CARRID = value.
* The internal table still needs to be bound to the current context
* node:
node->bind_elements( flighttab ).
endmethod.
In this example, the programming of the data
retrieval has been shortened considerably so that Web Dynpro is easier to
understand. In a real application, a select call to a database table should never be
implemented within a method of the Web Dynpro framework, for example. A
separate class has to be created to retrieve the data, for example.