Former Member

# Mapping help

Hi all,

I am new to XI. I have the following requirement.

Mapping a filed in target structure based on the occurrence of a field of a segment.

Say if the segment ABC occurs 5 times in the source structure. A field of segment "XYZ" with value "ITEM" occurs thrice.

I have to get three values of "DEF" of the source structure of "ABC" segment in the target structure where "XYZ" value is "ITEM".

ABC

DEF.... YO

XYZ .... ITEM

ABC

DEF...LU

XYZ... LINE

ABC

DEF...FX

XYZ...ITEM

ABC

DEF..JC

XYZ...LINE

ABC

DEF...MN

XYZ...ITEM

In Target structure field "BRAND" should be mapped with YO, FX, MN, in One record set of the Target.

Thanks,

Karuna.

10|10000 characters needed characters exceeded

### Related questions

• Former Member
Posted on Apr 28, 2008 at 03:11 AM

Hi Karuna,

You can solve your problem by using standard function.

1) Take XYZ as a input , put RemoveContext after that.

2) Take one Constant function assign value = ITEM.

3) Take Equals function from Text Category. Output of 1st and 2nd step consider as input to Equals function.

4) Take DEF as a input , put RemoveContext after that.

5) Take IfWithOutElse function from Boolean Category Output of 3rd and 4th step consider as input to this function.

6) Put SplitByValue(EachValue) after that.

7) Give this as a input to your target field BRAND.

I think this solve your problem.

Regards,

Rohit.

10|10000 characters needed characters exceeded
• Former Member Former Member

Hi Karuna,

Please check occurance of BRAND field.

it should be 0..unbounded may be in your case it is 1..1 check it and reply me back.

For parent node use RemoveContext function before map to target field.

Regards,

Rohit.

• Posted on Apr 29, 2008 at 04:10 AM

Hi Karuna ,

You are getting only BRAND node because you are creating brand three times(in example you have given ) but you are not repeating its parent node for that many time .To varify that just check Display queue of your parent node under which field brand exist and see if there are three occurence of it (Without context change) .Rohit's Solution is perfectly ok .

Thanks

Sunil Singh