Skip to Content
0
Aug 07, 2016 at 09:52 PM

Mapping Query

36 Views

Hi All,

We have an IDoc to File scenario.

For one particular IDoc segment we need to do the following.

Considering the segment is as below.

Segment

Field1

Field2

Field3

Field4

This segments occurs multiple times in all IDocs. Field1,Field2 and Field4 are mapped directly to File Fields in target.

Now if Field3 is 0 in a particular segment then we will not be populating the values of Field1,Field2 and Field4 in corresponding target fields. We will only populate values of Field1,Field2 and Field4 in target only for the segment where Field3 is not equals 0.

However, if all the segments contains Field3 as 0 then we need to populate only the values of Field1, Field2 and Field4 from the values of first segment..

i.e. say

Segment[1]

Field1 1

Field2 2

Field3 0

Field4 4

Segment[2]

Field1 2

Field2 4

Field3 3

Field4 8

Segment[3]

Field1 3

Field2 6

Field3 1

Field4 2

In this scenario we need to populate the target fields with values from Segment[2] and Segment[3].

However if it looks like

Segment[1]

Field1 1

Field2 2

Field3 0

Field4 4

Segment[2]

Field1 2

Field2 4

Field3 0

Field4 8

Segment[3]

Field1 3

Field2 6

Field3 0

Field4 2

i.e all the segments have Field3 as 0 then we need to populate only values from Segment[1].

While implementing first scenario is simple to me, I am not able to figure out how to do it for all 0s and also to combine them together.

Thanks,

Shaibayan