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
Similar Messages
-
Dynamic webdynpro context mapping in GP
Hi Experts,
I have created a webdynpro coponent which contains a Dynamic node as a Gp context Output parameter.
This Dynamic node is mapped to another WD callable object's GP context input parameter.
Will i be able to transfer data using this dynamic node between these two WD callble objects?
Regards,
Ashish ShahHi Shanto,
This is how i plan to use these dynamic nodes
i have total 4 WD callable objects
1) A - Data capture Component
2) B- Request Component
3) C- Approver determination Component
4) D- Approver Action component
Requester enters data in component A in a static node N1, passing data to dynamic node DN1
Data input node in component B will be a dynamic node DN2 which will be mapped to node DN1
Component C will have a Dynamic node DN3 getting data from DN2
Component D will have a Dynamic node DN4 mapped to node DN3 , from DN4 data will be mapped to static node N2 and will be utilized further.
Not sure whether my plan will be able to utilize these dynamic node to its fullest or not.
May be you can help me analyze it better.
Regards,
Ashish -
Hi,
I have 2 components used in parent component. I want the context of 1 component to reflect in the other component. I mapped the context of the parent to the interface controller of Child 1. i want to map it to the child2 also. how can i do it?
Regards
JaichandharJaichandhar,
First, create 2 nodes in Interface Controller of inner components, and mark this nodes as "input element" (set isInputElement property to true). Next, create regular node in component controller of outer component. Then add 2 component usages. Open every usage (interface controller sub-node) and add outer component controller to list of required controllers. Then swithc to context mapping tab and perform mapping.
VS -
Dynamic reverse context node mapping at runtime
Hi!
I have an application which uses another embedded component containing a ALV table which shows the data of a transparent table.
Everything works fine if i'm working with a static table with static attributes and map the context node of the application to the node in the embedded component. The context node in the embedded component is reversed mapped and gets its data from the application's context node.
Now i want to do it dynamically. Inside the application the user should choose the name of a table and I'm using RTTI functions to get it's technical informations. At runtime i'm adding dynamically attributes (i.e. fieldname, type, length) to a static context node called 'DATA'.
The ALV component of the embedded component is mapped to an interface context node named 'DATA' which uses reverse mapping to receive data from the applications context node 'DATA'.
What I need to know is how to create the mapping between application context node and interface context node of the embedded component at runtime after i have created the attributes of the node dynamically. Is that basically possible?
I've already tried to map the both nodes statically to see if the dynamically created attributes are mapped automatically then. The mapping seems to be fine at node level, but doesn't work for the later dynamically added attributes.
Could someone point me to informations if dynamic mapping context nodes is basically possible and how to do it?
Regards
Ralf-J.Hi Lars!
Thanks for the link! The problem isn't to fill the context node dynamically. That's already working using RTTI etc.
It seems to me that the interface context node of the ALV in the embedded component doesn't recognize the dynamically added attributes. As i wrote the binding on node level (DATA->DATA), which i'm doing at design time, is working as expected, but the added attributes are only shown in the context node of the using component but not in the embedded.
I'm still thinking there must be a way to do a binding at runtime. On the other hand the comment of Glenn in the thread you've pointed me to, seems to suggest that the ALV itself might have problems with dynamically appended attributes.
Regards
Ralf-J. -
Example : Direct & Reverse Context Mapping
Dear Experts,
Could you please provide me with an example highlighting the exact difference between the mapping types specified in the subject line?
Cheers!
Deb
Edited by: Deb2009 on Dec 3, 2010 12:36 PMHallo Deb,
Real time example is that when you have component controller and context node.
When you bind this context node to your views and interface then it is called direct context binding.
I think you mean External binding as reverse binding.
ALV is one of the best example using this external Binding.
When you use alv in wendynpro as used components , you do a external binding
DATA node of the ALV is bind to the component context node.
Design time alv is build with a idea that it does not have to know who is going to be its data provider. That is the strength of the external binding. -
External context mapping with CID
I have a component interface definition CID_A and a Main-Component M.
At runtime one child component of CID_A should get an input in its view and put this value in the context of M. so I need external (reverse) context mapping.
the component of CID_A determines the attribut in the (global) context of M.
but how can I declare this attribut as externally mappable? the option "isInput-element" is not available in the interface controller of cid_a and in the components which implement cid_a it is deactivated and grayed out.
what can I do to realise external mapping from the implementing component of cid_a to the mothercomponent M?>So you have one interface component IF_C which has the external input node and >several components which implement IF_C which should be filled thru external mapping >thru component M, rite?
my scenario:
IF_A has two cid-implementating components a1 and a2 which are chosen at runtime.
a1 or a2 should fill the context of the main-component M via external context mapping. M should hold the global context and share the attribute (from the external mapping of IF_A) to other CID´s (let´s call them IF_B - IF_C). Another IF_L handels the layout from all components.
I think I did it that way from the following seven steps from your link but I will look tomorrow at work:
"1. Define the interface component with context node (Input Element Externl)
2. Create a component which defines a usage to the interface component
3. Go to the component usages folder and open it.
4. Right click on the usage you just created and choose Create controller
usage.
5. Double click the interfacecontroller_usage you just created.
6. Here you can add a controller usage using the button at the top.
7. Now you should be able to define the external mapping by dragging the node of
the component controller to the interfacecontroller_usage node."
it´s a litte bit difficult in my scenario because the at runtime chosen components from IF A-C are shown in a window in M (handelt from if_L) and the attribut which I want to use for external mapping is bound to a input field in the view from the components a1 and a2. the input to that field should modify the output in the views from the components from IF_B and IF_C. could this be the fault? that I bound the attribut for external mapping in designtime to an ui-element? I realised this so far only at a1 and when I chose a2 (without that bound ui-element) testing my component works without faults.
thanks and until tomorrow... -
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 -
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 MogareHi
Check out this
http://help.sap.com/saphelp_nw2004s/helpdata/EN/67/cc744176cb127de10000000a155106/frameset.htm
Thanks -
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,
StefanoHi
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 -
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.
KarHi,
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 -
Difference Between Normal and External Context Mapping
Hi,
I wonder the Difference Between Normal and External Context Mapping.
I1ve already read the docs and articles but I didnt understand.
Thanks,
Jorge Luiz
Edited by: Jorge Castro on Oct 9, 2008 4:23 PMJorge,
With this type of Mapping (also called Reverse Mapping) you can map the context of an using component, to that of the used component.
You can find an example of this concept in WDA ALV: If you look at component SALV_WD_TABLE (which you declare as used when you intend to use ALV), you'll see that it has a node DATA declared as external. In your using component, you map your actual data node to this node.
This allows the ALV to leave the DATA node type open and so to be reused, adjusting it's structure depending on the using component's data.
Edited by: Alejandro Bindi on Oct 9, 2008 4:42 PM
Made a mistake! Have not used this in a while...Ext. mapping is the OTHER way...Using -map-> Used Fixed. -
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
DKHi 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 -
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
SudipHi 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.
SriHi 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
Maybe you are looking for
-
Hi all, I have a table, Standard_Products, and i want to show an image in my report along with some other data. I am using file browser to import the images at the moment. Please advise what to do - at the moment the column is showing "Datatype" inst
-
An app has disappeared from my screen yet when I try to reinstall it, it shows as already installed and won't allow me to install the app again.
-
Latest Firmware for WRT300N V1.0
I have WRT300N V1.0 with Firmware v1.03.6. Anybody know what is latest Firmware for WRT300N V1.0 and where I can get it. I tried at Downloads under Support in Cisco website but it said "No firmware/driver download available". Thanks
-
Hey! something you may not know .....
a Laptop Battery is portable and can run on batteries alone. Nickel-Cadmium (NiCad) batteries were the first type of battery commonly used in laptop computers, and older laptops sometimes still use them. They have a life of roughly two hours between
-
HDMI on Macbook Pro Retina/iPad 3rd Gen/iPhone 4s looks not HD
When i connect my macbook pro retina or ipad/iphone to my HDTV via HDMI, it doesn't like it is in full HD. What could be the reason?