CRM model nodes
Hi
I am new to weclient ui and i want to know how to use a model node. I have created a simple object in spro which is my ztable. so now, will i be able to acess the data in my ztable just by creating a model or do i need to any extra coding to get data from BOL to the component controler's comtext. I need a detailed solution pls, i have very basic knowledge of these things
Hi
I saw the article and created a model node ZCRMBOL in component controller and view controller. I then bound both the nodes and tested it gave exceptions ..... i have a simple object ZCRM_BOL in root objects of BOL_BROWSER, and i have created model node ZCRMBOL with that BOL Entity.I have created ZCRM_BOLSearch object as well. The error that i am getting in the browser while testing is -
Cannot display view ZCRM_BOL_COMP/ZCRMBOLView of UI Component ZCRM_BOL_COMP
An exception has occurred Exception Class CX_SY_REF_IS_INITIAL - Dereferencing of the NULL reference
BSP Application: ZCRM_BOL_COMP
View Layout: ZCRMBOLView.htm
Method: CL_O2D82AN0BC7W4RYDJ761PWB143E=>_ONLAYOUT
Source Text Row: 42
Thank you for your time.
Similar Messages
-
Need help to read model node input field attribute present in view - first time developer.
Hello Experts,
I am new to CRM Web UI development.
Presently, I am trying to develop a Guided Activity Page having 2 views.
First view has the field Business Partner Number, I have added model Node BuilHeader and the attribute BP_NUMBER while creation of the view.
The Second View consists of 2 fields from the Model Node BuilHeader, namely First Name and Last Name.
The requirement is to enter the BP Number on the first screen then click on the NEXT button from the Guided Activity buttons, on navigating to the Second View, the Names should auto-populate.
I have Created both views and the GP page, the GP navigation is also happening. Initially the fields were showing Not Bound text in value, so I commented the line in GET_I and GET methods to enable the field and remove the Not Bound text. I have created a custom controller with BuilHeader
I have tried doing this but facing the below problems :
1) When I enter the BP number on the first view and press Enter, the value disappears. How to solve this ?
2) Does clicking on the NEXT button on the GP Navigation trigger a Server Roundtrip ?
3) How to read the context node value of BP Number entered on the first view and populate the Name fields on the second view.
Please help.........you can take reference from from below code as in above case we use BuilHeaderAdvancedSearch search object, to get current entity.
data: query TYPE REF TO cl_crm_bol_dquery_service,.
query ?= me->typed_context->BuilHeaderAdvancedSearch->collection_wrapper->get_current( ).
Do not remove code from getter setter of fields , it will not clear.
Check with http://scn.sap.com/thread/3391203 , for basic understanding of UI.
Regards,
Harish Kumar -
Java.lang.NullPointerException in RFC model node
Hi All,
I am calling one of RFC from CRM system but getting some NullPointerException in model node.
Details:
1. creating input node
2. pass parameter and bind input node
3. execute node
4. invalidate output node
I am getting this exception when I accessing attributes from output node.
Why my output node is not invalidated / refresh.
Please solve this problem.
Thanks,
Krishna.Hi Krishna,
Before every BAPI call are you resetting the input param values if any??
Pls Verify this.
-Ashwini. -
Creation of new element in Model Node
Dear All,
I am facing one problem, I have two model node. I want to copy one model node to other model node.while copying its giving error saying the you can bind the element, coz target node doesn't have valid parent.
Pl don't suggest me work on Value node.
Can i create a element in model node at run time.
Thanks & Regards
Manoj SahooHi Manoj,
Model node properties :
1.A context model node makes a model object look like any other context node. I.E. it gives the model object an API that is very similar to a value node.
2. A model node is not considered valid until it is bound to a corresponding model object. Therefore, a model node always inherits its metadata from the model object to which it is bound.
3. The element collection in a model node does not hold the actual runtime data! Instead, it holds a list of references to the relevant model object instances.
If u check the 2nd property, u will find the cause of ur exception. As u have already told, don't suggest to use value nodes, i don't have any other comment.
regards
Sumit -
How to populate a Value Attribute of a Value Node inside Model Node
Hello
I have my context like this.
Context
.. - ModelNode
.... - Model Attr1
.... - Model Attr2
.... - Model Attr3
.... - Model Attr4
.... - Value Node
...... |
...... - Value Attr1
Model Node is of Cardinality 0..N
Value Node is of Cardinality 1..1
I want to create multiple records in my Model Node and one record for every Model Node in Value Node.
How to do this?
All good suggestions are welcome.
Regards,
ShubhamHi Shubham,
With your context structure the code will be
for(int i = wdContext.nodeModelNode().size()-1 ; i>=0 ; i--)
IPublic<comp name>.IModelNodeElement ele = wdContext.nodeModelNode().getModelNodeElementAt(i);
IPublic<comp name>.IValNodeElement valEle = wdContext.nodeModelNode().nodeValNode().createValNodeElement();
valele.setValAttr("");
ele.nodeValNode().addElement( valEle);
Your val node should be non singleton (singleton property = false)
Regards,
Jaydeep -
How can I create an element in the model node?
Hi, Experts,
I create a model node that name is containerNode in the contxt. Cadinility is: 1..n
I write the code in the method:
private String getDataForOutputTable( IWDNode wageTypePayslip, IWDNode containerNode ){
String betrgSumStr = "";
int index = 0;
Vector containerVector = new Vector();
int size = wageTypePayslip.size();
IWDNodeElement element = containerNode.createElement();// The system report error when I run the application.
BigDecimal betrgSum = new BigDecimal( 0 );
I try to create a element in the containerNode, But the system report error when I run the application.
java.lang.IllegalArgumentException: model object must not be null
at com.sap.tc.webdynpro.progmodel.context.ModelNodeElement.<init>(ModelNodeElement.java:66)
at besuretech.com.wdp.IPrivatePayDataDispView$IOContainerElement.<init>(IPrivatePayDataDispView.java:1537)
at besuretech.com.wdp.IPrivatePayDataDispView$IContextNode.doCreateElement(IPrivatePayDataDispView.java:88)
at com.sap.tc.webdynpro.progmodel.context.NodeInfo.createElement(NodeInfo.java:884)
at com.sap.tc.webdynpro.progmodel.context.Node.createElementInternal(Node.java:1351)
at com.sap.tc.webdynpro.progmodel.context.Node.createElement(Node.java:1370)
at besuretech.com.PayDataDispView.getDataForOutputTable(PayDataDispView.java:251)
at besuretech.com.PayDataDispView.getAllData(PayDataDispView.java:196)
at besuretech.com.PayDataDispView.onPlugPayListViewIn(PayDataDispView.java:154)
at besuretech.com.wdp.InternalPayDataDispView.wdInvokeEventHandler(InternalPayDataDispView.java:391)
at com.sap.tc.webdynpro.progmodel.generation.DelegatingView.invokeEventHandler(DelegatingView.java:87)
at com.sap.tc.webdynpro.clientserver.cal.ClientApplication.navigate(ClientApplication.java:826)
at com.sap.tc.webdynpro.clientserver.cal.ClientComponent.navigate(ClientComponent.java:881)
at com.sap.tc.webdynpro.clientserver.window.WindowPhaseModel.doNavigation(WindowPhaseModel.java:498)
How can I create an element in the model node ?
Best regards,
taoHi,
You need to execute the model before creating the element.
Regards
Ayyapparaj -
How can I create a model node in SAP Records Management
Product: SAP Records Management
Hi,
I would like to create a model node in a record tree.
I found in the function modul BAPI_RECORD_ADDELEMENT no entry for the creation of a model node. Only the instance and the structure node can create by this function modul.
So, does anyone know a solution to create a model note?
Regards,
Thomas FanningerHi Thomas,
it is not possible with the BAPI due to the piece of coding:
case myElementType.
when glob_const_elem_type_instance.
myRecordElement->Type_Set( if_srm_sp_record_element=>type_instance ).
myRecordInstanceElement ?= myRecordElement.
loop at element_sp_poid into myElementSpPoidWa.
mySpPoidWa-id = myElementSpPoidWa-name.
mySpPoidWa-value = myElementSpPoidWa-value.
insert mySpPoidWa into table myElementSpPoidTab.
endloop.
myElementSpsId = sps_id.
myElementPoid = myClientService->poid_get_instance( im_rms_id = myRmsId
im_sps_id = myElementSpsId im_sp_poid = myElementSpPoidTab ).
myService->check_sp_connection( myElementPoid ).
myRecordInstanceElement->poid_set( myElementPoid ).
when glob_const_elem_type_folder.
myRecordElement->Type_Set( if_srm_sp_record_element=>type_folder ).
when others.
perform set_error using '852' return.
return.
endcase.
But you can do that by using directly the Records API. How to use this is demonstrated in the report 'SRM_RECORD_API_HOWTO'. Search there for the subroutine 'fillrecordelement'. There a record element for insert is created and its type is set. You can set the type there to 'IF_SRM_SP_RECORD_ELEMENT~TYPE_MODEL'. Of course your POID then may not be an instance POID.
Best regards,
Thomas -
How to bindi a UI element to 2 model nodes different in the same view
I want to know how I can bind a set of inputfields, in a form view, to 2 different model nodes ?
<u>example:</u>
Im working with 2 adaptional RFC, both working, in my Custom Context.
Ztest_Search
Ztest_Update
In my ResultView I have 2 Model nodes (one for each RFC) I show a set of inputfields in a form view, binded to the Ztest_Search_output of Ztest_Search. This works.
now I want to update the changes, but I can't find the ways of binding the same inputfields to my other Model node (Ztest_Update) in the context of ResultView.
Note: If I create a duplicate set of inputfields , one for Ztest_Search binded to the Ztest_Update_output and the other to the Ztest_Update_Input Works. But I wanna avoid this duplicated set of inputfields.
ThxRodrigo,
If I understood correctly, your problem is to get the data from the input fields which are bound to a
model node, Ztest_Search_output and set it to the model node of another RFC, Ztest_Update.
This can be done by getting the suitable values from the model attributes of Ztest_Search_output
and setting it to Ztest_Update.
<b>/**
* valueOne, valueTwo are the name of the model
* attributes that are bound to the Input fields.
*/</b>
String firstValue = wdContext.currentZtest_Search_outputElement
().get<valueOne>;
String secondValue = wdContext.currentZtest_Search_outputElement
().get<valueTwo>;
Ztest_Update_Input update = new Ztest_Update_Input();
wdContext.nodeZtest_Update_Input().bind(update);
<b>/*
*<b>Zstructure is the structure of the model node under
*Ztest_Update_Input to which the values have to be
*updated.</b>
*/</b>
ZStructure structure = new ZStruture();
structure.setValueOne(valueOne);
structure.setValueTwo(valueTwo);
update.addZStructure(structure);
try
update.execute();
catch (Exception ex)
wdComponentAPI.getMessageManager().reportException(ex.getMessage(), false);
wdContext.nodeZtest_Update_Output().invalidate();
Bala -
How to add a new element to a model node in the view controller?
View Context
myNode
attri1
attri2
myNode is a web service model node. How to add a new element to this node?
Regards,
Hui
Edited by: Hui Wang on Feb 15, 2008 12:05 PMSudhir Gorantla wrote:>
> Hi,
>
> myNode
> attri1
> attri2
>
> IMyNodeElement ele=wdContext.myNode().createMyNodeElement();
>
> ele.setAttri1("");
> ele.setAttri2("");
>
> wdContext.nodeMyNode().addElement(ele);
>
> Regards,
> Sudhir
Hi we need a model as an input parameter when creating a element for a model node. How to get the instance of the model?
Regards,
Hui -
How to get the data from the model node like a table ?
I want to get the data from the model node once a record ,and the node is bound to a internal table in the RFM which I called in the R/3 system. Who can give me some advice to achive it?Thank you!!
Hi,
To get the data from the node:
wdContext.node[your node name].current[node name]_InputElement().get[specific element in the node];
or you van use:
wdContext.current[your node]Element().get[your element in the node];
examples:
wdContext.nodeZ_Mepro_Po_Detail_Stock_Distri_Input().currentZ_Mepro_Po_Detail_Stock_Distri_InputElement().getUcpd_Flag();
wdContext.currentT_Delv_ReqsElement().getShelflife();
regards, -
Error while sorting the model node table
hi
if(firstTime)
view.nowCreateAllCustomExtensionFields();
IWDTable tab= (IWDTable)view.getElement("tbl_car");
wdContext.currentContextElement().setCarTableSorter(new TableSorter(tab,wdThis.wdGetCarTableSorterAction(),null));
i have written the above code in domodifyview() {}
and tbl_car is the id of the my table. and the table is of type
model node .
wdContext.currentContextElement().getCarTableSorter().sort(wdEvent,wdContext.nodeIt_Car_Data());
created a sort action for the table , present in the table
properties and iam getting a error under sort() saying
method sort(iwdcustomevent,iwdnode,string) is of type
tablesorter and not applicable for
(wdcustomevent,iprivateview.nodename)
can any one help me ?replace
if(firstTime)
view.nowCreateAllCustomExtensionFields();
IWDTable tab= (IWDTable)view.getElement("tbl_car");
wdContext.currentContextElement().setCarTableSorter(new TableSorter(tab,wdThis.wdGetCarTableSorterAction(),null));
by
if(firstTime)
view.nowCreateAllCustomExtensionFields();
IWDTable tab= (IWDTable)view.getElement("tbl_car");
wdContext.currentContextElement().setCarTableSorter(new TableSorter(tab,wdThis.wdGetCarTableSorterAction(),new HashTable()));
nikhil -
Hello Friends,
To display the field on the View, we can create the field via 3 ways:
1) By creating the model attribute
2) By creating the model node using the GENIL object and using its attributes in view
3) Creating the field in Database structure using AET
But, i am not aware that in exactly what kind of business scenarios we use the above 3 methods to create the field.
Could you help me out to clarify the same.Hi Dev,
1). By creating the model attribute: we will use this option in case of the field is avaibla in stanadrd sap system. It might be in another under child context nodes and we will use BOL relations to access the attribute.
2). By creating the model node using the GENIL object and using its attributes in view: We will use this option incase of there is no standard provision to use. Means you want to create any custom assignment block with custom attributes then you can go for this option. More over we can use AET to create custom genil object. We have an option Create Table in AET.
3).Creating the field in Database structure using AET: We will use this option incase of there is no attribute in database relevant to your requirement then we will go for AET enhancement.
Hope this might give you little clarification..
Best Regards,
Dharmakasi. -
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 -
Populate model node with an internal table
Dear experts
I have an internal table. I have a model node. I need to populate the data in my internal table onto my model node.
In case of a value node, I know how to do this.
I would appreciate if somebody can give me some 'code snippet' on how to do this in case of a model node.
I tried looking into some standard components but its bit confusing.
Any replies will be greatly appreciated.
Thanks in advance.
RajHi Masood
Thanks for the reply. Actually I am familiar with using the method 'set_properties'. But my main confusion is on how to create an instance before calling this 'set_properties' method.
For eg: in case of value node, we will use
FIRST CREATE OBJECT
create object lv_value_node
exporting = ls_struct
THEN SET THE PROPERTY
lv_value_node->set_propety ( ).
But in the case of model node, I wont be able to use the statement
"create object lv_model_node
exporting = ls_struct"
So I need to create an instance of the BOL. This is where I am confused. And my BOL is FUSearchRes. It is a 'Search Result object' in Genil_model_browser. So I cannot create a root object. Also I don't see any parent for this.
So I am not sure of how to create objects for this particular BOL. Plz throw some light on this.
Thanks
Raj
Maybe you are looking for
-
Help! We set up family share a few weeks ago, and it was working fine with the organizer and two additional members. The three of us could see each other on app and iTunes stores and could view each other's purchased items. Then ... All of that di
-
Modify the data source of a data view web part
I have a dataView web part deployed in a template in multiple site collection. This dataView hasn't any query set up, so it loads a lot of items and this is slowing down my system. Now I want to programmatically put a query overriding the existent (e
-
Regarding ALV report to output in excel
How to do ALV report to output in excel format?
-
Unable to replicate one vendor from ECC to SRM
Hi Gurus, We are using SRM 5.0 Classic scenario. We have scheduled the job to replicate the vendor masters from R/3 to EBP on daily basis and it is working fine and replicating the vendor master from R/3 to EBP without any issues for past two years.
-
Hi, I'm developing an air app for android and ios. I'm also integrating the app with facebook, however I don't know what to set "Android Class Name" to in the developer facebook page. I set "Android Package Name" to "air.mypackagename". Any i