Each controller contains an additional set of methods provided by the runtime. They can be used for developing applications. You cannot change the implementation of the methods - unlike the implementation of all the other controller methods. The content of the method set depends on the controller type and its implementation state. Some of these methods are described in more detail below.
Method WD_GET_API
This method contains all controller types. Depending on the controller type this method returns a reference variable of the associated type to the controller.
Ig_Componentcontroller |
value(Result) type ref to IF_WD_COMPONENT |
If_"View_Name" |
value(Result) type ref to IF_WD_VIEW_CONTROLLER |
Ig_"Window_Name" |
value(Result) type ref to IF_WD_VIEW_CONTROLLER |
Method GET_<MY_USED_CONTROLLER>_CTR
The method GET_<MY_USED_CONTROLLER>_CTRAll is automatically generated into the local controller interface for each controller to which a usage of another controller of the same component is assigned. It is not relevant whether it is a view component or a custom controller.
Return value
The method GET_<MY_USED_CONTROLLER>_CTR always returns a reference variable of the component-global interface of the used controller. This means, the return value is a reference variable of the type IG_<MY_USED_CONTROLLER>.
Example:
If you want to use methods of the component-global interface of a custom controller called MY_CUST_CONTROLLER within a view controller, you can enter a usage of the desired custom controller in the Properties tab. You can then use the method GET_MY_CUST_CONTROLLER_CTR in the local interface of the current controller.
method MY_CONTROLLER_METHOD . data: L_REF_MY_CUST_CONTROLLER type ref to IG_MY_CUST_CONTROLLER. L_REF_MY_CUST_CONTROLLER = WD_THIS->GET_MY_CUST_CONTROLLER_CTR( ). . . endmethod.
In the case of a view controller, the usage of the corresponding is almost always recommended, and therefore, this usage is automatically entered when you create a new view. A reference variable of the type IG_COMPONENTCONTROLLER of the variable is also created automatically. It is the variable of variable
WD_COMP_CONTROLLER.
This reference variable is known to every view controller. It is entered on the Attributes tab of the view controller and can be used by the application developer. This also means that all methods of the component-global interface of the corresponding component controller are available.
For more information, refer to the following chapter Cross-Controller Method Call.
Methods WD_CPUSE_<MY_COMPONENT_USAGE> and WD_CPIFC_<MY_USED_COMPONENT>
These two methods are important when using a component within another component. Refer to part 2 of this documentation under Component Usage Without Controller Access or Component Usage with Controller Access. These methods are created for each controller type, once a component usage or the usage of the interface controller of a used component is created.
Method FIRE_<MY_PLUG>_PLG
This method is only contained in view controllers and window controllers when an outbound plug is created for the corresponding controller. The method can be used to call an outbound plug from which navigation to a subsequent view or window is started.
Example:
method MY_CONTROLLER_METHOD WD_THIS->FIRE_MY_OUTBOUND_PLG( ). endmethod
For more information, refer to the chapter Navigation.
Method FIRE_<MY_EVENT>_EVT
This method allows each component controller or custom controller for which an event is defined to trigger this event.