The Controller Interface

Standard Attributes
y

wd_this (always available - references controller - see next section for list of methods because it is dependent on controller type. Within a component click on Display interface controller to view attributes and methods associated with its wd_this) wd_context (always available - list of methods) wd_comp_controller (if componentcontroller defined as used controller for another controller, it appears in the other controller as type IG<USDED_CONTROLLER>. A view's componentcontroller is always present for the view as type IG_COMPONENTCONTROLLER which is thewd_this for componentcontroller. ) wd_assist (if an assistance class is related to a component)

y y

y

wd_this - Structure of the Controller Interface
y

y y

y

IF_<CONTROLLER> (Local) o e.g., IF_VIEW1 - The view name is VIEW1. Its WD_THIS is defined as IF_VIEW1, which is a local controller interface. o e.g., WD_THIS->WD_CPIFC_<CONTROLLER> will access the view's used component  e.g., wd_this->wd_cpifc_model( )  model is the name of the used component IG_<CONTROLLER> (Global) IWCI_<CONTROLLER> (SAP Reusable) o accessing the used component within the view, VIEW1 above:  wd_this->wd_cpifc_model( ) ZIWCI_<CONTROLLER> (Custom Reusable) *** Note, if you create a reusuable component (e.g., ZLSO_MC_ATTENDEE_LIST), when you reuse it, the code must reference ZIWCI_LSO_MC_ATTENDEE_LIST, not ZIWCI_ZLSO_MC_ATTENDEE_LIST!

. wd_cpuse_model) o wd_cpifc_<COMPONENT_USAGE> (e..g.g.g. get_componentcontroller_ctr) o wd_cpuse_<COMPONENT_USAGE> (e... wd_cpifc_model) INBOUND PLUGS .Generated Local Interface for View Controllers View Controller <VIEW> Generated Interface IF_<VIEW> (e.g. IF_VIEW1) METHODS y y wd_get_api wd_create_action USED CONTROLLERS y methods o get_<USED_CONTROLLER>_CTR (e.

y methods o handle<INBOUND_PLUG> OUTBOUND PLUGS y methods o fire_<OUTBOUND_PLUG>_plg CONTEXT y y constants o wdctx_<NODE> types o element_<NODE> o elements_<NODE> USER-DEFINED ATTRIBUTES ACTIONS ORDINARY METHODS .

WDCTX_SEARCH_RESULTS) WD_GET_API() WD_CREATE_ACTION() GET_<USED_CONTROLLER>_CTR() e...g.g.g.g.IF_<VIEW> (e.view interfaces always private <ATTRIBUTE> (e. IF_VIEW1) generated interface for view controllers . RANKING) WDCTX_<NODE> (e. WD_CPIFC_MODEL() if interface controller of used component is used controller HANDLE<INBOUND_PLUG>() FIRE_<OUTBOUND_PLUG>_PLG() GET_<ACTION>_ACT() ONACTION<ACTION>() <ORDINARY_METHOD>() IG_<WINDOW> generated public interface for window controllers <ATTRIBUTE> flag PUBLIC checked WDCTX_<NODE> WD_GET_API() FIRE_<OUTBOUND_PLUG>_PLG() <ORDINARY_METHOD>() For window controller all ordinary methods and outbound plugs are defined as public.. GET_COMPONENTCONTROLLER_CTR() for all used controllers defined in same component WD_CPUSE_<COMPONENT_USAGE>() e.. WD_CPUSE_MODEL() if component usage is added to used controller list WD_CPIFC_<COMPONENT_USAGE>() e. IF_<WINDOW> generated private interface for window controllers <ATTRIBUTE> flag PUBLIC not checked WD_CREATE_ACTION() GET_<CONTROLLER>_CTR() for all controllers defined in same component WD_CPUSE_<COMPONENT_USAGE>() if component usage is added to used controller list WD_CPIFC_<COMPONENT_USAGE>() if interface controller of used component is used controller HANDLE<INBOUND_PLUG>() <EVENT_HANDLER_METHOD>() ...g.g.

.For window controller all inbound plugs are defined as private.

.

IG_<CUSTOM_CTR> generated public interface for custom controllers <ATTRIBUTE> flag PUBLIC checked WDCTX_<NODE> WD_GET_API() <ORDINARY_METHOD>() IF_<CUSTOM_CTR> generated private interface for custom controllers <ATTRIBUTE> flag PUBLIC not checked WD_CREATE_ACTION() GET_<CONTROLLER>_CTR() for all controllers defined in same component WD_CPUSE_<COMPONENT_USAGE>() if component usage is added to used controller list WD_CPIFC_<COMPONENT_USAGE>() if interface controller of used component is used controller <EVENT_HANDLER_METHOD>() FIRE_<EVENT>_EVT .Custom controllers similar to window controllers except no inbound or outbound plugs. Instead event and event handlers. both of which are defined in private interface.

(Z)IWCI_<COMPONENT> (globally visible) WD_GET_API() <ORDINARY_METHOD>() flag INTERFACE checked <SUPPLY_FUNCTION>() flag INTERFACE checked (automatically initializes context nodes with data) Can be accessed by controllers in other components via WD_CPIFC_<COMPONENT_USAGE> IG_COMPONENTCONTROLLER (global) <ATTRIBUTE> flag PUBLIC checked WDCTX_<NODE> <ORDINARY_METHOD>() flag INTERFACE not checked FIRE_<EVENT>_EVT flag INTERFACE checked .

IF_COMPONENTCONTROLLER (local) <ATTRIBUTE> flag PUBLIC not checked WD_CREATE_ACTION() GET_<CONTROLLER>_CTR() for all controllers defined in same component WD_CPUSE_<COMPONENT_USAGE>() if component usage is added to used controller list WD_CPIFC_<COMPONENT_USAGE>() if interface controller of used component is used controller <EVENT_HANDLER_METHOD>() FIRE_<EVENT>_EVT flag INTERFACE not checked Generic Web Dynpro API .

the wd_get_api() is defined in the public interface of all the controllers. this interface is embedded in the interfaces IF_WD_VIEW_CONTROLLER and IF_WD_COMPONENT.IF_WD_CONTROLLER contains the functionality available for all controllers. it can be called from any controller that declares the usage of that controller. Thus. Except for the View Controller. Is the following correct? wd_this->wd_cpifc_<COMPONENT_USAGE>-wd_get_api() Web Dynpro API for custom controllers (and embedded in view/window & component controllers) IF_WD_CONTROLLER NAME: string GET_ACTION() . which has no public interface. Therefore.

Can only be called from view controller methods GET_COMPONENT() Returns IF_WD_COMPONENT. Not accessible from view or window controllers) IS_ALIVE() Returns whether controller object has been cleared Web Dynpro API for view & window controllers IF_WD_CONTROLLER (see above) IF_WD_NAVIGATION_SERVICES PREPARE_DYNAMIC_NAVIGATION() DO_DYNAMIC_NAVIGATION() . The following are equivalent ways to access controller's root node: y y WD_CONTEXT WD_THIS->wd_get_api()->get_context()->ROOT_NODE GET_CONTROLLER_INFO() Returns IF_WD_RR_CONTROLLER (controller's name) GET_MESSAGE_MANAGER() Returns IF_WD_MESSAGE_MANAGER (methods used to report messages. The following are equivalent when not component controller: y y y WD_THIS->get_componentcontroller_ctr()->wd_get_api() WD_COMP_CONTROLLER->wd_get_api() WD_THIS->wd_get_api()->get_component GET_CONTEXT() Returns IF_WD_CONTEXT.GET_COMPONENT() GET_CONTEXT() GET_CONTROLLER_INFO() GET_MESSAGE() GET_MESSAGE_MANAGER() GET_PERSONALIZATION_MANAGER() IS_ALIVE() GET_ACTION() Returns IF_WD_ACTION used to read & redefine action properties. save or delete personalization variants. clear the message stack or check existance of messages) GET_PERSONALIZATION_MANAGER() Returns IF_WD_PERSONALIZATION_MANAGER (methods used to load.

Can not be called from window controller. e. Typically used in method wddobeforeaction().. GET_CURRENT_ACTION() Returns IF_WD_ACTION used to determine which client side event was fired.REMOVE_DYNAMIC_META_DATA() IF_WD_NAVIG_SERVICES_NEW PREPARE_DYNAMIC_NAVIGATION() DO_DYNAMIC_NAVIGATION() IF_WD_VIEW_CONTROLLER FIRE_PLUG() GET_EMBEDDING_WINDOW_CTLR() GET_VIEW_INFO() REQUEST_FOCUS() REQUEST_FOCUS_ON_ACTION() GET_CURRENT_ACTION() GET_CURRENT_ACTION_INFO() IS_CURRENT_ACTION_VALIDATING() GET_VIEW_USAGE() GET_CONTEXT_MENU_MANAGER() FIRE_PLUG() Fires any plug using it's name as string parameter GET_EMBEDDING_WINDOW_CTLR() Returns IF_WD_WINDOW_CONTROLLER if the view or window is embedded in another window (methods allow access to the meta data description of the window controller. description) REQUEST_FOCUS() sets the focus to a certain UI element if the element has its value property bound to a context attribute. view name. Can not be called from window controller..g. Typically used in method wddobeforeaction(). . life span. navigation links. REQUEST_FOCUS_ON_ACTION() sets the focus to a certain UI element if the element has the event property on_ bound to an action. GET_CURRENT_ACTION_INFO() Returns WDAPI_ACTION used to determine which client side event was fired. embedded views.g. name of default view) GET_VIEW_INFO() Returns IF_WD_RR_VIEW methods allow access to the meta data description of the view controller (e. Can not be called from window controller.

If the methods of the interface IF_WD_NAVIGATION_SERVICES are used to create the navigation links. Can not be called from window controller. there are methods to define or create temporary container assignments for the view usage and to create or delete temporary navigation links between outbound plugs. the method remove_dynamic_meta_data() has to be called to remove the links. PREPARE_DYNAMIC_NAVIGATION() & DO_DYNAMIC_NAVIGATION() Returns IF_WD_NAVIGATION_SERVICES or IF_WD_NAVIGATION_SERVICES_NEW methods allow the definition of navigation links dynamically. Used in connection with handling application errors. GET_CONTEXT_MENU_MANAGER() Returns IF_WD_CONTEXT_MENU_MANAGER methods allow access to the runtime objects of context menus. This is necessary if component usages are defined and instantiated at runtime. In addition. GET_VIEW_USAGE() Returns IF_WD_RR_VIEW_USAGE methods allow access to the meta data about the view usage (view. embedding container). which is the prerequisite to define static navigation links. Can not be called from window controller. Can not be called from the window controller.IS_CURRENT_ACTION_VALIDATING() Returns ABAP_BOOL used to determine if the current action is of type Standard (ABAP_TRUE) or ValidationIndependent (ABAP_FALSE). The methods in IF_WD_NAVIGATION_SERVICES_NEW return handles that may be used to delete the dynamically defined navigation links subsequently. Web Dynpro API for component controllers IF_WD_CONTROLLER (see above) IF_WD_COMPONENT ID: String ASSISTANCE_CLASS: CL_WD_COMPONENT_ASSISTANCE() GET_ID() GET_WINDOW_MANAGER() GET_COMPONENT_INFO() GET_PORTAL_MANAGER() GET_CONFIGURATION_KEY() GET_PERSONALIZATION_MANAGER() GET_APPLICATION() CANCEL_NAVIGATION() ADD_EVENT_HANDLER() . name of the view usage. you must dynamically delete them. If you dynamically create plugs. Then the inbound plugs of the related interface views do not exist at design time.

Allows access to information about the portal type and version embedding the WD application. GET_COMPONENT_INFO() Returns unique IF_WD_RR_COMPONENT. GET_APPLICATION() Returns unique IF_WD_APPLICATION. xxx_CMP_USAGE_GROUP() Used to handle component usages that are defined dynamically. Used to create modal popups or external dialog screens.Used to access meta data description of the application. CANCEL_NAVIGATION() Used to prevent navigation. ADD_EVENT_HANDLER() Used to dynamically register an event handler method. Contains methods to access portal functionality. Must be called before wddobeforenativation() is finished. REMOVE_EVENT_HANDLER() Used to dynamically delete any dynamically defined registration of an event handler for an event. MESSAGE MANAGER API . GET_PORTAL_MANAGER() Returns unique IF_WD_PORTAL_INTEGRATION.REMOVE_EVENT_HANDLER() GET_CMP_USAGE_GROUP() CREATE_CMP_USAGE_GROUP() HAS_CMP_USAGE_GROUP() REMOVE_CMP_USAGE_GROUP() REMOVE_PENDING_INPUT() GET_ID() Returns unique ID (string) of the actual WD component GET_WINDOW_MANAGER() Returns unique IF_WD_WINDOW_MANAGER. Used to access meta data description of the component and included entities. GET_ & CREATE_ return IF_WD_COMPONENT_USAGE_GROUP.

WD_THIS->wd_get_api->get_message_manager() IF_WD_MESSAGE_MANAGER Category TEXT REPORT_SUCCESS() REPORT_WARNING() REPORT_ERROR_MESSAGE() REPORT_FATAL_ERROR_MESSAGE() REPORT_ATTRIBUTE_ERROR_MESSAGE() REPORT_ELEMENT_ERROR_MESSAGE() Category EXCEPTION REPORT_EXCEPTION() REPORT_FATAL_EXCEPTION() REPORT_ATTRIBUTE_EXCEPTION() REPORT_ELEMENT_EXCEPTION() Category T100 .

report_exception() with MESSAGE_TYPE = 1 Error Messages 1. I 3.REPORT_T100_MESSAGE() REPORT_ATTRIBUTE_T100_MESSAGE() REPORT_ELEMENT_T100_MESSAGE() IS_EMPTY() HAS_VAL_ERRORS_FOR_WINDOW() HAS_VALIDATION_ERRORS() CLEAR_MESSAGES() REMOVE_MESSAGE() GET_MESSAGES() GET_MESAGE_FOR_ID() Standard Messages 1. report_exception() with MESSAGE_TYPE = 2 . report_t100_message() with MSGTY = S. report_error_message() 2. report_exception() with MESSAGE_TYPE = 0 Warnings 1. report_warning() 2. report_t100_message() with MSGTY = E 3. report_t100_message() with MSGTY = W 3. report_success() 2.