Show TOC

Background documentationHook Methods: Methods Called by the Runtime Locate this document in the navigation structure

 

In addition to the application methods, each local controller interface has a fixed number of methods that can only be called by the runtime. The application developer cannot specify when these methods are called, but can modify the implementation. The time when these methods are called is predefined. For a description, refer to the phase model of Web Dynpro.

WDDOINIT and WDDOEXIT

The simplest examples are the methods WDDOINIT and WDDOEXIT.

WDDOINIT is called automatically when a controller is initialized for the first time. For each newly created controller, this method is empty but can be filled with suitable source code. These methods can contain the following steps, for example:

  • Creating instances of help classes

  • Initializing controller attributes

    If you need more attributes for the programming and these are also reference variables, they can be initialized here.

  • Triggering authorization checks (to be done in help classes)

  • Setting initial values of the controller context

  • Instantiating used components

    See Cross-Component Programming.

Syntax Syntax

Example of the initialization of a controller context:

  1. method WDDOINIT . 
  2. data: NODE type ref to IF_WD_CONTEXT_NODE,
  3.       FLIGHTS type SPFLI_TAB.
  4. * get node from context 
  5.   NODE = WD_CONTEXT->GET_CHILD_NODE( 'CARRIER_NODE' ).
  6. * get connections from helper class
  7.   FLIGHTS = CL_WD_GET_SPFLI=>GET_FLIGHTS( ).
  8.   NODE->BIND_ELEMENTS( FLIGHTS ).
  9. endmethod.
End of the code.

WDDOEXIT is called by the runtime when the controller is exited and can be used for releasing locks, for example.

Depending on the value of the controller the local controller interface also has the following hook methods available:

Component Controller

View Controller

Window Controller

WDDOINIT / WDDOEXIT

WDDOINIT / WDDOEXIT

WDDOINIT / WDDOEXIT

WDDOAPPLICATIONSTATECHANGE

WDDOBEFOREACTION

WDDOBEFORENAVIGATION

WDDOAFTERACTION

WDDOONOPEN

WDDOPOSTPROCESSING

WDDOMODIFYVIEW

WDDOONCLOSE

WDDOONCONTEXTMENU