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.
Edited by: nithish P on Mar 4, 2012 12:19 AM
I can get the window controller ( BP_DATA/Relationships) from view BP_DATA/RelationshipOV through code
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?
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?
The attribute OUTER_REP_VIEW is defined as protected, not private.
You can access it in the view/window controller class like this.
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.
I could not able to find GET_PARENT_WINDOW( ).
How to access a view attribute of a parent component from embedded view?
Below is a sample code written in embedded view event handler method.
lr_window type ref to zembedded_view_contained_window.
lr_outer_rep_view type ref to cl_bsp_wd_rep_view.
lr_parent type ref to cl_bsp_wd_rep_view.
lr_window ?= me->view_manager->get_window_controller( ).
lr_outer_rep_view ?= lr_window->get_outer_rep_view( ). ** custom method to return outer_rep_view
lr_parent ?= lr_outer_rep_view-> get_parent( ).
Here I got the parent component OV page as a rep view, from here how to get the instance of a required view controller of a parent component?
Thanks in advance for your help.