cancel
Showing results for 
Search instead for 
Did you mean: 

?= operator in webdynpro..

Former Member
0 Kudos

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

Accepted Solutions (1)

Accepted Solutions (1)

mohammed_anzys
Contributor
0 Kudos

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

Answers (2)

Answers (2)

mohammed_anzys
Contributor
0 Kudos

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

mohammed_anzys
Contributor
0 Kudos

Hi

Also you could go through the following the threads.

Thanks

Anzy

Former Member
0 Kudos

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