on 09-23-2008 3:38 PM
hi @,
I have a RFC which needs input table. I have data populated in another node.How to pass the data directly from Node to Model input table as this input table doesn't have any method like .add or so.
My RFC struct is like this --
Z_A havning struc
-
strucZ_B having ele
-
1
-
2
-
3
I have to loop at the available niode and populate but in the add method for the RFC context I am getting method with model as input .
Regards,
Hi,
Private<name>View.I<value node name >Node node = wdContext.node<value node name >();
Private<name>View.I<value node name>Element ele;
<your rfc name> input = new <your rfc name>(); // your rfc name
wdContext.node<your rfc name>().bind(input); // bind
<table name> inputTable;
for (int i=0; i < node.size(); i++ ) // value node - where data is available
{
inputTable= new <table name>();
ele = node.get<value node>ElementAt(i);
inputTable.set<Attribute>(ele.get<Attribute>());
......
input.add<table name>();
}
// execute rfc.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
hi Ramesh,
Thnks for yr prompt reply My Doubt is not in the approach but normally we bind the RFC in wdDoinit and In this case i have to add the table also so I think i will have to do the whole process in custom method and perform both binding and add ing table and then execute the method.
Regards
Hi,
It depends on the context structure you are using. Is the input table of the RFC having the same structure as your table node?
passing a table to RFC you write these code :
. so value node to model node.
1.create an instance of the Input class;
<BAPI_name>_Input input = new <BAPI_name>_Input ()
TAB table;
IPrivate<view>.I<table_node>Element elmt;
for(int i=0;i<wdContext.node<table_node>().size();i++)
{
table = new TAB();
elmt = wdContext.node<table_node>).get<table_node>ElementAt(i);
table.set<property1>(elmt.get<corresponding property1>);
.
.
table.set<propertyN>(elmt.get<corresponding propertyN););
input.add<MyTable>(table);
}
wdcontext.node<BAPI_name>_Input().bind(input);
Now execute the BAPI using the following line
wdContext.current<BAPI_Name>_InputElement().modelObject().execute();
wdContext.nodeOutput.invalidate()
// clears the old value in the output node
hope it will help u.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
If both are model nodes, you can use
WDCopyService.copyCorresponding(sourcenode, targetnode);
WDCopyService.copyElements(sourcenode, targetnode);
or else you need to use loop on the node like
Private<name>View.I<modelnode>Element ele; // RFC input node
for (int i=0; i<Valuenode>.size(); i++ ) // value node - where data is available
{
ele.create<modelnode>Element();
ele.setXXX(wdContext.node<Valuenode>().get<Valuenode>ElementAt(i).getXXX());
..........
wdContext.node<modelnode>().addElement(ele);
}
Regards,
Siva
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
93 | |
10 | |
10 | |
9 | |
9 | |
7 | |
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.