cancel
Showing results for 
Search instead for 
Did you mean: 

dd ?= view->get_element('ROOTUIELEMENTCONTAINER') .

ravi_kumar221
Participant
0 Kudos

data dd type ref to  cl_wd_uielement_container .

     .

   dd  ?=    view->get_element('ROOTUIELEMENTCONTAINER') .

help me what is   the meaning of       dd  ?=    view->get_element('ROOTUIELEMENTCONTAINER') .

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

Hi,

Here the method Get_element( ) returns a reference to interface IF_WD_VIEW_ELEMENT which is being implemented in CL_WD_UIELEMENT_CONTAINER.

So you are assigning this object reference to dd which is reference to CL_WD_UIELEMENT_CONTAINER, So you are going up in terms of inheritance, So this is called UP CAST or WIDENING CAST and the casting operator(?=) is not required for Up cast.

Only when you come downwards in terms of inheritance while assigning references this casting operator would be required, Suppose in your case if you are assigning in reverse way then the ? operator would be needed.

former_member184578
Active Contributor
0 Kudos

Hi,

This indicates Widening Casting. Assigning the instance of super class to sub class instance is called widening casting,

Here view->get_element( ) returns the reference of root ui element container class which is assigned to reference dd of cl_wd_uielement_container class

For more information search for "Widening Casting"

Thanks & Regards,

Kiran

chengalarayulu
Active Contributor
0 Kudos

Hi Ravi,

This concept is used in Dynamic Coding..

and "?=" is used for type casting. You can refer for type casting concepts.