Calling components in another component

Hi experts,
I am calling component B, component C and component D in component A by component usage.
I have created 3 view containers in comp A and I have set the visibility property to null.      
I have 3 buttons in same view. If I click on button1 it will display the view container1 (Comp B) by setting the visibility property.
Similarly I have done for other 2 button.
Is there any way to call the view (Components B,C and D) in component A to increase the performance?
Another question is:
When will be the use components get loaded into memory?Will it affect the performance if all the components get loaded initially?
Thanks in Advance.

>When will be the use components get loaded into memory?Will it affect the performance if all the components get loaded initially?
Declaring the component usage doesn't immediately instaniate the inner component.  The component will be instantiated upon first usage of its context, first visibility within the window, or when explicity created via API calls. 
For instance, quite often with the ALV you will explicity create the instance of the inner component usage so that you can access its API methods.  You always put this block of code within a check to see if it is already active, as the data binding of the context might have already been processed:
****Access Component Usage - Create it if it hasn't already been created by framework
data: l_ref_cmp_usage type ref to if_wd_component_usage.
  l_ref_cmp_usage =   wd_this->wd_cpuse_alv( ).
  if l_ref_cmp_usage->has_active_component( ) is initial.
    l_ref_cmp_usage->create_component( ).
  endif.
****Access Component Interface
  data l_salv_wd_table type ref to iwci_salv_wd_table.
  l_salv_wd_table = wd_this->wd_cpifc_alv( ).
There is garbage collection for component usages but it tends to work on the safe side.  If you really want to release memory it is better to explicity destroy the component usage. For instance if you have a tabstrip, you might want to destroy inner component usages displayed in one tab when the user switches to a different tab.
data: l_cmp_usage type ref to if_wd_component_usage.
* delete f4 component
  l_cmp_usage =   wd_this->wd_cpuse_f4_config_id( ).
  if l_cmp_usage->has_active_component( ) = abap_true.
    l_cmp_usage->delete_component( ).
  endif.

