Show TOC

Programming Controller MethodsLocate this document in the navigation structure

Use

In general, attributes and methods are used to specify the processes of programs in Web Dynpro applications and to edit the data contained in the context. Action Event Handlers and Cross-Controller Method Call contain some simple examples of these program processes.

This documentation provides general information on programming using methods of the Web Dynpro framework. In addition, frequently used methods are described and illustrated by source code examples.

For more information about each of the controller methods, see Controller: Methods and Controller Classes and Interfaces .

Caution

Note that the logical expressions IS SUPPLIED and IS REQUESTED are not available in Web Dynpro ABAP.

More information : Special Features of Web Dynpro ABAP Programming

When you create a new Web Dynpro component, a component controller is automatically created for this component. When you create a view for a Web Dynpro component, a view controller is automatically created for this view. Each window of a component contains a window controller and you can create custom controllers for specific purposes.

At least two attributes are automatically known to each controller. These are the following object references:

You can also create your own attributes for each controller. These attributes are used to store non-UI-relevant application data (UI-relevant data is stored in the context).

Constants for Context Nodes

For every node you create in the context of a controller, a constant with the name WDCTX_<node_name> is automatically created in the corresponding interface IG_<controller_name> and IF_<controller_name>. In the source code of the controller, this constant can then be used for the node name instead of a string literal.

wd_context->get_child_node( wd_this->wdctx_my_node ).


            

Do not use:

wd_context->get_child_node( 'MY_NODE' ).
            

The advantage of using constants is that the compiler knows the constant and, therefore, syntax errors are triggered if the name of the context node contains typing errors. However, it is also possible to pass a string literal.

Interface Controller

The additional interface controller listed in the development environment is not an independent object but a specific subset of the component controller:

The interface controller defines the interface of a Web Dynpro component for use in another component. The methods are implemented in the component controller. When you set the Interface flag for methods/events/context nodes in the component controller, these elements are copied into the interface controller.