Skip to Content
0
Former Member
Nov 07, 2007 at 08:15 AM

flat file to multiple IDOCs

87 Views

Hi experts,

I have a bit of a problem here wit a flat file to IDOC interface.

My input CSV file structure (shortened) is as follows -

<?xml version="1.0" encoding="UTF-8"?>

<ns0:POINBOUND_MT xmlns:ns0="urn:xx:xi:dwn:xx:pf:xxx:poinbound:100">

<Record>

<Row>

<PO_HEADER_ID/>

<TYPE_LOOKUP_CODE/>

<LINE_NUM/>

..........

..........

<AMOUNT_LIMIT/>

</Row>

</Record>

</ns0:POINBOUND_MT>

the target side is an idoc - PORDCR1.PORDCR102.

in the input file, for each row the PO_HEADER_ID field will have repeated values. the structure for eg.-

PO_HEADER_ID < other fields> < otherfields> ...

12345 <other fields>..<.. >

12345 <other fields>..<..>

12345 <other fields>..<..>

56789 <other fields>..<..>

56789 <other fields>..<..>

Now i need two idocs ( 2 distinct header values) on target side - the 1st idoc will have first 3 line items and 2nd idoc will have the last 2 line items. have already edited the IDOC in xsd format to make it unbounded.

<b><u>Problem</u></b> - i am able to create two idocs by handling contexts(splitbyvalue and a UDF), but with the line items its not working i.e. <u>the first idoc gets the 3 line items created but the 2nd idoc does not have any!</u>

my mapping for line items is -

PO_HEADER_ID < -> splitbyvalue(value changed) < -> count < -- -> UDF (for result.addvalue using count) < -----> lDOC LINE_ITEM node.

This logic does not work incase i need to create more than one idoc on the target side, it only works for the first idoc..so wat can i do??

Plz help.

thnx in advance!

Raju.