cancel
Showing results for 
Search instead for 
Did you mean: 

passing a constant counter for UseOneAsMany

Former Member
0 Kudos

Hello gurus

Is it possible to repeat the value of a source node fixed number of times using UseOneAsMany or by any other means?

I am required to copy value of 1 node to 4 target fields of an IDoc segment.

Any help is appreciated.

Thanks in advance.

Regards,

Xineohpi

Accepted Solutions (0)

Answers (1)

Answers (1)

pvishnuvardan_reddy
Active Contributor
0 Kudos

Hi Xineohpii,

You can use COPYVALUE constant function for this.

In the dialog box of COPYVALUE, you need to specify the index(which occurrence of source element), you need to copy, and when you map the output of this function to the target, then when ever target element exists, that source value will be mapped to it.

Pls check and let me know if you face any issues.

Regards

Vishnu

Former Member
0 Kudos

Hi Vishnu

Thank you for your reply.

But i am there are multiple values for source node

eg:

A1

A2

A3

A4.

This is to be repeated in multiple occurrences of target node eg:

A1

A1

A1

A1

A2

A2

A2

A2

A3

A3

A3

A3

A4

A4

A4

A4

I understand that if i had only one source value for multiple targets, i could have used COPY VALUE.

Is there any way i can use Copy value for my requirement too..?

Regards,

Xineohpi

pvishnuvardan_reddy
Active Contributor
0 Kudos

Hi Xineohpi,

Can you attach any screenshots of the above requirement(source structure, target structure required elements) for better understanding.

Regards

Vishnu

former_member184720
Active Contributor
0 Kudos

how are you repeating the target structure? duplicate subtree?

If so direct mapping b/w your source and target field should work right?

Former Member
0 Kudos

Hi Hareesh

Yes i have repeated target structure using duplicate subtree method.

However, on direct mapping while target nodes sometimes pick up wrong values.

For eg:

A1

A1

A1

A1

A2

A2

A1

A2

A3

A3

A1

A3

Regards,

Xineohpi

Former Member
0 Kudos

Hi Vishnu

suborderID>>E1FISEG-XREF3(4 times), transaction ID>>E1FISEG-XREF1(4 times)

Source:

Destination:

  

Regards,

Xineohpi

pvishnuvardan_reddy
Active Contributor
0 Kudos

Hi Xineohpi,

I think you can do this in either of the below two ways.

1. Use remove context, and make sure all the values of input field are in one context, and map this to target node E1FISEG, by this the target node will get created by that many times of the values present in the input field. For the respective target field population, pass the input field(since each occurrence will be present in individual context) as it is, such that respective occurrence of input field value will be mapped to respective occurrence of target field.

2. If you want to duplicate the target node, then duplicate the target node, and for its field population, Use COPYVALUE function for every target field population, and the index of COPYVALUE function you need to mention respectively i.e. for first occurrence of E1FISEG-XREF3, you need to mention the index as 0 such that the first occurrence of suborderID will be passed etc.

Can you please check the above ways and let me know if any issues.

Regards

Vishnu

shivdutt
Explorer
0 Kudos

Hi,

You can try using exists function, check if the node transactioninfo exists then use the node suborderid and set appropriate context. Let me know if it works.

Thanks

Shivdutt