on 05-17-2011 8:28 AM
Hi,
I am getting issues in initilization of RFC model. I have RFC context node structure as follows:
Root node
-> node_input
->node_1
->low_at
->high_at
->node_2`
>low_at
>high_at
->node_output
->att1
->att2
node_1 and node_2 are the input nodes along with att1, att2.
How we do initialize whole input model here?
Thanks
Praveen
Hi Praveen
You need to create object of the input node like
Node_input input = new Node_input();
wdContext.nodeNode_input.bind(input);
Set the parameter for Abstruct List using : [Initializing AbstractList Model in Custom Controller |;
then
try
{
//Execute the model
wdContext.current<ModelName>_InputElement().modelObject().execute();
}
catch (com.sap.tc.cmi.exception.CMIException e)
{
//In case of error when executing the RFC, we catch the exception.
wdComponentAPI.getMessageManager().reportWarning(e.getMessage());
}
finally {
//Make sure the connection is closed once the RFC's execution has finished
wdContext.current<ModelName>_InputElement().modelObject().modelInstance().disconnectIfAlive();
}
Refer to [How to Call RFC from Web Dynpro Application|http://www.sdn.sap.com/irj/scn/index?rid=/library/uuid/10c2c440-7f8c-2b10-7db0-dce34360f118]
Hope it will helps
Best Regards
Arun Jaiswal
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Praveen,
Go as follows:
<RFC NAME>_INPUT bapiInput;
bapiInput = new <RFC NAME>_INPUT();
<TYPE OF NODE_1> node1 = new <TYPE OF NODE_1>();
<TYPE OF NODE_2> node2 = new <TYPE OF NODE_2>();
bapiInput.setnode_1(node1);
bapiInput.setnode_2(node2);
wdContext.nodenode_input().bind(bapiInput);
Thanks
Prashant
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Praveen,
if a RFC contains sructure in Import parameters that will reflect in webdynpro java side as AbstractList.
you have to set the parameters to the input node to send the values to backend.
Use the parasanth's code to set the values to the rfc input nodes.
here <TYPE OF NODE_1> or <TYPE OF NODE_2> are the database structure's which are given as the ref type in RFC.
Hope this will help you.
Thanks & Regards,
Bhargava.
Hello Praveen,
I hope you are talking about the Nodes which is available under the Tables Tab of RFC. If this is the case, you dont want to add Abstract List, you need to add element for the same.
For Ex:
RFC_1 rfc1 = new RFC_1();
Node1 node1 = new Node1();
node1.setABC("Hello");
rfc1.addNode1(node1);
This adding of elements will run in For Loop.
Reply for queries.
Regards
Nizamudeen SM
User | Count |
---|---|
89 | |
10 | |
9 | |
9 | |
9 | |
6 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.