cancel
Showing results for 
Search instead for 
Did you mean: 

mapping error when multiple occurs

Former Member
0 Kudos

ahi friends

iam doing fail to idoc secinario in that

iam using split function(UDF) for splitting.

it is working good

my problem is

iam using MATMAS03 .

in that

E1MACM segment is repeting multiple times .

in E1MARCM segment i have 1 z segment ane some standard segments.

when E1MARCM segment is repeted then in that first segemnt is getting all the values (eleiments and segments).

but from next segment onwords

E1MARCM sement is comming with eliments

but iam not getting the segments.

pls help me on this .

with regards

srikanth vipparla.

Accepted Solutions (0)

Answers (3)

Answers (3)

sunil_singh13
Active Contributor
0 Kudos

Hi Srikanth

Apply Same logic at sub_seg Node also so that it will create that many nodes as e3 field and you would be able to see the sub_seg for nex seg . If yet not cleare Please revert back .

Reward points if Helpful

Thanks

Sunil Singh

Former Member
0 Kudos

Hi,

Please Mapp the Segments which is after E1MARCM segment with the Source Segments of same Occurence Value.

Ex: 0.....1 -


Mapp to 0.....1

0....Unbounded to 0.....unbounded

I think in Your target IDOC structure you have the Segments with 0....1 occurence after E1MARCM segment .

So mapp those Target segments which is having 0..1 with the segment which is present in Source structure with 0...1 Occurence.

Regards

Seshagiri

Former Member
0 Kudos

I think there is a context problem in your mapping. Check the queue output just before the target node, if all are in one context then again use the splitByValue function.

Former Member
0 Kudos

thanks for replay

iam alredy check this .

i will explain with example.

source:

<seg>

<e1>test</e1>

<e2>test</e2>

<sub_seg>

<e3>te,tt,yy,tu<e3>

<e4>tr<e4>

</sub_seg>

<seg>

<seg>

<e1>test</e1>

<e2>test</e2>

<sub_seg>

<e3>r1,r2,r3,r4u<e3>

<e4>tr<e4>

</sub_seg>

<seg>

target:

<seg>

<e1>test</e1>

<e2>test</e2>

<sub_seg>

<e3>te<e3>

<e4>tr<e4>

</sub_seg>

<sub_seg>

<e3>tt<e3>

<e4>tr<e4>

</sub_seg>

<sub_seg>

<e3>yy<e3>

<e4>tr<e4>

</sub_seg>

<sub_seg>

<e3>tu<e3>

<e4>tr<e4>

</sub_seg>

<seg>

<seg>

<e1>test</e1>

<e2>test</e2>

<sub_seg>

<e3>r1<e3>

<e4>tr<e4>

</sub_seg>

<sub_seg>

<e3>r2<e3>

<e4>tr<e4>

</sub_seg>

<sub_seg>

<e3>r3,<e3>

<e4>tr<e4>

</sub_seg>

<seg>

like this i need ouput

but iam getting like this

<seg>

<e1>test</e1>

<e2>test</e2>

<sub_seg>

<e3>tt,<e3>

<e4>tr<e4>

</sub_seg>

<sub_seg>

<e3>ty,<e3>

<e4>tr<e4>

</sub_seg>

<sub_seg>

<e3>yy<e3>

<e4>tr<e4>

</sub_seg>

<sub_seg>

<e3>tu<e3>

<e4>tr<e4>

</sub_seg>

</seg>

<seg>

<e1>test<e1>

<e2>test<e2>

</seg>but i need sub eliments also inthat segment.

pls help to me

with regards

sriokanth vipparla

<seg>

Edited by: srikanth vipparla on Apr 29, 2008 10:48 AM

Former Member
0 Kudos

Hi,

This is nothing but context problem.

Try by using RemoveContext before map root element i.e seg.

And for child element use SplitByValue.

Regards,

Rohit.

Rewards point if useful.

Former Member
0 Kudos

Srikant,

If I understand right this is a n->1 muli-mapping scenario.

To get the sub-elements correponding to the second input message also, change the context of the e3 & e4 nodes to the top-most root element - should be 'Messages' I presume.

Thanks,

Anand

Former Member
0 Kudos

when i try with point to point mapping it is working

but when i included the UDF it is not working

iam using this code at udf

String[] result1=a[0].split(",");

for (int x=0; x<result1.length; x++)

result.addValue(result1[x]);

i think

when E1MARCM segment s repeting a[0]

also inkrimeted a[1].

if is correct then

tell me how to increment the a value

pls help me

with regards

srikanth vipparla.

Former Member
0 Kudos

Hi,

when E1MARCM segment s repeting a[0]

also inkrimeted a[1].

if is correct then

tell me how to increment the a value

Yes you are right for multiple occurance of a you have to increment 0 to 1, you can do this in following way.

for (int y=0; y<a.length; y++)

{

String[] result1=a[y].split(",");

for (int x=0; x<result1.length; x++)

result.addValue(result1[x]);

}

After UDF you have to use SplitByValue before map to target field.

I think this will solve your problem.

Regards,

Rohit

Reward points if helpful.

Former Member
0 Kudos

thanks for ur replay

but this functinality is not working

it is giving mapping error

telme

hoe to solve this

with regards

srikath vipparla.

Former Member
0 Kudos

Hi,

May be input for UDF is ContextChange (i.e gray color value).

So try by putting RemoveContext before UDF.

May this will solve your problem.

Regards,

Rohit

Reward points if helpful.