on 07-19-2007 6:19 AM
hi All,
As a beginner in webdynpro can u plz explain me what the following statement means? i m a little confused with the operator " ?= ".
<b> l_output_table ?= view->get_element( 'PERSONAL_VALUES_LIST' ).</b>
Plz explain me with a simpler example if possible..
Regards,
dev
hi Dev,
This operation is casting ....This is done when we need to up cast or down cast and instance of an object to its super class or subclass...The same way casting is done in anyother OOPs language..
Thanks
Anzy
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
In your case , view is a super class , which can contain different UI elements as it subclass.So here what we are doing is casting it to a particular UI element instance ( here it is a table ).
Now through the casted instance ( which will of type CL_WD_*_TABLE) ..You could access and change the properties of the table.
Thanks
Anzy
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
The operator ?= is a standard ABAP type casting operator used in all of OO ABAP, and not just a Webdynpro operator. It is used when you want to type cast a reference of an interface to a reference of one of the implementing classes.
In the example you have given, the variable l_output_table is of type cl_wd_table, which implements the interface if_wd_view_element. The method view->get_element( ) will return you an object of type if_wd_view_element. And you are type casting it to a reference of the table.
You can also use this to get the instance of the current controller. Both view controller and component controller inherit if_wd_controller and this can be used.
Regards
Nithya
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
93 | |
10 | |
10 | |
9 | |
9 | |
7 | |
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.