cancel
Showing results for 
Search instead for 
Did you mean: 

copy from one node to another child node

prasad
Participant
0 Kudos

Hi all,

I have a node A with (1-1) cardinality . I have one another node B with a child node C. the child node has same structure of node A.   I have some data in node A . How can i copy the node A data to Node C which is a child node of B.

The code wizard is not giving correct result.

Please do the needful.

Regards

Prasad

Accepted Solutions (0)

Answers (5)

Answers (5)

0 Kudos

Hi Prasad,

i don't know where u r facing issue.

i guess there a issue with node B cardinality!!!. first of all let me know what is node B cardinality???

Regards,

Venkat

former_member210804
Active Participant
0 Kudos

Hi Prasad,

I have done one sample application for your scenario. Please go through the below steps.

1. Create 3 nodes ( A, B, C ) and attribute as 'NAME' as below screenshot.

2. Create a supply function for Node A to fill data.

3.   Creata a TextView in MAIN view to display name from Node C.

     Now, fetch the data from Node A to Node C in  WDDOINIT method of MAIN view.

Now, we can display the 'name' from Node C.

Hope this will be helpful.

Best regards,

Narasimha

Former Member
0 Kudos

Hello Prasad,

I guess wizard is not helping because in case of child node you cannot directly get the instance of that node.

What you can do is there is a method in if_wd_context_node class path_get_node( ). Pass the mapping path that you can see in the context node. From this you will get the instance of the child node.

Now store the data of node A using get_static_attribute( ) and set it in the node C using set_static_attribute( ).

Thanks,

Vishu Agarwal

I hope this solve your problem....

former_member215610
Active Participant
0 Kudos

Hi Prasad,

  First read the node A using code wizard.

  Create a workarea of type node B.

  Assign the value of node A into the workarea of node B.

  and again use the code wizard to set the value to node B (export workarea of node B).

Thanks and Regards,

  Ragavendra BR

guillaume-hrc
Active Contributor
0 Kudos

Hi,

One read for node A. Store content in internal table

Then, write on node C with the correct path should cause no problem, but you have to make sure there is at least 1 element in node B on which to set the data (what is the cardinality of node B?)

What is the problem you are facing?

Best regards,

Guillaume