Similar Messages

  • Component calling methods on another component

    I have 2 components: Repository, and Document. A repository
    has an array of documents in variables scope. In each component I
    use the init() method to return an instance of the object. When a
    repository object is inited it generates a query of the documents
    that it contains, and loops through that, calling document.init()
    on each one and adding the resulting document object to the array.
    When I init() a repository and use CFDUMP to view its
    documents array, I get an array of the correct length containing
    document objects. However, when I try to loop through the array and
    call a method like getTitle() on each document, I get empty
    strings. When I init() a document on its own, getTitle() works
    fine. Is there something basic that I'm forgetting here?
    Let me know if you need to see the more code.
    Don Zacharias
    Sacramento, CA

    In the Repository's init() method:
    <cfloop query="qDocuments">
    <!--- create empty document object --->
    <cfset document =
    createObject("component","Document").init(qDocuments.id)>
    <!--- add empty document to array --->
    <cfset arrayAppend(variables.documents,document)>
    </cfloop>
    In the front end
    <!--- show documents for this repository --->
    <cfset arr_documents = repository.getDocuments()>
    <cfloop from="1" to="#arrayLen(arr_documents)#"
    index="i">
    <cfset doc =
    createObject("component","/docmanager_v2/components/Document")>
    <cfset doc = arr_documents[ i ]>
    <cfoutput>Title: #doc.getTitle()#, Summary:
    #doc.getSummary()#, Keywords:
    #doc.getKeywords()#<br></cfoutput>
    </cfloop>
    Now I'm doing createObject twice but I guess that makes
    sense... I wish I knew the principle at work here though...

  • How I can call controller's functions from another component?

    Hi again!
    I make a few web Dynpro components, for example first for user-data processing, second - for project-data processing. In the controller of 1-st controller there is a function getUserById(). In the controller of 2-nd component I need such function. And I don't want to make a dublicate for this function in the controller of 2-nd component. Is there a way to call function in one component from another?

    Hi,
         Yes, you can reuse the component. There are two basic types of component communication. 1. Intra Component communication 2.Inter Component communication.
    1. Intra Component  communication: The two components must be in same DC(project).
    Procedure:Say there are C1,C2 components in a DC.
    Open C2, Open interface controller, create a similar (_parameters and return type_) method to the method C2. Call C2's method in this Interface method.   
    Open C1, select and right click  Used Web Dynpro Components -> Add Used Component. In the wizard, you can browse and select the C2 component,and enter a name to the usage. Then the usage of the interface <b>must </b>be added in properties required controllers of a view/component controller.
    Now we can use the method that is available in the C1 interface controller.     
    You must define method before declaring usage
    <b>2.Inter Component  communication:</b> The two components are in different DCs
    Open DC metadata of C2. Right click on Public part-> create new Public Part.Enter name-> Next -> Select entity type as Web Dynpro Component in wizard,in Select Entities  select the component ,Finish.
    A structure for public part is created.
    Open C1, Open DC metadata of C1. Right click on Used Dcs-> AddUsed DC. Browse to C2's public part.
    Select Finish.
    regards,
    Siva
    Edited by: Siva Rama Krushna on Dec 19, 2007 10:07 AM

  • Component group type assignment in call components in JIS

    Hi All
    How Component group type assignment is done  in call components ?
    Edited by: mayuresh  bhurke on Jan 20, 2012 8:25 PM

    Hi Mayuresh bhurke,
    How the system will does the job:
    The system carries out this function automatically, each time a JIT call is received. In this way it assigns each call component transmitted to a components group type. The components group type then takes on the internal control of the call components.
    With sequenced JIT calls for assemblies, the system assigns several call components to the same components group type. With the other call types the call components and the components group type form a logical unit and the system therefore assigns a different components group type to each call component.
    In the components group determination the system compares whether the characteristics of the call components match a components group type. As soon as it can assign a call component, it continues with the next one. In the profile for the components group determination you can define with which priority the system should consider the various characteristics. The system determines the relevant characteristics of the call components as follows:
    JIT customer
    The JIT customer is made up of the sold-to party and the partner description and can therefore be taken from the IDoc.
    Unloading point and assembly location
    The unloading point and, if necessary the assembly location, are also transmitted with the JIT call. The system can also take these characteristics of the call components from the IDoc.
    Components group material
    The JIT customer generally transmits the components group material with a call. You have several options for defining the components group material of the call component before the components group determination.
    You can realize an individual components group material determination using a customer exit. This is particularly recommended for sequenced JIT calls for assemblies, due to the large number of variants.
    If you use the process for discrete materials, you can transfer the material of the call components as a components group material.
    If you use the process for discrete materials and exactly one components group material can be assigned to a call component, you can transfer the configurable material of the call component as a components group material. To do this you must have entered the configurable material in the material master of the call component in the tab page Basic data 2 in the field Cross plant conf.mat.
    Production version
    You can also assign the production version using a customer exit. The production version allows you to assign two otherwise equal call components to different components group types, to produce them on different production lines, for example.
    There are also call types:
    please follow the below link:
    http://help.sap.com/saphelp_di46c2/helpdata/EN/7a/ad7d2b1e4c11d3b69c0000e82d81c3/content.htm
    I hope you can find the need full information.
    Regards,
    Madhu.G

  • Callinfg ALV from another component

    Hi all,
    We have a main component in which on press of a button we need to show alv which is in another component.
    I am trying to follow these steps but i need your inputs
    1. I have declared the component which calls alv in used components
    2. In the main view of my component i have placed a VCU
    3. In the window of the main component i have embedded that VCU and embedded the view of the component which calls the alv.
    Now how can i call alv on press of that button ?
    Please let me know your suggestions
    Regards
    Bhanu

    Hi,
    Aditya has the right idea in my opinion. I always do things this way (altering visibility) because 1. it's easiest and 2. you don't have initializing problems. Here's how you can do it:
    First of all, set your ViewContainer invisible in design time.
    1. Go to the Component controller of your main component (where your ViewContainer is in), go to attributes
    2. Add an attribute Z_GO_VIEW, Public, Type ref to, IF_WD_VIEW.
    3. Go to your View of the CC where the VC actually is in.
    4. Go to hook method WDDOMODIFYVIEW
    5. Add the following code:
    IF first_time = abap_true.
        wd_comp_controller->z_go_view = view.
    ENDIF.
    --> now you have the instance of your view interface.
    6. Make a button
    7. In the event handler method of the button, code something alike to this:
    DATA:
           lo_el_ui_root      TYPE REF TO cl_wd_uielement_container,
           lo_el_trans_cont1  TYPE REF TO cl_wd_uielement_container,
           lo_el_button1     TYPE REF TO cl_wd_button.
    DATA: lv_visibility TYPE WDUI_VISIBILITY.
    lo_el_ui_root ?= wd_comp_controller->z_go_view->get_element( 'ROOTUIELEMENTCONTAINER' ).
    lo_el_trans_cont1 ?= lo_el_ui_root->get_child( ID = 'TC_ONE' ).
    lo_el_button1 ?= lo_el_trans_cont1->get_child( ID = 'I_AM_THE_MIGHTY_BUTTON' ).
    lv_visibility = '02'.
    lo_el_button1->set_visible( value = lv_visibility ).
    This isn't exactly what you'll need but you get the picture: Get the View Instance, Downcast the UI tree for the Element you want to dynamically alter, use the right method for alterations.
    This should solve your problem. If it doesn't, ask us again
    regards, Lukas

  • Select-options are not destroyed while calling view of used component popup

    Hi Friends ,
    I'm facing a unique problem. I'm calling a view of a component within another component. the view that I'm calling has some select-options. When I close the popup window ( using close 'X' of popup ) and then try to reopen the popup system give me a dump. I debugged and found that select-options are not destroyed by system and once it tries to create the select-options again it dumps because they are already there.  
    This is the source code extract of that dump for your reference .
    1 method if_wd_select_options~add_selection_field.
    2
    3   data:
    4     lr_table_descr       type ref to cl_abap_tabledescr,
    5     lr_struct_descr      type ref to cl_abap_structdescr,
    6     lr_value_field_descr type ref to cl_abap_elemdescr,
    7     added_field          like line of mt_added_fields,
    8     dfies                type dfies,
    9     description          type string,
    10     complex_restrictions type if_wd_select_options=>t_complex_restrictions.
    11
    12   field-symbols:
    13     <it_result> type index table.
    14
    15 * check of someone wants to add a field that already exists
    16   read table mt_fields
    17        with key m_id = i_id
    18        transporting no fields.
    19   if sy-subrc = 0.
    20 *   might be deleted - recreating a field with different setting is of course allowed
    21     read table mt_all_removed_fields
    22          with key table_line = i_id
    23          transporting no fields.
    24     if sy-subrc <> 0.
    >>>       message x000(00).
    26     endif.
    27
    28 *   remove the existing field in order to avoid duplicates
    29     delete table mt_fields with table key m_id = i_id.
    30   endif.
    I've already tried using REMOVE_ALL_SEL_SCREEN_ITEMS( ) method of interface IF_WD_SELECT_OPTIONS before creating new elements ( select-options ). If any one can help me in this It would really help and I'll appreciate it.
    Thanks in advance,
    Laeeq

    I've sloved the problem

  • Read GUID of profile set in another component

    Hi,
    I am trying to read GUID of one component into another. Read it like this: This is marketing scenario where we create segments. Each segment has a GUID attached to it but component SEGED_SET which is meant for segments has no such attribute.
    How system is reading GUID for a segment:
      wa_object-object_id   = lo_entity->get_key( ).
      wa_object-object_name = lo_entity->get_name( ).
      CALL METHOD cl_crm_genil_container_tools=>get_key_from_object_id
        EXPORTING
          iv_object_name = wa_object-object_name
          iv_object_id   = wa_object-object_id
        IMPORTING
          es_key         = lv_guid.
    And it works.
    Now we have another component SEGED_NOTE which is used by SEGED_SET. I need to read GUID of segment in this component. I put following code:
      lo_entity ?= me->collection_wrapper->get_current( ).
      CHECK lo_entity IS BOUND.
      lo_parent ?= lo_entity->get_parent( ).
      CHECK lo_entity IS BOUND.
      wa_object-object_id   = lo_parent->get_key( ).
      wa_object-object_name = lo_parent->get_name( ).
      CALL METHOD cl_crm_genil_container_tools=>get_key_from_object_id
        EXPORTING
          iv_object_name = wa_object-object_name
          iv_object_id   = wa_object-object_id
        IMPORTING
          es_key         = lv_guid.
    But issue here is that lv_guid is not filled as this method reads data from buffer and currently buffer has data only for SEGED_NOTE and not for its parent entity. Please note that object name and object id were correctly retreived.
    Is there any other way to read this GUID?
    Regards,
    Shikha

    Hi Shikha,
    Declare an atrribute in Component Controller and use this to exchange the value from one component to another.
    Read the GUID in the GET Method of any displayed attribute using the +ifbol_property_access ( Class/ Interface ) using the GET_property Method.+_
    Regards,
    S John

  • Call Function From MXML Component

    I am using MXML to create components that I use within my
    application. I have one MXML file that contains a list with a
    custom itemRenderer that is in another MXML file. I have an
    actionscript file with a function that I want to call from the
    itemRenderer.
    If I call the function from my main application, everything
    works fine. If I try to call it from one of the other MXML files, I
    get a 1180 Call to a possibly undefined function error.
    Is there a special way that I need to use to call the
    function?
    The main MXML file is in the root directory, the actionscript
    file is in a folder called functions, and the MXML files are in a
    folder called components.
    Thank you for any help.

    I was able to figure out my problem. It was just a simple
    typo of including the wrong file in a Script tag. However, this
    caused more issues and I ended up having to rewrite a large section
    of code to get everything working.
    Thank you for your help.

  • Prepare_dynamic_navigation to embed in another component

    Hi,
    I have two components A and B. A uses B as used component. Both A and B have  I  as used component. I is the interface component for visual components. Component VC implements interface component I.
    My requirement is to put component VC in a view container in component B. But A should act as the controlling component and should take care of creating component VC and embed the created component VC into view container of B. Is it possible using prepare_dynamic_navigation method?
    I am using the code as follows in component A:
    try.
          l_view_controller_api->prepare_dynamic_navigation(
                 source_window_name          = 'WI_MANAGECOURSE'
                 source_vusage_name          = 'MAIN_USAGE_1'
                 source_plug_name            = 'GOOUT'
                 target_component_name       = 'B'
                 target_component_usage      = 'MAIN_USAGE_1'
                 target_view_name            = 'WI_GENERICRM'
                 target_plug_name            = 'DEFAULT'
                 target_embedding_position   = 'VI_MAIN/VIEWCONTAINER' ).
        catch cx_wd_runtime_repository.
          raise exception type cx_wdr_rt_exception.
      endtry.
    Create the actual visual Component
      if wa_cmp_usage-component_usage->has_active_component( ) is not initial.
        wa_cmp_usage-component_usage->delete_component( ).
      endif.
      wa_cmp_usage-component_usage->create_component( 'VC' ).
    This code gets executed fine but some where in the ABAP frame work class, I get the error:
    "Component Usage VIEW_INTERFACE Has No Component. Application May Not Have Created an Instance "
    VIEW_INTERFACE is the component use for interface I in both components A and B.
    Regards,
    Srini.

    Hi,
    The problem is resolved after I moved the embedding on to the same component. But I doubt whether it would be possible to use prepare_dynamic_navigation to embed in another component.
    Regards,
    Srini.

  • Trying to use a popup window as a component  in another component

    Hi guys,
    I am unable to use a popup component in another component in
    Flex .
    Its not calling the popup compopnent.
    Could anyone plz hel me.
    This is my code.
    This is the parent component TitlWindow where i want to call
    my popup
    component.
    <mx:TitleWindow xmlns:mx="
    http://www.adobe.com/2006/mxml"
    layout="absolute" width="100%" height="100%"
    xmlns:util="userinterfaces.util.*"
    creationComplete="showWindow();"
    title="CREATE PROFILE">
    This is my script where i am writing a function to call a
    component
    whose name is fielupload.mxml
    <mx:Script>
    private function showWindow():void
    pop =
    fileupload(PopUpManager.createPopUp(this,fileupload,true));//
    fileupload.mxml
    is called
    pop.title = "Please enter your login information.";
    pop.showCloseButton =true;
    PopUpManager.centerPopUp(pop);
    pop.addEventListener("close",removeMe);
    </mx:TitleWindow>
    This is the code for fileupload.mxml
    <?xml version="1.0" encoding="utf-8"?>
    <mx:TitleWindow xmlns:mx="
    http://www.adobe.com/2006/mxml"
    layout="absolute" width="100%" height="100%"
    xmlns:util="userinterfaces.util.*" title="File Upload">
    <mx:Script>
    <![CDATA[
    import mx.collections.XMLListCollection;
    import flash.events.Event;
    import flash.events.IOErrorEvent;
    import flash.events.ProgressEvent;
    import mx.controls.Alert;
    import flash.net.FileFilter;
    import flash.net.FileReference;
    import flash.events.SecurityErrorEvent;
    import mx.controls.Button;
    import mx.controls.TextInput;
    import mx.controls.ProgressBar;
    import mx.core.Application;
    import flash.net.URLRequest;
    import flash.net.URLRequestMethod;
    import mx.core.UIComponent;
    import mx.managers.PopUpManager;
    public var fileFilterImage:FileFilter = new
    FileFilter("Images","*.png;*.gif;*.jpg");
    public var fileFilterDocument:FileFilter = new
    FileFilter("Documents", "*.txt;*.doc;*.pdf;*.rtf");
    public var fileFilterArchives:FileFilter = new
    FileFilter("Archives", "*.zip;*.tar;*.hqx");
    public var fileFilterAll:FileFilter = new
    FileFilter("All", "*.*");
    public var fileRef:FileReference;
    public var selectedId:String;
    public function init():void {
    fileRef = new FileReference();
    fileRef.addEventListener(Event.CANCEL,
    traceEvent);
    fileRef.addEventListener(Event.COMPLETE,
    completeEvent);
    fileRef.addEventListener(Event.SELECT,
    selectEvent);
    fileRef.addEventListener(IOErrorEvent.IO_ERROR,
    traceEvent);
    fileRef.addEventListener(Event.OPEN, traceEvent);
    fileRef.addEventListener(ProgressEvent.PROGRESS,
    onFileProgress);
    fileRef.addEventListener(SecurityErrorEvent.SECURITY_ERROR,
    traceEvent);
    public function traceEvent(event:Event):void {
    var tmp:String =
    "================================\n";
    public function
    ioErrorEvent(event:IOErrorEvent):void{
    Alert.show("IOError:" + event.text);
    traceEvent(event);
    public function selectEvent(event:Event):void{
    //var selectedId:String =
    selectButton(event);
    //Alert.show("i am in id" +
    Application.application.winMyProfile.selectedId);
    btnUpload.enabled = true;
    iptFile.text = fileRef.name;
    public function
    selectButton(catchButton:Event):void{
    var newButton : Button = new Button;
    newButton = catchButton.currentTarget
    as Button
    selectedId = newButton.id;
    //Alert.show("i am in id" +
    selectedId);
    public function
    onFileProgress(event:ProgressEvent):void {
    prgBarUpload.label = "Loaded " +
    event.bytesLoaded + " of " +
    event.bytesTotal + " bytes";
    prgBarUpload.setProgress(event.bytesLoaded,
    event.bytesTotal);
    public function
    completeEvent(event:Event):void {
    Alert.show("File Uploaded
    Successfully");
    btnUpload.enabled = false;
    btnBrowse.enabled = true;
    public function uploadFile(url:String):void {
    url = url + "?
    folder="+Application.application.winLogin.userInfo.getUsername();
    var req:URLRequest = new
    URLRequest(url);
    req.method = URLRequestMethod.POST;
    var folder:String =
    Application.application.winLogin.userInfo.getUsername();
    fileRef.upload(req, folder,true);
    ]]>
    </mx:Script>
    <mx:VBox id="vbMain" width="100%" height="60">
    <mx:HBox width="100%" height="22">
    <mx:TextInput height="22" id="iptFile"
    width="100"/>
    <mx:Button id="btnBrowse" label="Browse"
    click="selectButton(event),fileRef.browse([fileFilterAll]);"
    />
    <mx:Button id="btnUpload" label="Upload"
    enabled="false"
    click="uploadFile('fileupload.do');" />
    <mx:Button id="btnCancel" label="Cancel"
    enabled="false"
    click="PopUpManager.removePopUp(this);"/>
    </mx:HBox>
    <mx:ProgressBar width="200"
    source="iptFileResume" height="5"
    id="prgBarUpload" mode="manual"/>
    </mx:VBox>
    </mx:TitleWindow>
    Its not even showing any error , i dont know whats the
    problem with
    it.
    Thanks for your help,
    Mario.

    If I understand, you want to display a popup Titlewindow from
    within another popup TitleWindow? This is possible.
    Simplify your code to get it working first.
    Tracy

  • Ssis error: hresult e_fail has been returned from a call to a com component

    I am using VS 2013 (BIDS) to develop SSIS packages. It is running on a windows 2012 server.
    I have a dev server on which when i try to load an SSIS project using the solution file i get a bunch of errors, and then visual studio just closes. The error is:
    hresult e_fail has been returned from a call to a com component
    If i copy the project to another machine it works fine.
    If i open VS first, and then open the project using the proj file, it seems to work.
    Any ideas what might be causing this error? I can work for now, but am worried my project may be corrupted in some way so dont want to do too much work on it.

    It might be a corruption so a re-install is desired. But
    Use SSDT (VS2010 shell) that came with the SQL Server installation media to edit SSIS 2012 packages.
    Arthur
    MyBlog
    Twitter

  • Problem in Navigation from one component to another component

    Hi,
    Here my requirement is:
    I have component - SRQM_INCIDENT_H/MainWindow. Now I have a buttopn in this window called "Create Task". When I clicke on this button, I need to navigate into another component carrying with some data. The other component is - BT125H_TASK/MainWindow.
    I have done the following steps:
    1. Added Task as component usage.
    2. Added Outbound plug in Service Request
    3. Now I am trying to create navigation link. Here, I am not able to see my component usage in Target views list.
    So, I am not able to create navigation link itself.
    Could you please help me out with some stepsfor this.
    Thanks,
    Sandeep

    1)Add the window to you component usage,the one whihc u want to navigate to .
    2) add this wuindow in the runtime repository to your main window.
    Only then u shud b able to c ur window in the "target" list for creating nav links.
    Suvidha

  • Updating component within awt-event thread of another component

    Hi,
    I'm having trouble updating (repainting) a component inside the awt-event thread of another component. The component I want to update is a JFrame with a JLabel that lists the progress of the original component's action that triggered the event. I can get the frame to pop up but it's content is never fully painted and never refreshed.
    I've tried using invokeLater() (the frame ran after the original awt-event had finished) and invokeAndWait() (blocked the original awt-event) and running the computational intensive parts of the original component's action in SwingWorker threads (no difference) but all to no avail.
    What I want to do is similar to a progress bar so I think it should possible. Any suggestions? Thanks, Matt

    Are you calling yield() or sleep(...) on your Thread?

  • How to make a method global so that it can be used in another component.?

    Hi,
    Is it possible to make a method global so that it can be used in another component.?
    i.e I have one component C1 and methods declared in this component M1, M2, ...
    Now I have another component C2 and in this component i want to use method M1 of component C1.
    how to do so?
    Any inputs will be appreciated.
    Thanx.

    Hi,
    As Uday said, To make the method as global of component say C1, You have to make method as interface by clicking the check box.
    Now while using the method in other component say C2, you have to follow following steps:
    1. In used component of comp. C2, add component C1.
    2. Instantiate the component atleast once in any of the method of component using code wizard option:
    'Instantiate Used Componet'.
    3. Now you can call the method of component C1 using code wizard option 'Method call in used controller'

  • Reading the data from one component view into another component view

    Hi All,
    I have requirement to read the data from one component into another component while creating the service order. Here are the details.
    Main View for Service order: BT116H_SRVO in that we have two assignment blocks like Organizational data(BTORGSET) and amount allocation(BTAMNTALL).This two blocks are two different component which are associated with main component(BT116H_SRVO).
    I need to read the sales org data from component/View(BTORGSET/Orgsetdata) into Component/View(BTAMNTALL(HdrBillPlanDet) method DO_VALIDATE_INPUT.
    I searched in SDN but all the posts are related to the data exchange between two views in same component. But My scenario is different as explained above.
    Refer the attachments for the component link..
    Please let me know how we can achieve this one..
    Thanks,
    Sapsar.

    Finally I was able to fix my code...My Mistakes were need to read the parent node above three levels and need to use the relation entity name while reading the data..
    Below is the correction code
    IF iv_index IS NOT INITIAL.
         lr_iterator ?= collection_wrapper->get_iterator( ).
         lr_current ?= lr_iterator->get_by_index( iv_index ).
         lr_entity ?= lr_iterator->get_by_index( iv_index ).
       ELSE.
         lr_current = collection_wrapper->get_current( ).
       ENDIF.
    *loop back to root entity
             WHILE lr_entity->get_name( ) NE 'BTAdminH'.
               lr_entity = lr_entity->get_parent( ).
             ENDWHILE.
    *Get the related entity
             IF lr_entity IS BOUND.
               lr_collection ?= lr_entity->get_related_entities( iv_relation_name = 'BTHeaderOrgmanSet' ) .
               IF lr_collection IS BOUND.
                 lr_orgset_m = lr_collection->get_current( ).
    *            lr_orgset = lr_orgset_m->get_related_entity( iv_relation_name = 'BTOrgSet' ).
                 lr_orgset = lr_orgset_m->get_property_as_string( 'SALES_ORG' ).
               ENDIF.
             ENDIF.
    Thanks,
    Sapsar.

Maybe you are looking for