cancel
Showing results for 
Search instead for 
Did you mean: 

Mapping logic required

Former Member
0 Kudos

Hi All,

A segment E1BLINE in the source IDOC can repeat multiple times(0..999) and at the target that many times the record needs to be generated.

In the target record strucutre a field say ABC is mapped to a feild in XYZ in segment E2ES (0..999) .But the test IDOC doesnt have these segment data ,suppose if segmnt E1BLINE repeats 2 times i am getting 2 records in target structure but the field ABC should have blank values in each record as if there is no data in the source.I am unable to get the logic .

Thanks in advance

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

HI manu,

might be it's helpful for ur mapping:

QUALI1 -> exists -> constant (true) -> equals -> if -> then -> field1 -> cretaeif-> target.

thanks,

Former Member
0 Kudos

Hi All,

IN E2ES qualifier 200 will come not more than 2 times becaues in IDOC we are getting LINE Segment 2 times.

SO if qualifier 200 repeats twice s I can easily create target. But Qualifier100 is coming only once. In this situation How would I handle this on my mapping.

Thanks,

Manisha.

PriyankaAnagani
Active Contributor
0 Kudos

Hi manu,

Try this logic...

UseoneAsMany--->ABC

UseoneASmany:

input1:Qualifier100

input2:LINESegment

input3:LINE segment-->splitByeachvalue

Regards,

Priyanka

Former Member
0 Kudos

hi ,

might be that is possiable with use one as many node function what was posted by Girii but target field before we need to use "SplitByValue(EACh value)"

thanks,

Former Member
0 Kudos

HI Priyanka ,

I cannot use Use one as many becoz i can even get QUALI =100 two times if it comes two times then each corresponding FIELD1 may have different value.

If QUALI comes once then corresponding FIELD1 value shouls be passed to ABC in 1st record and in 2nd record i need a blank to be passed to ABC.

PriyankaAnagani
Active Contributor
0 Kudos

Hi,

UDF-->ABC

input1:LINEsegment

input2:Qualifier100

for(int i=0; i<input1.length;i++){

if(input2(i) == null)

result.addValue(" "); //if input is not coming add space

else

resultaddValue(input2(i));//else add the source value as it is

}

Thanks,

Priyanka

Former Member
0 Kudos

HI ,

i'll try and get back to you

markangelo_dihiansan
Active Contributor
0 Kudos

Hello,

Please provide us your sample input/output structure along with the test values. It would help us visualize better.

Regards,

Mark

venkatagiri_gongadi
Participant
0 Kudos

Hi.

try with below one.

QUALI1(ni1)>E2ES(in2)>E2ES(in3)>UseOneAsMany->Target

GreatDay..

Girii

PriyankaAnagani
Active Contributor
0 Kudos

Hi,

>>>but the field ABC should have blank values in each record as if there is no data in the source

Try using mapwithdefault...

E1BLINE--->targetRecordNode

sourceField>mapwithdefault(with blank space)>ABC

Regards,

Priyanka

Former Member
0 Kudos

Hi Priyanka,

my actual requirement is as follows

for example:

There are 2 segments LINE Segment E2ES Segment. I need to generate target file records based on LINE SEgmentIn my input data I am getting 2 LINE SEGMENTS so I am generating 2 records in the output file. But some of the fields in target comes from E2ES Segment.

LINE segment 2 times so no of recordsets =2 .(which i am able to generate)

E2ES segment has 4 fields. QUALI1 , FIELD1,QUALI2 , FIELD2

If QUALI1 = 100 , FIELD1--> ABC

If QUALI2 = 200 , FIELD2--> HBY

If QUALI2 = 200 , FIELD2--> HBY

If QUALI2 is used i can easily get 2 HBY fields at target .But how do i get two ABC fields

Former Member
0 Kudos

Hi Manu

You can use node function exists to ahieve

QUALI1 ---> exists ---> True ---> create -->FIELD1

Regards

Ramesh