cancel
Showing results for 
Search instead for 
Did you mean: 

mapping prob

Former Member
0 Kudos

Mapping issues:

File to Multiple IDOC (propagation)

Each record in file creates N number of IDOCS

So no of records in file is less than number of IDOCS generated.

Problem: A particular field in source record needs to be replicated to the IDOCS it generated. Suppose the value in that field changed in second record ,the IDOCS spurned by it should reflect the changes.

Need help.

Thanks

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

First of all you change the no. of occurrence of the IDoc from 1 to 1..unbounded using michal's weblog:

/people/michal.krawczyk2/blog/2005/12/04/xi-idoc-bundling--the-trick-with-the-occurance-change

Then you have to use the context functions in your mapping to get the output as you expected.

Also can you please give the source structure or the source payload so that anyone from SDN can help you.

---Satish

Former Member
0 Kudos

i have already chganged IDOC occurrence to unbounded by importing it as an XSD and changing occurrence.

Source file : 2 records

1)

Name

Age

Address : US

This gives 10 idocs.

2)

Name

Age

Address : UK

This gives 5 idocs

So the first 10 idocs should be populated with US

and 5 after that should have address as UK.

Thanks

Former Member
0 Kudos

Hi,

So you want 2 Idocs for US and 1 Idoc for UK.

If it is not what you are expecting please give additional information like what you want etc

---Satish

Former Member
0 Kudos

10 idocs having value of address populated as US

and 5 after that having address field populated as UK.

Thanks

Former Member
0 Kudos

souce is a file with 2 records

but target is an idoc.

each record of source file generated multiple idocs as mentioned previously.

Thanks

Former Member
0 Kudos

To make it more clear ,we want correspondence b/w source record and target idocs.

if A source record ( Having Adddress as US) generates I,J,K Idocs then these IDOCS should have their address field populated as US

if B source record ( Having Adddress as UK) generates A,B,C Idocs then these IDOCS should have their address field populated as UK.

I hope problem is clear now?

Thanks

Former Member
0 Kudos

So for each address you need to have a Idoc. Just map the address to the Idoc with Splitbyvalue for each.

---Satish

Former Member
0 Kudos

it does not give expected result.

Address(source) ->split by value -> Address(IDOC)

what this does is :suppose 10 idocs for first record and 5 IDOCS for second record ,then it populates first IDOC with US and second with UK.

BUT WHAT I WANT : <b>10 idocs with US and 5 after that with UK</b>.

Thanks

Former Member
0 Kudos

Hi,

Can you use Address(source) ->RemoveContext->IDOC. Not with the address (IDOC).

---Satish

Former Member
0 Kudos

I did not understand what solution u said.

I cannot map in receiving side to IDOC noce since it is already mapped with a lookup function.

Thanks

Former Member
0 Kudos

Hi,

Follow the steps

1. Define a UDF duplicateContent (with 2 parameters a and b and with the cache set to Context):

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

for (int j = 0; j < Integer.parseInt(b[0]); j++){

result.addValue(a[0]);

}

}

2.Address-> SplitByValue \

duplicateContent ->removeContent -> IDoc

State -> Fix value /

FixValue :-

US=10

UK=5

Note--Splitbyvalue and Fixvalue are input to DUplicateContent UDF

3.Mapping for Address field in the Idoc

State \

duplicateContent -> SplitByValue -> Address(Idocs field)

State--> FixValue /

Note --State and Fixvalue is the input to the Duplicate content UDF

Regards,

Ashwin M

Reward if helfpul

Former Member
0 Kudos

hi :

could u send me screenshots ?

i cannot understand it properly.

Thnx

Former Member
0 Kudos

secondly the Fix value 5 and 10 u r telling???

looks not justified as i was ust giving an example ,we dont know how many IDOCS will be spurned for each record,

we cannot record the fix value as 10 and 5.

Thnx

Answers (0)