Dynamic component interface context mapping

Hi all,
  I got 2 component A and B. Component A use component B.
  I would like to know how to set interface context attribute value of comonent B within a view of component A in programatic mode.
  It should be something like this:
wdThis.wdGetCompBInterface().wdGetContext.setAttr1("OK");
is it possible???
thank u in advance,
Stefano

Hi
In your query consider B has BA Context which you want to fill from main componetn A
Yes it is possible to add values from A to B but I did it only through context mapping instead of direct refrence of interface controller .
For that you need to do context mapping .
1) Add  B into A as used Web dynpro component .
2) Add controller refrence in Component controller using properties of WDC.
3) Map the context element from Interface controller to Component controller
    Set values of context of component controller which will set values for context 
    of A
4) Only issue here is if you want to refresh values frequently you might need to create and destroy component each time . Not sure about it . In my case I m intitalising all context of B in  init of A itself.
Regards
Srushti

Similar Messages

  • Web dynpro Interface context mapping

    Hi All.
    I shall tell my problem with a very simple scenario that anybody could implement in 2 min.
    Webdynpro Interface component -> Z_INTER; context node: ORDER_VALUES, cardinality 0..n; table: VBAK, select VBELN.
    That's it.
    Now, Webdynpro component : Z_COMP -> Used component -> Z_INTER.
    Inside component controller, I declare usage of Z_INTER. Then do a direct mapping of ORDER_VALUES from Z_INTER to Z_COMP.
    So the context node ORDER_VALUES is created in the Z_COMP component controller.
    That's it.
    Inside WDDOINIT() method of comp controller, read the context node's attribute VBELN.
    The line:
    elem_order_values = node_order_values->get_element( ).
    gives a dump saying that:
    The following error text was processed in the system : Error when Creating Component Z_INTER. Z_INTER Is a Component Interface, Therefore, an Instance Cannot Be Created. Name of Component May Not Be Specified. (Used Component: Z_COMP, Component Usage: USAGE1)
    Can anybody guide me how do we map interface context? I guess I am not getting the concept and am doing some fundamental mistake.
    Thanks !

    Hi Aishi,
    When you use a component interface, you cannot declare it as a component usage. You need to add it under 'Implemented interfaces' and say 'reimplement'. If you want an interface node mapping between 2 components, then you have to declare a normal component. Specify the node as an 'interface node', which means it is visible to components using this component. And then do the mapping.
    Regards
    Nithya

  • External Context Mapping - Pass data from Child to Parent

    Hello,
    I have the following scenario:
    DCParent Component (contains)
    - DCChildComp1    (used DC)
    - DCChildComp2    (used DC)
    - DCChildComp3    (used DC)
    - DCChildComp4    (used DC)
    What user enters in DCChildComp1 then needs to be made available to DCParent and all other DCChildComp(n) siblings.
    I have looked the posts and blogs in SDN and all of them seem to deal with passing inputField data from Parent to Child. May be I am missing it.
    In my case, I need the data to be passed from DCChildComp1 to DCParent ie Child to Parent. Then from DCParent to other DCChildComps.
    How should I go about
    a. defining the context nodes and Component Interface context nodes in parent vs child vs siblings and
    b. how should I map them externally?
    Step by step instruction would be helpful.
    Thanks in advance,
    SK.

    Thanks for all the help. As I had already seen all the links and blogs you had linked here, I was still confused about how it all came together. Finally, I got it after reading Bertram Ganz's response in this thread [Context Mapping problem;.
    when you map a context in the parent comp to an interface context in the used child component you do not define an external context mapping relation. That's normal context mapping as the data context resides in the child component.
    I have it working now and I am able to push the changes in the child component's context to the parent.
    For those who are interested in how I did it (and those who know a better way to do it
    In the child component DC:
    Map Child's View Context to Child's Controller Context
    Map Child's Controller Context to Child's Interface Controller (make sure the inputEnabled is FALSE - as the child is the data producer and the parent is the data consumer, in my case)
    In the parent DC:
    Add child DC as a Used DC
    Add child Component as a Used Component in the Parent Component
    Add Child's Interface Controller as Required Controller in Parent Component
    Map Child's Interface Controller Context to Parent's Controller Context
    Map Parent's Controller Context to Parent's View Context
    No external mapping required per the thread above. Now, any change in the child component's view is visible in the parent component view.
    Thanks again very much for the help.
    - Siva

  • Dynamic Context Mapping in Web Dynpro ABAP

    Hi Experts,
    How can I create two dynamic Context nodes, one in ViewController and the other in Component Controller and finally create a context mapping between them?
    Regards,
    Johan Kriek.

    Hi Johan,
    I found a method IF_WD_CONTEXT_NODE_INFO~ADD_NEW_MAPPED_CHILD_NODE that seems to be the one that I am looking for.
    I do have same idea but i have been trying to give solution by using above method,unfortunately here my server is down.check the below code. i didnt check this code due to server down.
    DATA: lo_nd_purchase_header TYPE REF TO if_wd_context_node,
          lo_el_purchase_header TYPE REF TO if_wd_context_element,
    ls_purchase_header TYPE wd_this->element_purchase_header,
          lo_node_info type ref to if_wd_context_node_info,
          lo_child_node_info type ref to if_wd_context_node_info,
          MAPPING_INFO type WDR_CONTEXT_MAPPING_INFO.
    * navigate from <CONTEXT> to <PURCHASE_HEADER> via lead selection
      lo_nd_purchase_header = wd_context->get_child_node( name = wd_this->wdctx_purchase_header ).
                  CALL METHOD LO_ND_PURCHSE_HEADER->GET_NODE_INFO
                    RECEIVING
                      NODE_INFO = lo_node_info.
           MAPPING_INFO-controller = 'ZWDC_ALV'. "conponent name
           MAPPING_INFO-path = 'PURCHASE_HEADER'. "Controller context node name
          CALL METHOD LO_NODE_INFO->ADD_NEW_MAPPED_CHILD_NODE
            EXPORTING
              CHILD_NAME      = 'PURCHASE_HEADER'
              MAPPING_INFO    =  MAPPING_INFO
    *          IS_STATIC       = ABAP_TRUE
            RECEIVING
              CHILD_NODE_INFO = lo_child_node_info

  • Context from Web-Dynpro-Component-Interface & Customer Extention Fields

    Hello all,
    A main component uses a Web-Dynpro-Component-Interface and defines an external maping to it. Web-Dynpro-Component-Interface has a context and a window. At runtime implementaion of Web-Dynpro-Component-Interface is provided.
    All works fine, but how can i create an implementation with view which contains customer extention fields? Unfortunately only fields from context of Web-Dynpro-Component-Interface are visible. I can not even extend the context of Web-Dynpro-Component-Interface via enchancement framework.
    I assume, it is possible with dynamic programming, but why is it not possible in declarative way?
    thanks
    regards
    Paul

    Hello,
    I found this documentation:
    Implementation of Interfaces for Customer Developments
    Using interfaces in a Web Dynpro component benefits customers by giving them a clean basis for their own further developments. When creating a local development, you can implement a used interface in a separate component and add your own aspects to an application delivered by SAP.
    http://help.sap.com/saphelp_nw70/helpdata/en/a9/19eebc1e2943dbb2d443095d017ae9/content.htm.
    I think it must be a correct way to extend SAP programms with customer fields. Please reply, issue is very important.
    Regards
    Paul

  • Dynamic reverse context mapping

    hi,
    can someone explain me how to use dynamic reverse context mapping in my web dynpro application?
    I have read in other sdn-threads that in IF_WD_CONTEXT_NODE_INFO the methods ADD_NEW_MAPPED_CHILD_NODE and SET_MAPPING_COMPLETE might be the solution.
    does anyone know where and how to use these methods? please explain me the priciple and which parameters I should use for example CONTEXT_PATH and MAPPED_CONTROLLER with the SET_MAPPING_COMPLETE method.

    Hi Thorsten,
    I don't think you can acheive Dynamic Reverse Context Mapping using the above mentioned methods.
    Please find the below scenario in which we can acheive Dynamic Reverse Context Mapping programatically.
    The situation is, with in my WD component I created a context in the component controller dynamically or statically. Now I want to map this node to another node of a comonent at run time.
    Here my WD component is the parent component and I am using a child component say SALV_WD_TABLE, which has a context DATA. Inorder to populate data in the ALV the DATA node must be supplied with the necessary contents either at run time or at design time.
    The run tiime mapping is as follows.
    DATA : lo_componentusage TYPW REF TO if_wd_component_usage,
               lo_interfacecontroller TYPE REF TO  IWCI_SALV_WD_TABLE.
    lo_componentusage = wd_this->wd_cpuse_ref_salv( ).
    if lo_componentusage ->HAS_ACTIVE_COMPONENT( ) is INITIAL.
           CALL METHOD LO_COMPONENTUSAGE->CREATE_COMPONENT
    endif.
    lo_interfacecontroller =   wd_this->wd_cpifc_ref_salv( ).
    CALL METHOD lo_interfacecontroller ->SET_DATA
    EXPORTING
        R_NODE_DATA       = lo_nd_flight_salv .
    lo_nd_flight_salv is a reference to the node in your WD component which contains the data to be displayed.
    Hope I could give you a clue...
    Cheers,
    Sankar

  • CE: Mapping from Component-Controller to Component-Interface

    Hi experts,
    how can I map the context of a component controller to the component interface? There is a predefined data link between them but I do not find any possibility to edit this link.
    Thank you for each hint,
    Christoph

    Hi,
    Copy the context node from the component controller and paste it to the interface controller.
    Regards
    Ayyapparaj

  • Context binding between different components using component interface cont

    Please tell me the procedure how to do context mapping between different components ......
    Please post the procedure ASAP.

    Hi Koti,
               Check this
    <a href="/people/bertram.ganz/blog/2007/01/19/new-web-dynpro-java-tutorial--component-interface-definitions-in-practice:///people/bertram.ganz/blog/2007/01/19/new-web-dynpro-java-tutorial--component-interface-definitions-in-practice
    <a href="https://www.sdn.sap.com/irj/sdn/wiki?path=/display/wdjava/usecomponentsinbiggerWebDynproprojects%28componentization%29&">https://www.sdn.sap.com/irj/sdn/wiki?path=/display/wdjava/usecomponentsinbiggerWebDynproprojects%28componentization%29&</a>
    regards
    Sumit

  • Direct Context Mapping of an interface controller

    Hi all,
        I want get 2 or 3 context attributes from an interface controller of another component. I can see the attributes that I want in the interface controller of the other component. I've been reading SAP documents and other posts and everything is concepts. How can I access those attributes to get the data. I've been reading and it sounds like you can do direct context mapping and external. I'm pretty sure what I need is the direct context mapping. The other component is an SAP component (LO_OIF_MAIN_COMP) and I can not make any interface methods of the component controller. So the only way that I can figure is to either call/make reference to the interface controller and get the attributes... but I can not figure out how to do it. Please help. I've been researching this for several hours now... and in my mind it seems like a pretty concept. Thanks.

    Hi,
    I guess this seems to be WD compoent usage. you can use the steps mentioned in any article for e.g. WD ALV component usage and find out how the context mapping is done.
    refer , http://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/3439404a-0801-0010-dda5-8c14514d690d?overridelayout=true
    Thanks,
    Chandra

  • Doing external context mapping *Dynamically*

    Dear All,
    Can anybody tell me how to do do external context mapping dynamically?
    I have literally read thousands of documents/ blogs/ forum posts on external mapping. but not a single one is explaining DYNAMIC part of it properly.
    If anybody has worked on this then please share your experiences with me.
    Awaiting for helpful replies.
    Thanks and regards,
    Amey Mogare

    Hi
    Check out this
    http://help.sap.com/saphelp_nw2004s/helpdata/EN/67/cc744176cb127de10000000a155106/frameset.htm
    Thanks

  • Mapping from component controller context and view context

    Hi to all experts.
    im trying to create my first webdynpro . Im stuck up here please help me .... How to map the node from component controller context and view context i have searched the forum....got the answers as Drag and Drop...But it is not working ....

    Hi
    Check out this links and check saptechnical site
    WDA in SAP Help
    http://help.sap.com/saphelp_nw2004s/helpdata/en/7c/3545415ea6f523e10000000a155106/frameset.htm
    Web Dynpro for ABAP in SDN
    https://www.sdn.sap.com/irj/sdn/developerareas/webdynpro?rid=/webcontent/uuid/512040e1-0901-0010-769c-c238c6ca35d9 [original link is broken]
    Developing ABAP Applications Using Web Dynpro
    http://help.sap.com/saphelp_nw2004s/helpdata/en/42/d41b25d2216babe10000000a1553f6/frameset.htm
    Web Dynpro ABAP: Development in Detail
    http://help.sap.com/saphelp_nw2004s/helpdata/en/03/0048413e466e24e10000000a155106/frameset.htm
    WDA Sample programs & tutorials
    https://www.sdn.sap.com/irj/sdn/developerareas/webdynpro?rid=/library/uuid/49f2ea90-0201-0010-ce8e-de18b94aee2d
    Web Dynpro ABAP Demonstration Videos
    /people/thomas.jung/blog/2006/06/20/web-dynpro-abap-demonstration-videos
    Web Dynpro ABAP Wiki's
    https://www.sdn.sap.com/irj/scn/wiki?path=/display/wdabap/main&
    New to Webdynpro
    Thanks,
    Tulasi Palnati

  • External Comp. Context - mapping not completed

    Dear SDN,
    I have been trying ALL the ways to link Interface Contexts between 2 components.
    But nothing has worked.
    The error is always the same: "The Mapping to Node COMPONENTCONTROLLER.1.CASE_LIST Has Not Been Completed"
    Does anyone have any idea about what can be the problem here?
    There is some dynamic programming in the components. Is this the problem? (once I heard it could be).
    I have already read ALL the threads about
    . mapping in the Component Usage,
    . Comp. A and Comp. B...
    . 'Input-Element (ext.)' checkbox,
    . etc.. etc..
    I have tried all the proposals.
    But nothing worked for me.
    Please, can anybody give me any piece of suggestion?
    I will be grateful for any attempt of helping!
    Thank you all.

    hi fabio,
    please check the url for component usage.
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/2e71ce83-0b01-0010-11a4-98c28a33195f
    it is not required to set in and out plugs,
    suppose you have two component A and B, and you want to use/call component B from component A.
    just click on component A, and in used component tab enter name of component B. when you save it comes in component usage in left side.
    now if you want to pass some value from A to B, then create same node in both the component, and in component B, set node property to interface node and input.
    in component A, after adding comp B in used component, it start displaying it in compo A. now create external binding of that node , as we do in ALV, and you are able you use and call component B in component A,
    furthermore, you can call interface methods from comp B in comp A.
    if you need some Example please tell.
    Yogesh

  • Problem with context mapping and data flow in a FPM application

    Hi All,
    I am trying to develop an ESS application using FPM. For the same, the requirement is to see the history of an employee in the second view.
    The first view has got just the overview information and the second one has got the detail. So, the records or the fields are the same on both the views.
    As per the FPM guidelines, the Model is residing in the Fc component and the respective Vc components are using the model data accordingly.
    I am executing the model in the Fc component calling the executable method in the interfaceController of the first view and then trying to display the output data of the BAPI in the first view which provides the overview information.This is working fine.
    But when i am trying to map the same output node to the Table UI for the second view, the record size is coming zero and thus no information is available.
    For the above issue, I am again executing the RFC in the InterfaceController of the second view to populate the records, which is incorrect as it is already executed and the data is available for the first view.
    I request you to let me know the correct approach to Context mapping and data flow when using FPM-roadmap. Is their any standard method or approach available to deal with such requirements? Please let me know.
    Thanks in advance.
    Regards
    DK

    Hi Idhaya,
    I model node is available in Fc and the Fc interface controller is being used in the first Vc and the second Vc.
    So the idea is, as the executable method is generated in the Fc, so i have created a custom method to call the executable method in Fc, where the input parameter is getting passed and this custom method is finally getting called is the first Vc.
    So , now my first Vc is ready to call the custom method in Fc and execute the RFC. Once the RFC is executed, the nodes in the Fc should get populated which is the ideal case.
    And as the Fc is used as a component in the second Vc, the same node is available to the UI elements.
    But, when I check the record size for the output node, it is always zero, for the second Vc.
    Regards
    DK

  • Need Help in Context Mapping

    Hi,
    I am having two components.
    Comp A  is main componenet  and Comp B is Used component and using in Comp A.
    Intially I am getting the data from the Comp A ( main Comp) to Comp B(used Comp) by context mapping.
    it is working fine.
    The same way I need in Reverse. From Comp B (Used Comp) to Comp A (Main Comp) i have to get the data .
    how to do context mapping for this.
    pl help.
    Thanks in Advance.
    Kar

    Hi,
    To achieve reverse (external) context mapping, the attribute 'Input Element' in interface node of component B has to be marked. When you declare a component usage of component B in your component A, you will see the interface node under Component Usages->Interface Controllers (in your navigation tree). You can define the mapping here, between the 'Input element' node of component B and the component controller Node in comp A by right click->Define external context mapping.
    Have a look at the [documentation |http://help.sap.com/saphelp_nw04s/helpdata/en/67/cc744176cb127de10000000a155106/frameset.htm] in detail.
    You can have a look at the ALV component SALV_WD_TABLE, which uses external context mapping to render the ALV in any component using this component. This will give you a good idea.
    Regards,
    Nithya

  • Context mapping problem in FPM

    Hi all,
    here is a samll example where i am going to display the Attributes from the SELECT perspective to the REVIEW perspective. where the Values from the SELECT View is To be Displayed in the Review view.
    my Compnents are like..
    cctest
    FcTest
    Vcfirst
    VcNext
    VcNavi
    everything is working fine i am able to get RoadMap.
    i have done mapping b/w the components as...
    |ComponentController| -- | interFace Controller
    CcTest -
    FcTest -
    FcTest IC
    Vcfirst FcNavigation IC,FctestIC Vcfirst IC
    VcNext FcNavigation IC,FctestIC VcNext IC
    VcNavi -
    FcNavi
    i have one attribute in VcFirst Perspective ... i am not able to get that value in the VcNext perspective ...

    Hallo Bunny,
    are you sure that both of your visual UI components VcNext and VcNavi point to the same instance of faceless component FcNavigation at runtime?
    Read more on the reason in this forum thread: Re: Why Context Mapping is always null for my embeded view?
    Regards, Bertram

Maybe you are looking for