on 07-14-2010 6:28 AM
how can i pass tables to RFC as input?
Thanks.
Hi,
If I understand you right, you want to pass the values of a webdynpro table to an RFC. In this case, you have to loop through the context and individually pass the values to the RFC input elements.
Regards,
Vaishnavi
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello prasanthi!
Let's imagine that your model node has following structure:
ModelNode
...+---TableNode
..............+---- tableAttr1
..............+---- tableAttr2
And that you should fill table from nodeSource (another node from context).
So you can fill table like this:
// begin loop for source
TableNodeType table = new TableNodeType(model);
// set attributes of your table node:
table.setTableAttr1( value1 );
table.setTableAttr2( value2 );
etc...
// add a record to RFC table
bapiInput.addTableNode(table);
// end loop for source
TableNodeType is a type of your TableNode. This type you can see in property "Structure" of property group "Model" of TableNode properties.
regards, Lev
Edited by: Lev Kulaev on Jul 14, 2010 12:09 PM
Edited by: Lev Kulaev on Jul 14, 2010 12:11 PM
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks for the replies.
I have actually written the below code, but not getting the output.
Model1 mod=new Model1();
zbapi_Input ip=new Zbapi_Input(mod);
ztable tab1;
tab1=new Ztable(mod);
tab1.setcode("2100");
input.addZtable(tab1);
wdContext.nodezbapi_Input ().bind(ip);
try {
wdContext.currentzbapi_Input Element().modelObject().execute();
} catch (ARFC2ModelExecuteException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
Hi Prasanthi,
Please try this
zbapi_Input objinput =new Zbapi_Input(mod);
wdContext.nodezbapi_Input ().bind(objinput );
ztable tab1 = null;
tab1=new Ztable(mod);
tab1.setcode("2100");
objinput.addZtable(tab1);
try {
wdContext.currentzbapi_Input Element().modelObject().execute()
} catch (ARFC2ModelExecuteException e) {
e.printStackTrace();
}fianlly{
wdContext.currentzbapi_Input Element().modelObject().modelInstance().disconnectIfAlive();
}
Hope it will helps
Regards
Arun
Hi Prasanthi!
For output you should invalidate all output nodes one after another after executing model. For example, If you have following node structure:
ModelNode
....+---InputNode
....+---OutputNode
..............+---SomeResults
you should invalidate code like this:
// executing a model
wdContext.nodeOutputNode.invalidate();
wdContext.nodeSomeResults.invalidate();
Hi,
the Typed model execution can also simply result in the missing configuration of the RFC destination data.
WD_MODELDATA_DEST
WD_RFC_METADATA_DEST
In case of 7.2 you have simply to configure these in the nwa floorplan app.
If e.g. WD_MODELDATA_DEST is missing, deployment and application execution are successful, but the RFC calls will fail with the typed mode execution exception.
Hope this helps,
Artjom
Hi Prasant,
First you have to pass values of the table to Model node with context mapping.Model node will be the 'Import ' parameters of the RFC. Then you have to write a method to execute the RFC with .execute() statement.
After that you can able to pass the values from the table to the desired RFC.Check that context binding has been done properly in the view.
Regards,
Sukalyan
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
84 | |
23 | |
11 | |
9 | |
8 | |
5 | |
5 | |
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.