
The application developer can use Web Dynpro APIs as a set of interfaces for efficiently designing controller programming. APIs can be accessed in several ways.
The runtime interfaces offer multiple methods for different programming areas. These include, for example:
Access to the window manager API IF_WD_WINDOW_MANAGER for creating popups from existing Web Dynpro windows
Access to the portal integration API IF_WD_PORTAL_INTEGRATION
Context processing
Creating messages
More areas apply when using dynamic programming . These include:
Dynamic manipulation of the layout
Dynamic navigation control
Example for Accessing a Runtime API
The runtime API of the different controller types is described in Reference Variable WD_THIS . Depending on the type of the controller, the return value of the method WD_GET_API of the local controller interface is a reference variable of the interface:
IF_WD_VIEW_CONTROLLER (for all view controllers)
IF_WD_COMPONENT (for all component controllers) or
IF_WD_CONTROLLER (for all interface controllers or custom controllers)
The following example is the source code of the access to the runtime API of the type of the local controller - in this case, a view controller:
Example
method MY_VIEW_CONTROLLER_METHOD .
data: L_RUNTIMEAPI type ref to IF_WD_VIEW_CONTROLLER.
L_RUNTIMEAPI = WD_THIS->WD_GET_API( ) .
endmethod.
In this example method, you can use the methods of the IF_WD_VIEW_CONTROLLER runtime API by using the L_RUNTIMEAPI attribute.
You can also access the runtime API of the type of a used controller . This is outlined in the following example:
Example
method MY_CONTROLLER_METHOD .
data: L_COMP_INTF type ref to IG_COMPONENTCONTROLLER,
L_RUNTIMEAPI type ref to IF_WD_COMPONENT.
L_COMP_INTF = WD_THIS->GET_COMPONENTCONTROLLER_CTR( ).
L_RUNTIMEAPI = L_COMP_INTF->WD_GET_API( ) .
endmethod.
In this case, a reference variable of the component-global interface of the component controller is created. A reference variable of the runtime API of the component controller is then created using the WD_GET_API method.
Since the attribute WD_COMP_CONTROLLER of the type IG_COMPONENTCONTROLLER is already created by the development environment for each view controller , less source code is required for the access to the runtime API of the component controller:
Example
method MY_VIEW_CONTROLLER_METHOD .
data: L_RUNTIMEAPI type ref to IF_WD_COMPONENT.
L_RUNTIMEAPI = WD_COMP_CONTROLLER->WD_GET_API( ) .
endmethod.
All the other APIs of the Web Dynpro runtime are made accessible in different ways. Two examples:
The IF_WD_VIEW API can be accessed only using the VIEW attribute of the WDDOMODIFYVIEW method of the local view controller interface.
The APIs IF_WD_CONTEXT_NODE and IF_WD_CONTEXT_NODE_INFO can be accessed using the WD_CONTEXT attribute of type IF_WD_CONTEXT. These two APIs are required to set the fixed values of attributes .
For a list of all classes and interfaces of the framework and their access methods, see the reference section of this documentation.