Mapping Model Nodes
Hi Gurus,
Can anybody tell me , which is the best practise for mapping a structure to view through Component Controller .
1) Setting all the model node values to a Value node on controller level and Map to the view
2) Directly mapping the model node from controller to View .
Please tell me the advantage also ?
Thanks in advance .
Tony Isaac.
Hi Tony,
This looks quite wiered. As far as I think EHP1 should not restrict you to bind any modeled node attribute with the UI element. This is very basic requirement and as I said earlier if the scenario demands then we always bind teh values directly to the UI element.
It makes no sence in first copying the values of the modeled node to the value node and then used the value nodes and finally take the values of the value node, copy them back to modeled node and finally save it. It will definitely hinder the performance. And in scenariois where we have lot of attributes in the structure then in all such cases the performance will be decresed drastically.
Therefore I dont feel that there will be any such restriction on this.
I hope this helps!
Thanks and Regards
Pravesh
Similar Messages
-
Problem in mapping model node with cardinality
Hi,
I have a requirement where the RFC which is being called has cradinality 0..n.
I imported the RFC model in a different DC and then added the model to public part.
Then, I used that model in the second dc.
Now, I did context mapping with the component controlller by dragging the model context to the
component controller. The view is also mapped with the component controller.
The RFC has input field BUS_PART_NO which is a 12 character input field.
I passed String in it.
There is no error while I build the DC. But while I run the application, the input field is coming Read Only.
I can't changed the component controller to 1..n or 1...1.
I think I need to create a context node and attribute in the view or component controller and then programmatically add this
to the model node.
Please send some SDN links and urls.
Regards
Neha SinghHi Neha,
Please create the custom context node/attribute same structure as RFC model node. then populate the data using below following code :
- get the size of the RFC model node which you want to populate in the costom node like
int xxx = wdContext.node<XXX node>().size;
- Create onject for custom node like
I<Custyom Name>Element element = null;
- then use for loop for fetching data from Model node and populate in custom node
for(int i =0; i<xxx; i++)
element = wdContext.create<Custyom Name>();
element.set<Attribute Name>(wdContext.node<XXX>().get<XXX>ElementAt(i).get<>Attribute name for model())
wdContext.<Custyom Name>().addElement(element);
It will populate in your custom node from model node.
Hope it will helps you.
Regards
Arun -
How to set the Model Class for a newly created Model Node ?
Hello All,
I am trying to map a Model node from SourceA to DestinationB.
To do so, I created a model node for Destination B in the interface controller (set the isInputElement to true). However why I try to map the node, I get an error saying that "Both context nodes have to be bound to a model class". Upon a closer look, I realised that the model node that I created in DestinationB has no entries under the properties.
Does anyone knows/advise how I can add the model class entry to the model node that I have created as I am not able to do so. Or otherwise, is there a way to map a model node to another model node across different components ? Thank you very much.
from
Kwok Wei
from
Kwok WeiHello Pascal
The instructioons that you gave are for mapping the model between the view controller and the component controller within the same component is that right ?
I am tryng to map a model node in the component controller of SourceA to another model node that belongs to another Component. I do believe that in this case I will need to create a model node in the interface controller of DestinationB and map that to the component controller of SourceA. However, by creating my own model node, how do I change the property modelClass in the context ?
Thanks !
from
Kwok Wei -
Unable to add value to model node with cardinality 0..n
Hi All,
Im working with Webdynpro Java.i have an issue here.i have a input field item named customer and a drop down box item location.when i give customer and location as inputs,a WSDL (named Equipment WSDL) is called.the result is a drop down list containing equipments id
i took a custom node location with cardinaliy 0..n.i gave static values as input for location.i need to set the location values to model node location.when i m giving a single value to custom node location,that static value is not accepted by model node location(in WSDL) whose cardinality is 0..n.
Please suugest a solution for this issue
With Regards,
Ushasri.HI Ushashri,
What do you mean by 'static value is not accepted by model node location'
how you have done the mapping
send me the hierarchy of rfc and ur value node
With Regards
Naidu -
Mapping one node to many nodes
How do you map one node in a controller context to many other nodes in another controller context?
Here's the situation I'd be using this.
I have an Adaptive RFC model from which I created a Custom Controller. I then used the wizard to map to the model.
The model corresponds to RFC functions and many of those functions accept the same parameters, LanID for instance. I simply want to have one "LanID" node in a controller that I would set. The change would then propagate to the other LanID context nodes in the Custom Controller mapped to the model.
What's the best way to handle this?If I understand correctly.. B1, B2 and B3 are all in the SAME custom controller? Even if they are, I don't see a problem of mapping them all to A1 which is in another controller. Let's say that A1 is the "original" node, and B1, B2 and B3 are the "mapped" nodes.
If you require that B1, B2 and B3 are "original" nodes, and A1 is the "mapped" node, then this is scenario is impossible.
If you can be more specific, I will try to answer your question better.
Walter -
Setting max length of the field when using Context Model Node
I have created a model using Import Adaptive Web Service model option (a web service was a wrapper around SAP BAPI function module).
There were no dictionary types created in the Local dictionary as a result of import.
I have mapped the context of the controller to the model node.
One of the fields in the model is name CUSTOMER_NUMBER type string;
Corresponding element in the wsdl of the web service is
<xsd:element name="CUSTOMER_NUMBER" type="tns:char10" />
I have created a view with the input filed mapped to the CUSTOMER_NUMBER field of the model node.
When I type more than 10 chars into the field and hit the search button, I get a com.sap.dictionary.runtime.Ddcheck exception that the length of the field should be less than 10 chars.
How can I set the max length of the field in design time to prevent runtime exception?
Thanks,
JuliaThank you for your reply.
Java trim function will trim the white spaces only, not the characters.
I can code check length functionality before calling execute function (the function that call the web service).
I can also create a dictionary structure based on the model structure; create a context value node based on the dictionary structure and use WDCopyService API to move the data between value node and model node.
I was looking for the best practice...
When importing model based on Adaptive RFC, the dictionary structures are imported together with the model. This does not happen for Adaptive web service - hence there is a need to add coding for simple checks.
Julia -
How to refresh model nodes in webdynpro java
Dear Experts,
I have a table in view which is mapped to a model node . The model node gets populated by calling a RFC.
Please tell me how to refresh the model node mapped in the view ?
wdContext.node_Result_Data.invalidate() ; doesnt work over here . dont know y !!
Please advise.
Regards,
Mamai.Hi,
Please check with this code. Hope this is help full for you.
wdContext.nodePoDetails_OutTab().invalidate();
after invalidate u have to write the Execute that BAPI also.
wdThis.wdGetCO_POPendingDetailsController().executeYmm_Sc_Bapi_Oapending_Getlist1_Input();
Hope this helps!!
Thanks & Regards
Vijay -
Creating dependant model nodes dynamically
Hi,
currently I am facing the following challenge.
I have imported an RFC which has two TABLES parameters as follows:
T_SECURITIES
T_RATINGS
There is 1-n relationship between T_SECURITIES and T_RATINGS, so for each T_SECURITIES entry there may be 0..n T_RATINGS entries.
In my WebDynpro I would like to enable a user to edit a single security entry together with its associated ratings. Therefore I have a two Tabs. One for editing the security and another one for editing the associated ratings in a table.
Furthermore all retrieved securities are displayed in a navigation tree so the user can quickly switch between different securities.
Unfortunately I wasnt able to filter the associated ratings of a single security element each time the user selects a different security.
Can anyone tell me of a best-practice pattern how to resolve this 1-n relation issue ?
My ModelController Context looks as follows:
Input
|...
|--Output
|--T_SECURITIES
|--T_RATINGSOk guys,
I solved the issue. And it works great.
So here is what I did:
My View which specifically is to display associated ratings of a selected security entry has the following context nodes:
Context Root
|
|---Securities (Model node mapped to my model controller)
|----|-Ratings (Model node, NO MAPPING BUT IS TYPED WITH THE RFC MODEL CLASS WHICH WAS GENERATED DURING IMPORT, its node elements are generated dynamicall using a supplyFunction).
Here is what my supplyFunction does.
Each time the parent lead selection changes my supplyFunction is recalled.
WDCopyService.copyElements(this.wdThis.wdGetWDSecuritiesController().wdGetContext().nodeT_Secratings(), ratingsNode);
Initially, ratingsNode will contain all ratings from my ModelController.
Afterwards I remove those elements which are not associated with my parent security element. My resulting ratingsNode will contain a collection referencing to those model elements in the ModelController which are solely associated with the currently selected security entry. So, changes made by the user will be propaged directly to the model elements. -
Webdynpro : How to SKIP the values of the Model Node.
Hi
i imported a WSDL into my WDJ application.
where on context mapping, i mapped the MODEL with my CONTROLLER.
I would like to SKIP couple of Attributes and Model node
In WEBSERVICE navigator, i have the check box as SKIP, so using that i can skip in Navigator ,
But how to do the same in WEBDYNPRO Coding.
Say for Example
Context
----------ModelNode1
----------ModelNode2
----------ModelNode3
----------======ModelAttribute1 NULL
----------======ModelAttribute2 SKIP
----------======ModelAttribute3 SKIP
i know how to set the value if it need to set it to null
wdcontext.nodelModelNode3.currentModelNode3element.setModelAttribute1("null")
similaraly can anyone tell me how to set the SKIP for other 2 attributes......
ThanksHi Chintan
Thanks for your response....
fine ... i understood your solution....
but , my problem goes and makes me dizzzy
i have 10 mandatory filed in my Webservice..
i passed all the 10 mandatoy fileds and get perfect Response In WEBSERVICE Navigator....
i tried passing the same value via WDJ application as show below
since i have a node element with cardinalith 0..n
I set the value those i passed in Webservice Navigator.....
wdContext.nodeRequest_getSubmitRequest().
nodeRequestDetails().nodeRoles().invalidate();
IPrivateOne_AppView.IRolesElement RoleE = wdContext.createRolesElement(new ComplexType_RoleData());
RoleE.setRoleId("BASIC");
RoleE.setSysId("R3");
wdContext.nodeRequest_getSubmitRequest().
nodeRequestDetails().nodeRoles().addElement(RoleE);
But Here ,I get a Error Message Saying :Error in Submiting Request : No role seleced for the request.
so , i even checked whether the node is populated with rite value by printing them after executing the WSDL.
wdContext.currentRequest_getSubmitRequestElement().modelObject().execute();
MsgManger.reportSuccess( "After Push_execute_WSDL");
MsgManger.reportSuccess( " COntroller getRoleId -- "+wdContext.nodeRequest_getSubmitRequest()
.nodeRequestDetails().nodeRoles().currentRolesElement().getRoleId().toString());
MsgManger.reportSuccess( " COntroller getSysId -- "+wdContext.nodeRequest_getSubmitRequest()
.nodeRequestDetails().nodeRoles().currentRolesElement().getSysId().toString());
Output
After Push_execute_WSDL
COntroller getRoleId -- BASIC
COntroller getSysId -- R3
Kindly let me know wat could be wrong........
The MOST wired thing is
if i didnt set and Role , SysId in webservice navigator , then Error thrown at Webservice Navigator is
Error in Submiting Request : RoleId is mandatory,SysId is mandatory null
on following same thing , if i didnt set Role and SysID in WebDynpro then, i get error as
Error in Submiting Request : No role seleced for the request.
How is this possible....
any help on this would be appreciated...
Thanks -
Business Graphics and model nodes
Hello,
is it possible to bind a business graphics UI element in Java WebDynpro to a model node or does it have to be a value node?
Thanks,
Michaelexactly!
many ways to do this
1.U can use WDCopyService(Source ,Target) here Source : return node of model data
Target : Your temporary value node which bound to BG.
Note : Each time when ever model data get updated(CRUD) u have to call this node.
2. Use Mapping type node and bind it to BG ui element exe : when we create any node It has 4 options one of them is Mapping select this and provide the model node
(mapping of node with model node is replica of the content there in model node, here u don't have to worry about updated content since its replica and get changed eveytime when model operations is performed)
Best Regards
Satish Kumar -
Binding model nodes - seeming repetition?
Hello,
When creating a WD app using Adaptive RFC Model (or any model I assume), it is necessary to create a data link between the Model and Component Controller. Visually, the fields of the nodes of the Model and the fields of the model nodes of the Controller are linked. Why, then, is it necessary to again bind the model node of the Controller to the model object using the ".bind" method?
Code as shown here is a classic example:
Bapi_Usr01Dohr_Getemployee_Input bapiInput = new Bapi_Usr01Dohr_Getemployee_Input();
wdContext.nodeBapi_Usr01Dohr_Getemployee_Input().bind(bapiInput);
bapiInput.setId("MY_USERID");
try {
bapiInput.execute();
} catch (Exception exc) {
IWDMessageManager msgManager = wdComponentAPI.getMessageManager();
msgManager.raiseException(exc.getMessage(), true);
Clearly the visual binding in the diagram view of the component controller and the programmatic binding using the .bind method of the model node are doing different things. My question is, what is the difference? Why are both required?Michael,
There are actually 3 activity types, and sadly one of them has not the best name:
1. Map at run-time / design-time model to context node (make metadata structure, that mimics model structure, possibly with renaming of target attributes / sub-nodes)
2. Map at run-time / design-time (or as you say "link") 2 nodes in different controllers (make metadata structure, that mimics structure of node's metadata in another controller, possibly with renaming of target attributes / sub-nodes)
3. "Bind" at run-time-only data to node, that was previously described as metadata either using IDE at design-time or at run-time.
So, there is no repetition: you create metadata once (ok, more logically "once" then physically), then you may assign different data to resulted node via bind several times.
Valery Silaev
EPAM Systems
http://www.NetWeaverTeam.com -
Hi
i need some clarification regarding exposing the model node!! Can we expose the model nodes so that it could be mapped across different DCs.
i tried using this concept but when I use this dc in another dc, it gives me error regarding wdContext etc.
Any helpful pointers are most welcome
ThanksHi Priyanka,
Please check the link below.
https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/e1f4df00-0801-0010-6298-8fdf667bbd0f
Page No. 6
Exercise 2 Referencing a Single Model Component in two UI Components
Hope this helps.
Regards,
Rekha Malavathu -
Model Nodes? What for?
Hello Everybody,
why is there a distinction between model and value nodes? I never quite crasped the concept.
Usually I prefer the value nodes wherever I can. Often I have to manipulate the data I get from the model and that is really akward with model nodes.
An example for that is when you get Char1-fields instead of real booleans from the backend. My solution is to copy model model nodes to value nodes which is neither elegant nor desirable. But I can add custom attributes or even manipulate the data with calculated attirbutes. Copying nodes is a real pain because the WDCopyService is no help either. Often there's just no way around it though.
So why is there a distinction in the first place?
Best Regards,
Michael> The only gotcha I experienced myself is that it is
> impossible to map non-model node to model one in
> designer, however it is possible for dynamically
> created context (here there is no notion of "model
> node" at all)
And this is exactly what eliminating the difference between model and value nodes means. The design time approaches the run time and only speaks of nodes.
But the basic difference between value and model nodes remains: Value nodes keep the data themselves whereas model nodes hold references to another object, the "model instance" and take the attribute values from there. Which also means, that they will put changes from the UI there.
Regards, Uwe. -
Activation error : context model node has not been bound to a model class
Hi All,
I have DC project, which i am able to run without error, But when i try to activate this DC project, I am getting below error in activation log : Please help me out, It's very urgent...
[wdgen] [Info] Generating packages/com/ltli/crtmachineord/models/zp3019_dealer_default_valuesmodel/Zp3019_Dealer_Default_Values_Output.java
[wdgen] [Error] com.ltli.crtmachineord.components.crtmachineordcomp.CrtMachineOrdComp --> ContextModelNode Zp3019_Salesorder_Mac_Texts_Input [modelClass]: The context model node has not been bound to a model class (Hint: A Context model node has to be bound to a model class or mapped to a model node of another controller.)
[wdgen] [Error] com.ltli.crtmachineord.components.crtmachineordcomp.CrtMachineOrdComp --> ContextModelNode Output_Text [modelClass]: The context model node has not been bound to a model class (Hint: A Context model node has to be bound to a model class or mapped to a model node of another controller.)
[wdgen] [Info] com.ltli.crtmachineord.components.crtmachineordcomp.CrtMachineOrdComp --> ContextModelNode Output_Text [supplyingRelationRole]: Supply function or supplying relation role missing (Hint: A child node which is not mapped must have either a supplying relation role or a supply function or one of its parent nodes must have a supply function.)
[wdgen] [Error] com.ltli.crtmachineord.components.crtmachineordcomp.CrtMachineOrdComp --> ContextModelNode T_Contract_Note_Text [modelClass]: The context model node has not been bound to a model class (Hint: A Context model node has to be bound to a model class or mapped to a model node of another controller.)
[wdgen] [Info] com.ltli.crtmachineord.components.crtmachineordcomp.CrtMachineOrdComp --> ContextModelNode T_Contract_Note_Text [supplyingRelationRole]: Supply function or supplying relation role missing (Hint: A child node which is not mapped must have either a supplying relation role or a supply function or one of its parent nodes must have a supply function.)
[wdgen] [Error] com.ltli.crtmachineord.components.crtmachineordcomp.CrtMachineOrdComp --> ContextModelNode Zp3019_Get_Employee_Name_Input [modelClass]: The context model node has not been bound to a model class (Hint: A Context model node has to be bound to a model class or mapped to a model node of another controller.)
[wdgen] [Error] com.ltli.crtmachineord.components.crtmachineordcomp.CrtMachineOrdComp --> ContextModelNode Output_Name [modelClass]: The context model node has not been bound to a model class (Hint: A Context model node has to be bound to a model class or mapped to a model node of another controller.)
[wdgen] [Info] com.ltli.crtmachineord.components.crtmachineordcomp.CrtMachineOrdComp --> ContextModelNode Output_Name [supplyingRelationRole]: Supply function or supplying relation role missing (Hint: A child node which is not mapped must have either a supplying relation role or a supply function or one of its parent nodes must have a supply function.)
[wdgen] [Info] com.ltli.crtmachineord.components.crtmachineordcomp.CustnoView --> Caption grp_equipmentnumber_Header: UIElement does not have a label
[wdgen] [Warning] com.ltli.crtmachineord.views.longtextview.LongTextView --> TextEdit txe_LongText: UIElement does not have a label
[wdgen] [Info] com.ltli.crtmachineord.components.crtmachineordcomp.MatnoView --> Caption grp_equipmentnumber_Header: UIElement does not have a label
[wdgen] [Warning] com.ltli.crtmachineord.views.crtmachineordview.CrtMachineOrdView --> Label SalesDocType_Lbl [labelFor]: Value is not valid
[wdgen] [Warning] com.ltli.crtmachineord.views.crtmachineordview.CrtMachineOrdView --> Label SalesOrg_Lbl [labelFor]: Value is not valid
[wdgen] [Warning] com.ltli.crtmachineord.views.crtmachineordview.CrtMachineOrdView --> Label DistChannel_Lbl [labelFor]: Value is not valid
[wdgen] [Warning] com.ltli.crtmachineord.views.crtmachineordview.CrtMachineOrdView --> Label Division_Lbl [labelFor]: Value is not valid
[wdgen] [Warning] com.ltli.crtmachineord.views.crtmachineordview.CrtMachineOrdView --> Label SalesOffice_Lbl [labelFor]: Value is not valid
[wdgen] [Warning] com.ltli.crtmachineord.views.crtmachineordview.CrtMachineOrdView --> Label SalesGroup_Lbl [labelFor]: Value is not valid
[wdgen] [Warning] com.ltli.crtmachineord.views.crtmachineordview.CrtMachineOrdView --> Label Plant_lbl [labelFor]: labelFor is not set
[wdgen] [Error] com.ltli.crtmachineord.views.crtmachineordview.CrtMachineOrdView --> TextView txv_Ename [text]: Context element and property are not compatible
[wdgen] [Warning] com.ltli.crtmachineord.views.crtmachineordview.CrtMachineOrdView --> Label lbl_CustNo [labelFor]: labelFor is not set
[wdgen] [Warning] com.ltli.crtmachineord.views.crtmachineordview.CrtMachineOrdView --> Label lbl_ConsigneeTo [labelFor]: labelFor is not set
[wdgen] [Warning] com.ltli.crtmachineord.views.crtmachineordview.CrtMachineOrdView --> Label lbl_Pin [labelFor]: labelFor is not set
Thanks
SandyWe could resolved the problem by creating new DC project
and copying the content of existing Dc project into new DC.
(Also created new activity for this new DC), Build & Deploy the project.
Now we are able to activate the new activity without any error.
Thanks
Sandy -
Hi All,
I am facing some strange problem of model node binding.I have bound the model node to a model class.I am using Wizard to generate this model node binding.
To deploy this DC I am using NWDI .But the activation step is failing because of some build errors.moreover these build errors are not appearing at design time!!
CBS error log is as below :
[Error] com.bhc.nextgen.sales.suppcatapp.SuppCatLookupComp --> ContextModelNode Zrfc_Sd_Quote_Supplier_Search_Input [modelClass]: The context model node has not been bound to a model class (Hint: A Context model node has to be bound to a model class or mapped to a model node of another controller.)
Dose anyone know how to solve this?
Thanks,
KanchanHi
I'm not sure if I understand you completely but instead of manually creating a model node which you bind to your model you could - in Diagram View - right click on the Data link and drag and drop your model from right to left and it will automatically create the needed model class references etc.
Br
Göran
Maybe you are looking for
-
How to copy a file from Client to Application Server
Hello, My requirement is user selects a file from Browse button on oracle form - this location is on client side, and have to copy this file on Application server. I tried using webutil_file.copy_file function but it gives error - copy_file is not a
-
When I turned on my ipad the itunes logo is on it. I cant get to my home screen. I plugged it to my computer and went to the itunes and it states that the ipad is in recovery mode and that I have to do a restore. I have some important photos on it th
-
Hello I have a requirement, is that I have a infobjeto operation hour that has the hours that a transaction took place, and I had to build a structure with a range of times, but that touched me to the transformation of one substring operation time to
-
Am I able to use one catalog in both pse 8 and 11
I have restored PSE 11 onto my computer, but wonder if and how, I can also use this same catalogue on PSE 8, which is also installed on the same computer. I would therefore have 2 back-ups, and in some respects I prefer PSE 8 to work on. Having onc
-
Is an iPad of help to someone with low vision?
I have an elderly low vision (legally blind) relative in the UK. (I'm in Canada.) I'm wondering if an iPad would work for her and make it easier to do email and listen to her audio books? Or any other things that can assist her. Any info would be hel