Reg: Context mapping.

Hi All,
When we do mapping of value nodes ,there in properties we have a property called
mapping type. It has 3 options 1) collection and selection  2) collection only 3)not applicable .
what is this property?
Thanks in advance.

Hi
go through links
<a href="http://help.sap.com/saphelp_nw2004s/helpdata/en/44/a2384162316532e10000000a1550b0/content.htm">http://help.sap.com/saphelp_nw2004s/helpdata/en/44/a2384162316532e10000000a1550b0/content.htm</a><a href="http://help.sap.com/saphelp_nw2004s/helpdata/en/f1/94384162316532e10000000a1550b0/content.htm">http://help.sap.com/saphelp_nw2004s/helpdata/en/f1/94384162316532e10000000a1550b0/content.htm</a>
thanks smitha

Similar Messages

  • 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

  • Error in external context mapping

    Hi
    I want to send some data to a used web dynpro DC from the embedding DC. I tried using external context mapping by performing the below steps.
    created a value node and attribute at interface controller of the used DC
    set isInitial property to true for the value node in interface controller
    created context node and attribute with same name inside component controller of the embedding DC
    defined mapping between the nodes and attributes; which looks like
    UsedComponentInterface----
    >EmbeddingComponentController
    At run time I can't find any value inside the node in used DC. The used DC interface controller node is not getting populated with data from the embedding DC component controller node value.
    Can any one let me know the exact appraoch for this and where I did mistake in the above steps?
    Thanks in advance
    Cheers
    Sudip

    Hi Sudip,
        First make sure in your used DC interface controller context for the nodes that you need to populate data the inputElement property is set to true. The inputElement property for a node and attribute means that the data for those nodes are going to come from and external source. Nodes where the inputElement is set to true will not be initialized even if the cardianaliy is 1:1 or 1:n. The data instance has to come from an external source.
    Make sure that you create a public part for your used DC and add the component to the public part.
       If the input element property is set correctly in the interface controller of the used DC make sure that the data mapping between the interface controller of the used DC and you component/custom controller is correct. The data mapping arrow should point from your used DC interface to your component/custom controller. You can see this in your data modeler. Once you create the data link the mapping window will clearly say that this is an external mapping and only inputElements can be dragged.
    Once all the above are done if you add data instances to the external mapped node in your controller it will be available in your used DC context also.
    Hope this helps,
    Sanyev

  • Context Mapping and data binding

    Hi,
    Please explain about the context mapping and data dinding
    and also differences
    Thank's & Regard's.
    Sri

    Hi Sridevi Sudunaguntla ,
    context mapping-> means mapping between different contexts
    ie suppose if we are creating a node in the component controllet and if we want to use that node in view a and view b, then  we have to map this node from component controller to the required view.. this mapping of context nodes is called context mapping..for context mapping, create nodes in compcontroller.. tehn go to view-> context-> tehn drag and drop required node from component controller to the view ..
    data binding-> means binding the data from nopde to the ui elements or viceversa... after the nodes are created in indudual views or after context mapping.. we have to bind these nodes to the ui elements... suppose we have an input field and we want to read that,, so we have to bind the input field to an attribute in the node.. this binding is called.. data binding.
    Regards
    Sarath

  • Problems with external context mapping

    Hi ,
    I am having the following problems with external context mapping from one WD component to another.
    Problem description:
    In the <i>Component Interfaces</i> I have defined a WD interface "InfA".
    In the <i>interface controller</i> of this compoenent,I have ContextA and attributeA(cardinality 1..1).The contextA is marked as an "Input Element".
    Now my webdynpro componentB adds InfA as used component.In componentB I decalre a contextB with attributeB and map it to contextA to set up the external context mapping.
    Now I expect that if any webdynpro component implements this WD interface InfA ,he has access to contextA with the data getting filled from contextB.
    After i have created the component for the used component I try to fill values in the source node contextB thru this code:
    wdContext.currentContextB.setB(value);
    But in the runtime I keep getting error nullPointerException for nodeContextB,suggesting that the mapping has not been completed.
    Can anyone suggest due to what the error can come ,and, if its a webdynpro bug ,is there a workaround??
    Thanks in advance for your help.
    Best regards
    Sourav

    HI,
    Valery : I personally checked  by doing the example, if the names of value attribute are different in the child's interface and parents component controller then it throws the exception.
    Sourav: NullPointer Exception is thrown when something is not properly initialised, if in the main component the cardinality of mapped origin is 1.1 then you need to access it element directly like:
    wdContext.currentParentNodeElement().setFname("Abhijeet");
        wdContext.currentParentNodeElement().setLname("M");
    i will suggest just check out if you are declaring some element of value node and without initialising taking its use or what?
    if this doesnt solve your problem, please post the expanded exception.
    hope it helps
    let me know if you face nay problem
    regards

  • Context mapping vs. Java beans

    Hi,
    I'm making a "Server" Component (Java Web Dynpro) that exposes a view to other "Client" Components (other Java Web DynPros). The Clients can insert the exposed view into their views to use the Server's services.
    The Server, obviously, has to be initialized with specific data from the Client.
    At first I thought of creating a context node in the Server, structured with all the attributes needed for its configuration, and then expose that node in the interface. In this way the Client creates a local copy of that node via node mapping and then populates its attributes with values. Once the client populates it in its wdDoInit() method, the embedded view's wdDoInit() method is called and the Server's View can initialize itself.
    Now, instead, I was considering using Java Beans (a class that wraps all the data that I've currently put in the context) because:
    1- The Client should not be able to alter the Server's configuration once it has been initialized. With context mapping the Client can alter at runtime the configuration node's content.
    2- The Server configuration has to be shared between multiple Server's views. When passing a configuration NodeElement as argument to methods shared between views, I've always the problem that I have to deal with the type of the NodeElement (the public interface of the component controller, the private interfaces of the views).
    What is the right way to do things in this scenario?
    Thanks to anyone who drops an answer,
    See you,
    Pietro
    PS. If it's unclear, let me know!

    You can implement some inteface at server,
    declare usage of this interface at client.
    then,
    you can initalise server component by getting that interface from server component,
    and calling methods with desired objects as arguments.
    other methods of this interface can be used to return server's configuration,
    so it will be shared.

  • Context Mapping in web dynpro

    Hi,
    Steps which I underwent for context mapping is:
    1. Opened view designer for start view .
    2. Choose the context tab.
    3. Opened the context menu for the root node context n choosed the option New->Value attribute.
    4. entered the name for the attribute such as name n choosed finish.
    5. From the context menu for the attribute Name choose Edit Context Mapping.
    Problem is in my case "edit context mapping" is disable.
    Regards

    Hi
    u have to add the Component Controller In the required Controllers List of the view
    thwn u fill find the it enabled.
    Suppose u want to map the value Attribute in the view to that of the Attribte in the Component Controller then add that ComponentContolle Name in the required Controllers of the view
    ur Component controler shuld also have the Value Attribute of same data type.
    u can go properties of the View there u have required Controllers and Add Button click on that and add ur controller Name

  • Web dynpro welcome example edit context mapping problem

    hi,
    i tried to build a web dynpro like the welcome example from web dynpro.
    so i created the views etc, created an atrribute matnr  in the context of the component.
    then i connected the other views with the component. for this i used the required controllers.
    so, now i created a attribute nr in the context of the other view and wanted to connect it with matnr from beginning with edit context mapping.
    but in the shown context is not the attribute matnr. there is no attribute.
    any idea what went wrong or is there something that i missed?
    thank you

    Hi Marcus,
    Do one thing Create Value Attribute under Context like(matnr). Next Right Click on Webdynpro Component Click on Open Data Modular that time it will open data modular View. Here we are doing Context Mapping to Component Controller to View Controller that time Same Value Attribute will be created in View Controller also.
    In context mapping, the actual context data is saved only once in the original node. All other context nodes that are mapped to this original node reference the same contents, without having to save it again, for example using copies. In this way, inconsistent context contents are avoided.
    Please look at this simple WDJ Application. http://help.sap.com/saphelp_nw04/helpdata/en/bc/e4d61774174344a4b126ad07e8c230/content.htm
    I hope this is help full for you,
    Regards
    Vijay

  • External context mapping problem

    Hi,
    I am trying to create a sample application for external context mapping
    1. I created a webdynpro project.
    2. In that project i created  2 web dynpro components PrComp and ChComp. 
    3. In the ChComp Interface controller context created a node MappedNode with attribute text.The node property isInputElement is set to true and also the carinality to 0..1
    4. Added the ChComp as Used Component for PrComp.
    5. Mapped the context of the ChComp Interface controller to ChComp Component controller and PrComp component Controller.
    6. In the ChComp Component controller, i initialize the node atribute text with some value.
    public void wdDoInit()
        //@@begin wdDoInit()
         wdContext.currentMappednodeElement().setMappedText("Mapped Attribute");
        //@@end
    7. In the PrComp component controller i create the ChComp and try to retrieve the value of the node attribute text.
           public void wdDoInit()
        //@@begin wdDoInit()
         wdThis.wdGetChildCompComponentUsage().createComponent();
         String text = wdContext.currentMappednodeElement().getMappedText();
         wdComponentAPI.getMessageManager().reportSuccess("mapped value "+text);
        //@@end
    When i deploy and run the application i get the following error
    java.lang.NullPointerException
        at com.sap.tc.ram.sample.external.context.mapping.ChComp.wdDoInit(ChComp.java:98)
    I am creating this app as a sample for external context mapping.please tell me if i am doing the rigth thing.

    Shiram,
    Your code will not work until you remove any node access from wdDoInit in ChComp (step 6).
    Think about the actual execution sequence:
    1. PrComp creates usage of child (ChComp) via createComponent
    2. ChComp get initialized internally by WD framework, as part of process ChComp.wdDoInit is invoked
    3. Context mapping is applied parent(source) <->child(target)
    So step [2] happens always before [3], you didn't alter this behavior via cardinality as suggested by other readers.
    What you can to do?
    1. Do not use wdDoInit of ChComp to populate / access data. Populate data from PrComp instead.
    2. Do you really need isInputElement? Think about it. If you remove isInputElement setting in child, then create mapped node in parent, then node in child will be source of data and you may safely populate it ChComp.wdDoInit.
    And, as other pointed out, cardinality still can cause error -- you are using 0..* but not creating element manually. Either set cardinality to 1..* or create element in wdDoInit of "source" controller (PrComp for [1], ChComp for [2])
    Valery Silaev
    SaM Solutions
    http://www.sam-solutions.net

  • 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

  • Problem with CrossComponent Context Mapping with PopupWindow (web dynpro ab

    The situation:
    I have four views (View V1, V2, V2_popup, V3) in three Components C1, C2,C3.
    View V1 is embeded in Component C1. View V2 is embeded in C2 with view V2_popup as Popup-Window.
    View V3 is embeded in Component-C3. And at last the View of Component C2 and C3 are embeded in View V1.
    The Problem is the CrossOver Context Mapping between the view V2 and V3.
    My first way is the "direct context mapping":
    I define a node in the ComponenteControllen from Component-C2 as interface and use it over the ComponentenController
    from Component-C3 in view-V3. Now I bind an attribute of the mapped node to an ui-element (e.g: inputfield),
    but the output of the Field is empty.
    The second way is, that I define an external Mapping for this situtation.
    I define a node in the componente-controllen from Component-C2 (an Component-C3)as interface with the attribute "Input Element (Ext)".
    Than I map the two nodes with a node from Component-C1. That's works fine.
    BUT, if I execute an action (e.g. action_save)in the popup for view-v2 (V2_popup) the changings from the inputfields don't write (show)in the context of the
    popup-view. I check this with the debugger. And if I close the popup and open it again, the changings are visible.
    Short: If I define a node with attribute "Input Element (Ext)", I don't can read changings from
    the screen in a popup-window.
    How I can solve this problem???
    Message was edited by:
            Maik Sturm

    Hi Maik,
    try this:
    at first you have to instantiate all! used components in the wddoinit method of the componentcontroller in your main (c1) component.
    e.g. instance of c2 Component
      lr_usage_c2_comp =   wd_this->wd_cpuse_c2_comp( ).
      IF lr_usage_c2_comp->has_active_component( ) IS INITIAL.
        lr_usage_c2_comp->create_component( ).
      ENDIF.
    and at the end set the reference:
      l_ref_interfacecontroller =  wd_this->wd_cpifc_c3_comp( ).
      l_ref_interfacecontroller->set_usage(
        ir_usage_c2_comp = lr_usage_c2_comp ).
    set_usage is a method in the c3 component controller,
    METHOD set_usage .
      DATA: lr_usage TYPE REF TO if_wd_component_usage.
      lr_usage = wd_this->wd_cpuse_c2_comp( ).
      lr_usage->enter_referencing_mode( ir_usage_c2_comp ).
    After doing this the components are using the same instance and you can simply use direct mapping between the components.
    Hope it helps.
    regards
    Christian

  • Context Mapping: child-nodes of non-mapped parent nodes

    I am somewhat curious about Context Mapping in WebDynpro.
    Which parents nodes need to be mapped in order to map child nodes ? Does a child node has more than one parent node (e.g. grandparent - two steps above) ?
    A.1  -
    MAPPED----
    >    B.1
      - A1.1   NOT MAPPED
      - A1.2   NOT MAPPED
            - A.1.2.1     MAPPED TO>    B.1.2.4
            - A.1.2.2   NOT MAPPED
      - A1.3   NOT MAPPED
    Is it sufficient that only one of these parent nodes (e.g. direct parent node not mapped, but parent node of this parent node is mapped) need to be mapped so that the child node can be mapped ?
    Is this assumption true or not ?
    The SAP library states:
    "Conversely, child nodes of non-mapped parent nodes cannot be mapped, otherwise this would result in irresolvable conflicts at runtime with respect to the parent-child relation in the context and the mapping relation." (http://help.sap.com/saphelp_nw04/helpdata/de/51/a3384162316532e10000000a1550b0/content.htm)
    This statement is not absolutely clear on this issue.

    Let me put it this way
    You have a node vehicle and you have a child node for that the car. The car node have parameters car1, car2.
    Let the vehicle node have parameters veh1 and veh2
    Then if you map vehicle node one to any other node (say in the comp. controller) you have the option of mapping its children i.e veh1,veh2 and carnode.
    You can have that veh1 is mapped and veh2 is not mapped.
    vehicle node(mapped)
    veh1(may or may not be mapped)
    veh2(may or may not be mapped)
    car node(may or may not be mapped)
    If instead you try to map only the car node the vehicle node will also get mapped automatically but not it's child parameters like veh1 and veh2.
    vehicle node(mapped)
    veh1(may or may not be mapped)
    veh2(may or may not be mapped)
    car nodemapped)
    car1(may or may not be mapped)
    car2(may or may not be mapped)
    Hope this would help.
    Do revert for further clarification
    Regards
    Noufal

  • Context Mapping for Non-Singleton Node

    Hi ,
    I have following context structure
    Node_A
    |     attr 1
    |________ Node_B
                                  attr2
                                  attr3
    Node_B is the child of Node_A.  NOde_B has attributes attr2 and attr3.
    Node_B is a Non SIngleton Node.
    Node_B is mapped to Node_View of the View Controller.
    Node_A had 2 elements. Initially Element 1 is the Lead selection Element for Node A. I get the reference for Node_B using the Lead Selection Path
    NodeA_element1 = Node_A->GET_ELEMENT( ). 
    Node_B = NodeA_element1->GET_CHILD_NODE( 'NODE_B' ).
    Node_B is filled with elements, lets say attr2 = 'Dallas', attr3 = 'Detroit'
    Node_View shows the values Dallas and Detrait since its mapped to Node_B
    Now the Lead selection of Node_A changes to 2.
    I again gett he reference for NOde_B usign the Lead Selection Path (index 2)
    NodeA_element2 = Node_A->GET_ELEMENT( ). 
    Node_B = NodeA_element2->GET_CHILD_NODE( 'NODE_B' ).
    Node_B is now filled with, lets say attr2 = 'Mexico', attr3 = 'Canada'
    Since element 2 is Lead selection for Node A, now, and NodeB is mapped to Node_View, I expect the contents of Node_View to be attr2 = 'Mexico', attr3 = 'Canada' since this is along the Lead Selection of Node_A
    But it stays attr2 = 'Dallas', attr3 = 'Detroit'
    So in a nut shell,  the Context Mapping of the Non Singleton Node  DOES NOT map the Lead selection Path when its parent  , changes in Lead Selection.
    Is this a BUG ?
    Thanks

    Hi Anand,
    There is no bug. See when you are saying
    "Node_B is now filled with, lets say attr2 = 'Mexico', attr3 = 'Canada' "
    I am just not sure how you have filled the data in node B. Because the way u populate node data that way only you can get the data. The way you want to get data you must populate data in this way:
    1. Get Node A instance let say in lv_node_A.
    2. Get Node A element instance (lead selection) in your case lets say in lv_elem_A.
    3. Now get node B instance by lv_elem_A->get_child_node( 'B' ) lets say in lv_node_B.
    4. Create element of lv_node_B and bind it to the node B and also populate the value of attributes.
    Repeat the steps as per your requirement. Also Singleton and Non singleton has nothing to do with this it is all about how the instances will be manged in the memory.
    Look at this sample code and will help you while populating data in nested nodes:
        DATA lo_nd_a TYPE REF TO if_wd_context_node.
        DATA lo_el_a TYPE REF TO if_wd_context_element.
        DATA lo_nd_b TYPE REF TO if_wd_context_node.
        DATA lo_el_b TYPE REF TO if_wd_context_element.
        DATA ls_a TYPE wd_this->element_a.
        DATA lv_test LIKE ls_a-test.
        data lv_btest type string.
      navigate from <CONTEXT> to <A> via lead selection
        lo_nd_a = wd_context->get_child_node( name = wd_this->wdctx_a ).
      @TODO handle not set lead selection
        IF lo_nd_a IS INITIAL.
        ENDIF.
        data count type c.
        data count_i type i value 1.
        do 2 times.
          lo_el_a = lo_nd_a->create_element( ).
          lo_el_a->set_attribute(
          EXPORTING
            name =  `TEST`
            value = count_i ).
          lo_nd_a->bind_element( new_item = lo_el_a
                                 SET_INITIAL_ELEMENTS = abap_false ).
          lo_nd_b = lo_el_a->get_child_node( 'B' ).
          lo_el_b = lo_nd_b->create_element( ).
          move count_i to count.
          concatenate count 'in node b' into lv_btest.
          lo_el_b->set_attribute(
          EXPORTING
            name =  `BTEST`
            value = lv_btest ).
          lo_nd_b->bind_element( new_item = lo_el_b
                                 SET_INITIAL_ELEMENTS = abap_false ).
        count_i = count_i + 1.
        enddo.
    This code will set value 1 and 2 in node A's test attribute. and on change of lead selection between 1 and 2 it will show value of attribute BTEST in node B as 1 in node B and 2 in node B...
    Regards,
    Neha

Maybe you are looking for