cancel
Showing results for 
Search instead for 
Did you mean: 

how to copy input model node to output model subnode manually

Former Member
0 Kudos

Dear Friends

I have two bapi's

1. Zbapi_XXX_CreateFormData_Input

output

PersonNumber

Personinfo -


1 (input structure same abouve output Structure

2. Zbapi_XXXX_GetData_Input

output

bapiReturn

PersonInfo --- 2 (output structure same above input structure)

PersonNumber

1. RFC Excutes when we give personinfo structure Values return Perso Number.

2. RFC excutes when we give PersonNumber return Personinfo values and Bapi Values.

NoW.. I need , I want Copy Values PersonInfo (1) structure to Personinfo (2)(output)

structure. Please Help me how to do this.

Becuase

View1 is input Create PersonInof

view2 is get Personinfo structure.

in scond view I don't need to exucute 2 nd RFC, Just Copy 2 RFC personinfo Structure.

Appriciate your cooparetion

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

Use this code in wdDoInit();

{

IWDNode srcNode = (IWDNode)wdThis.wdGetFlightCompController().wdGetContext().nodeFlight_List();

IWDNode destNode = (IWDNode)wdContext.nodeFlight_Sorted();

WDCopyService.copySubtree(srcNode,destNode);

}

Former Member
0 Kudos

hai suresh,

TQ for Quick Reply,

I check above Way, if both nodes inputnodes then working above Way.

But My Case is, input Node (1) copy to output node (2). inputnode have only one node, output node have 2 nodes

so can't working above , please suggest another metthod

former_member185029
Active Contributor
0 Kudos

Hi Ganesh,

I am not sure why you want to copy input node of an RFC model to output node of another one.

Generally output nodes contain data returned by RFC.

Incase your requirement is to copy the input values of one RFC to input values of other one, you can use WDCopyService object.

You can also manually copy each and every value in case of value node.

int iNodeSize=wdContext.nodeInputNode().size();
IPrivateView.IDestinationNodeElement ele =null;
for(int i=0;i<iNodeSize;i++)
{
ele=wdContext.createDestinationNodeElement();
  ele.setAttrName(
  wdContext.nodeInputNode().getInputNodeElementAt(i).getAttrName());
................
//repeat the above code for all the attributes.
.........................

wdContext.nodeDestinationNodeElement().add(ele);
}


}

Ashutosh

Program code modified

Former Member
0 Kudos

Dear Ashutosh,

Thank you understand my problame, but in my case i need that.

I need to copy input node to another bappi output node , both are same structure.

Why I need,

View2 is Report View, So when I create NewPerson After Display View2 for ReportView.

But Beofre Save View1 need to See Data on Reportformat View2. so that if View1 Save means i can get view2 node values using 2 RFC.

I think What i explaing way consusing to me also...

please suggest how to achive that

Former Member
0 Kudos

Dear Suresh,

Please help Regarding this issue..

Former Member
0 Kudos

Hi Ganesh,

Can u please elaborate more on ur requirement ,what exactly u want to achieve with copy input model node to output model ??

I think input nodes are for getting the input parameters before executing the BAPI & output nodes return the data after execution. Do u mean to say whatever u r passing to input node,same thing should be available in the output for 2nd bapi??

If copyService works also ,what will happen after executing the 2nd bapi??

regards

Sumit

Former Member
0 Kudos

1. Zbapi_XXX_CreateFormData_Input

--output

-


PersonNumber

--Personinfo -


1 (input structure same abouve output Structure

2. Zbapi_XXXX_GetData_Input

--output

-


bapiReturn

-


PersonInfo --- 2 (output structure same above input structure)

--PersonNumber

I need with excuting any RFC, just copy values 1 RFC inputnode Personinfo (1) to 2 nd RFC output node PersonInfo..

wdcopysevice can works both are input nodes. one node is input node and second node output node. so how can copy values from input node to output node.

I don't execute any RFC..

please help me

Message was edited by:

Ganesh

former_member182294
Active Contributor
0 Kudos

Ganesh,

As per my understanding (correct me if I am wrong) you are trying to avoid RFC execution second time because the same data is available in Input node. After executing RFC from View1 you want to refresh View2 so that data is available in the Second View without executing RFC. But there is a problem here:

When you try to update the output node manually the data whatever you are showing is not consistent with the backend. Because

1) View1 transaction might be failed, but as you are updating the output node of View2 which is inconsistent.

2) What happens if some other users works on same screens and provides some more information. There is no way you can refresh data until you execute the RFC.

If you still want to continue with your approach, do this..

Create a value node with all attributes as in model node for View2.

After executing the BAPI read data from model node and add it to value node.

Whenever you execute RFC from View1 then copy that data to Value node. This way your View2 will have input data of View1.

Regards

Abhilash

Answers (0)