on 03-12-2009 10:40 PM
Hi All,
I have a problem with binding tables to context nodes.
I'm using an RFC (FM1) that returns tables with GUIDs. I have to feed these tables as input to a different function module (FM2) for execution.
I tried to bind the tables returned from FM1 to FM2. I've used an input structure of the node, have add the tables to it. I've bound this input structure to the FM2 node.
When I execute the FM2 these table rows are appended to the existing FM2 tables. I actually need just the values to be copied to the input tables.
FM1- ZABC
Node ZABC - OUTPUT - A,B tables (sub nodes)
FM2 - ZXYZ
Node ZXYZ INPUT - X, Y tables (sub nodes)
Structures X1, Y1 of type X and Y respectively
Structure ZXYZ1 of type ZXYZ
Copied values from Output of ZABC A and B into X1 and Y1.
ZXYZ1.addX1
ZXYZ1.addY1
nodeXYZ.bind(ZXYZ1)
Executed FM ZXYZ
Version: NWDS 2.0
Netweaver 2004s SP15
Thank you,
Vasu
Hi Vasu,
It seems you get the results but the older data is still there & you need to clear that data.
You can invalidate the context like wdContext.nodeOutput().invalidate() (you can call this code at time of execute statement)
Kind Regards,
Nitin
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,,
you need to make loop with you first node size and get the values from first node, and set the values to second node.
you need to create the elements for both the nodes and get and set the values based on the condition, by using the loop you can get the value of every field.
like wdContext.node<nodename>.get<nodename>Elementat(i). - to get the record at " ith " position.
wdContext.node<nodename>.get<nodename>Elementat(i).get<attributename>(); to get the value of a field at a specific position from a record.
after getting the values from the first node you can set that to second node right
may be it can help you,
Cheers,
Appu
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I've declared abstract lists of type (FM tables). I've added rows to this lists and set this lists to the function module nodes. This way, news rows are not added and the problem is resolved.
In the example I mentioned.
FM2 - ZXYZ
Node ZXYZ INPUT - X, Y tables (sub nodes)
Abstractlist of type input tables (X,Y) in the model
ZXYZ.setAbstractlistX
ZXYZ.setAbstractlistY
Executed FM ZXYZ
Thank you,
Vasu
Hi
You can use the methods WDCopyService
Example : WDCopyService.copyElements(source, target)
Best Regards
Satish Kumar
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Satish: Is there any other function for copying selected rows of the tables rather than copying the whole node(table). I need some selected rows of first node (table) based on a condition to be copied to the second node.
Nitin: Output node is already invalidated. Even then the rows are appended instead of copy.
Thank you,
Vasu
Hi
Something like your requirement is not there You can check with this method and find some workaround
WDCopyService.copyCorresponding(source, target)
Note :Its parameter is Object type not IWD type
Since u have the object now u can write the retrieving logic based on this.
But I would suggest to get value by getter setter way and hold it in some temporary node.
Best Regards
Satish Kumar
HI
May be you can fetch the data from the table with looping the table size and catching the
index of the elements . To be more clear .
1 . get the size of the table .
int leadSelection= wdcontext.node<TableName>.getLeadSelection();
for (int i=0 ;i<n;i++)
{
if(wdcontext.node<tablename>.isMultiselected(leadSelection))
{
String name = wdcontext.node<tablename>.getelementatindex(leadSelection).getname();
similarly fetch the size of the other elements from the table .
and set to other RFC as
ZClass abc = new ZClass();
abc.setName(name);
wdcontext.node<NameName>.bind(abc);
and othere thing is when you use Abstract class you can insert only one element at a time .
or may be you may want to set the values direclty to the RFC
AbstractList lst = new ZClass.ZClassList();
ZClass cls = new ZClass();
clas.setName(name)
lst.add(class);
wdcontext.currentRFcNameElement.modelObject.setName(lst);
and
execute the RFC .
murali
User | Count |
---|---|
88 | |
10 | |
10 | |
9 | |
7 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.