on 05-29-2012 12:30 PM
Hi,
In Web Dynpro ABAP, WD code wizard generates below code to do message handling.
wd_this->wd_get_api( ) method returns type IF_WD_VIEW_CONTROLLER. Here it is trying to do widening cast to lo_api_controller which is of type IF_WD_CONTROLLER.
I know widening cast is done to specify the super class reference to subclass reference variable in order to access the methods of subclass methods using superclass reference.
But here i do not see any classes involved. These are Interfaces.Please clarify.
* get message manager
DATA lo_api_controller TYPE REF TO if_wd_controller.
DATA lo_message_manager TYPE REF TO if_wd_message_manager.
lo_api_controller ?= wd_this->wd_get_api( ).
CALL METHOD lo_api_controller->get_message_manager
RECEIVING
message_manager = lo_message_manager.
Thanks,
Bharath.
Bharath,
well question,
however you aware of super & sub classes and Inheritance, in similar methodology will happen in Interface level also.
the casting(super) - IF_WD_CONTROLLER will be imported into (sub) - IF_WD_VIEW_CONTROLLER.
now only videning casting can be possible..
if you open Interfaces Tab under IF_WD_VIEW_CONTROLLER, you can understand easily.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
87 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.