Hi,
Just want to know is there any standard way of getting parent component name/view name ,if my control is in embedded view name at run time.
For eg : Consider embedded component as BP_DATA , so while accessing any view of BP_DATA( Relationships OV) , i need to find out whether this component is embedded within BP_HEAD ( Account screen ) or within BP_CONT(Contact Screen). I can see the parent_view name from outer_rep_view of the window( BP_DATA/Relationships) in debug mode. But those are protected and cannot be accessed.
Any pointers???
Regards,
Nithish
Edited by: nithish P on Mar 4, 2012 12:19 AM
Hi Leon,
I can get the window controller ( BP_DATA/Relationships) from view BP_DATA/RelationshipOV through code
me->view_manager->get_window( ).
But from window controller I am not able to fetch the parent component name , such as BP_CONT or BP_HEAD.
Could you please let me know from which attribute of the window controller can i get the parent view name or component name?
Regards,
Nithish
Hi Leon,
Even if we create get_outer_rep_view method in window class, how to access outer_rep_view attribute . Its defined as private in standard window class, so even after enhancing my widow class I wont be able to get it.
Is there any other path or logic to get the outer_rep_view if i create a new method in my window class?
Regards,
Nithish
Hi Nithish,
The attribute OUTER_REP_VIEW is defined as protected, not private.
You can access it in the view/window controller class like this.
me->outer_rep_view
You can refer the Class CL_AGROE_SEARCHWINDOW_IMPL Method GET_OUTER_REP_VIEW.
From the view/context node, you can access like this.
if ME->WINDOW->OUTER_REP_VIEW is bound. LV_PARENT_REP_VIEW = ME->WINDOW->OUTER_REP_VIEW->GET_PARENT( ). LV_WINDOW = GET_PARENT_WINDOW( ). ME->REP_VIEW = ME->WINDOW->OUTER_REP_VIEW.
Regards,
Leon
Thanks Leon.
My bad ,I wasn't able to access SAP yesterday , I remember only host_view attribute which is private and thought of the same
about outer_rep_view attribute !!!
Regards,
Nithish