07-04-2016 6:30 PM
Hey all,
I want to get the parent of my cl_gui_html_viewer object. When I debug it I can clearly see that its parent type is a reference to cl_gui_simple_container but when I write the following code:
DATA: lo_simple_container TYPE REF TO cl_gui_simple_container.
lo_simple_container = lo_html_header->parent.
and want to active it. It gives me the following error:
The type of ''LO_HTML_HEADER->PARENT'' cannot be converted to the type of ''LO_SIMPLE_CONTAINER''
but why if I am using the right reference type? Can somebody tell me how can I get the parent of my object lo_html_header?
Thank you.
Regards,
RB
07-04-2016 7:13 PM
This is a question of up and down casting (or widening/narrowing cast respectively).
You must use one of the two variants :
In your case, you have:
So you must use:
ABAP documentation : http://help.sap.com/abapdocu_702/en/?url=ABENCAST_CASTING_GLOSRY.htm
07-04-2016 7:13 PM
This is a question of up and down casting (or widening/narrowing cast respectively).
You must use one of the two variants :
In your case, you have:
So you must use:
ABAP documentation : http://help.sap.com/abapdocu_702/en/?url=ABENCAST_CASTING_GLOSRY.htm