cancel
Showing results for 
Search instead for 
Did you mean: 

Mapping target node with the value from first occurence of a record.

Former Member
0 Kudos

Hi All,

I got an issue while doing a mapping. This is a File ->IDOC scenario

In File I have a structure as below:

<Recordset>

<Header_Rec0>

<STYPE>0</STYPE>

<GROUP>I2139</GROUP>

<MANDT>/</MANDT>

<USNAM>/</USNAM>

<START>/</START>

<XKEEP>/</XKEEP>

<NODATA>/</NODATA>

</Header_Rec0>

<Header_Rec1>

<STYPE>1</STYPE>

<TCODE>FB01</TCODE>

<BLDAT>27082001</BLDAT>

</Header_Rec1>

<Detail>

<NEWKO>1234</NEWKO>

<FDTAG>/</FDTAG>

</Detail>

<Detail>

<NEWKO>/</NEWKO>

<FDTAG>/</FDTAG>

</Detail>

<Detail>

<NEWKO>/</NEWKO>

<FDTAG>/</FDTAG>

</Detail>

</Recordset>

<Recordset>

<Header_Rec1>

<STYPE>1</STYPE>

<TCODE>FB01</TCODE>

<BLDAT>27082001</BLDAT>

</Header_Rec1>

<Detail>

<NEWKO>2234</NEWKO>

<FDTAG>/</FDTAG>

</Detail>

<Detail>

<NEWKO>/</NEWKO>

<FDTAG>/</FDTAG>

</Detail>

</Recordset>

Here I am generating multiple IDOCs based on recordset-In IDOC I need to map Detail -> NEWKO to a value in IDOC

The IDOC is FIDCCPO2 and target field is E1F1SEG->E1FINBU->LIFNR

There will be multiple E1FISEG segments and within each E1FISEG there will be one E1FINBU. I need to populate LIFNR with the NEWKO value from the first record of Detail segment from each recordset for all E1FINBU -> LIFNR fields.

Expected output

IDOC 1

<E1EDKP1>

<E1FISEG>

<Field1>abc</Field1>

<Field2>797</Field2>

<E1FINBU>

<LIFNR>1234</LIFNR>

</E1FINBU>

</E1FISEG>

<E1FISEG>

<Field1>hj</Field1>

<Field2>67</Field2>

<E1FINBU>

<LIFNR>1234</LIFNR>

</E1FINBU>

</E1FISEG>

<E1FISEG>

<Field1>hj</Field1>

<Field2>67</Field2>

<E1FINBU>

<LIFNR>1234</LIFNR>

</E1FINBU>

</E1FISEG>

</E1EDKP1>

<E1EDKP1>

IDOC 2

<E1EDKP1>

<E1FISEG>

<Field1>abcj</Field1>

<Field2>797</Field2>

<E1FINBU>

<LIFNR>2234</LIFNR>

</E1FINBU>

</E1FISEG>

<E1FISEG>

<Field1>ghj</Field1>

<Field2>578</Field2>

<E1FINBU>

<LIFNR>2234</LIFNR>

</E1FINBU>

</E1FISEG>

</E1EDKP1>

<E1EDKP1>

Please suggest a solution, if you have come across a situation before.

Regards,

Tiny

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi Experts,

  Any suggestions??

Regards,

Tiny

nageshwar_reddy
Contributor
0 Kudos

You can achieve required result by using collapseContexts, SplitByValue and useOneAsMany.

Check the below graphical mapping. For NEWKO change the context to RecordSet.

Let me know if this helps?