Skip to Content
0
Jul 07, 2005 at 06:04 AM

Copying Elements from one node to another with WDCopyService

57 Views

Hi Gang,

Can you see why this code is not working. To me it should work fine. I have seen a couple of posts regarding this topic but none give a definite yes or no as whether this method works.

I have two RFC's. Each one uses a table of Personnel numbers.

RFC1 fills the table with pernr's and this works fine - I see it on my screen.

RFC2 accepts a table (same structure) of personnel numbers and outputs the names of the people.

So I thought I could simply copy the elements from node Pernr_Tab (output from RFC1) to Pernr_Tab_name(Input for RFC2). But only a blank table is being passed to RFC2

Controller Context

O Context

|-PernrList (Bound to RFC1)

|.|-PernrOutput

|...|-Pernr_Tab (Output from RFC1)

|.....=Pernr

|

- Names (Bound to RFC2)

..

- Output_name

..

.

-Name_Tab (This is blank after RFC2 is called)

..

...=Pernr

..

...=Name

..

..|-Pernr_Tab_name (Source For RFC2)

....=Pernr

public void RFCNameFill( )

{

//@@begin RFCNameFill()

Z_Wd_Name_Input nameInput = new Z_Wd_Name_Input();

wdContext.nodeNames().bind(nameInput);

// Copy all the elements from node Pernr_Tab to node Pernr_Tab_name

WDCopyService.copyElements(wdContext.nodePernr_Tab(), wdContext.nodePernr_Tab_name());

try {

wdContext.currentNamesElement().modelObject().execute();

}

catch (Exception ex){

ex.printStackTrace();

}

wdContext.nodeOutput_name().invalidate();

//@@end

}