Hi All,
I have a requirement related to Mapping and need your help on this. There is a financial posting Interface and the data is being fetched from database using strored procedure.
The source file is having structure like as shown below
<FIExport>
<resultset>
<row>
<headerid>12345</header id>
<field2>5</field2>
<field3>1</field3>
<field4>29</field4>
<field5>3</field5>
</row>
<row>
<headerid>12345</header id>
<field2>5</field2>
<field3>1</field3>
<field4>48</field4>
<field5>3</field5>
</row>
<row>
<headerid>12345</header id>
<field2>5</field2>
<field3>1</field3>
</field4>
<field5>3</field5>
</row>
<row>
<headerid>12346</header id>
<field2>5</field2>
<field3>1</field3>
<field4>2</field4>
<field5>3</field5>
</row>
<row>
<headerid>12347</header id>
<field2>5</field2>
<field3>1</field3>
<field4>2</field4>
<field5>3</field5>
</row>
</resultset>
</FIExport>
Condition:
For creating target structure follwoing conditions are required
1) IDOC at receiver side will be created as per unique header id therefore in the current source structure 3 Idocs will be created for 3 unique header id like 12345 , 12346 , 12347
2) Target EIFISEG which is line item will be created based on per row per unique header id under each IDOC and there has to be 2 SEGMENTS (2A & 2B ) per row based on the VAT amount presence and also two additional E1FISEG has to be created statically per idoc for BSCHL = 34
so for the above source structure the target should have number of EIFISEG as follows:
As there are 3 rows for header id 12345, therefore under IDOC1 the number of EIFISEG will be
since VAT Amount(field 4) is present therefore for 2rows of 12345 header id IDOC it will generate 2X2=4 , E1FISEG segments (each for 2A & 2B) and 1 E1FISEG for 3 row of header id IDOC 12345.
In addition to this 2 additional segment will be created for BSCHL=34( it's duplicate segment of E1FISEG, so no issues in this)
Total number of E1FISEG segments in IDOC for header id(12345) will be = 4 + 1 + 2 = 7 segments
Similarly for IDOC with header id (12346) the total number of EIFISEG will be = 2( 2A & 2B as vat amount (field 4) is present + 2(bschl =34) = 4 segments
Similarly for IDOC with header id(12347) the total number of E1FISEG will be = 2( 2A & 2B as vat amount (field 4) is present + 2(bschl =34) = 4 segments
So the target strcuture should look like:
Target Structure
IDOC1 for header id= 12345
E1FIKPF
field 1
E1FISEG1
field 2
E1FISEG2
field 2
E1FISEG3
field 2
E1FISEG4
field 2
E1FISEG5
field 2
E1FISEG6
field 2
E1FISEG7
field 2
IDOC1 for header id= 12346
E1FIKPF
field 1
E1FISEG1
field 2
E1FISEG2
field 2
E1FISEG3
field 2
E1FISEG4
field 2
IDOC1 for header id= 12347
E1FIKPF
field 1
E1FISEG1
field 2
E1FISEG2
field 2
E1FISEG3
field 2
E1FISEG4
field 2
Please help me to complete this mapping requirement as it seems to be complex.
Thanks & Regards
Prabhat