cancel
Showing results for 
Search instead for 
Did you mean: 

context change copy value

former_member188791
Participant
0 Kudos

Hi Group,

I am working on IDOC to file scenario, tI have the below structure, I have ZADR segmen which is having NAME1 field , for each ZSEG1 I am getting two ZADR segments every time , for mapping I need to select the NAME1 field from second ZADR segment , I was using COPYVALUE[1] , it works fine when single ZSEG segment comes , but for multiple ZSEG its not able to create second NAME1 node at target end, can any body suggest how to acheive using Graphical mapping or UDF.

ZAWB01

     |

     |______ZHDR

                   |

                   |____ZSEG1(0..Unbound)

                             |

                             |___ZADR(0..Unbound)

                                        Name1

NAME1(IDOC source) ---Copyvalue[1}-->NAME1(target)

Accepted Solutions (1)

Accepted Solutions (1)

stefan_grube
Active Contributor
0 Kudos

copyValue will always copy the values of first context an cannot be used in your scenario. You can use index function, then you can check if index = 1 or 2.

former_member188791
Participant
0 Kudos

HI Stefan,

Thank you for your response, is it index function in TEXT group or index function in Statistics,I was assuming its from text group , but its asking two inputs, can you please elaborate

stefan_grube
Active Contributor
0 Kudos

No, I mean the statistics function. It just counts the occurance within a context.

former_member188791
Participant
0 Kudos

but counting context will not helping me to map the second node value to target field, I am little bit confused ho this will help

stefan_grube
Active Contributor
0 Kudos

It does not count the context. It counts the occurance within a context. Like this: a - b -> 1 - b -> 2 - b -> 3 a - b -> 1 - b -> 2 a - b -> 1 So you can compare the result of index funtion with 2 NAME1 -index - equals - ifwithoutelse - NAME1 Set the context of NAME1 to ZSEG1 (or check what is best for it)

former_member188791
Participant
0 Kudos

Thanks Steve it works.

Answers (0)