cancel
Showing results for 
Search instead for 
Did you mean: 

flat file to multiple IDOCs

Former Member
0 Kudos

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.

Accepted Solutions (0)

Answers (3)

Answers (3)

former_member184619
Active Contributor
0 Kudos

Hi Raju,

check these links...

/people/anish.abraham2/blog/2005/12/22/file-to-multiple-idocs-xslt-mapping

https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/877c0d53-0801-0010-3bb0-e38...

Sachin

Former Member
0 Kudos

your requirement is for new value in field PO_HEADER_ID , you want to create IDoc at target.. then map it like

PO_HEADER_ID ---> splitbyvalue(value changed) -


> IDoc

split by value will automatically change the context and next value will get place in 2nd occurrence of IDoc

just give a try

Former Member
0 Kudos