Skip to Content

IDOC to flat file and vice versa

Dear community,

we should send IDOCs to flat files and read plain files and map them to IDOCs.

Is there any comfortable way to do this without doing a huge content conversion for

IDOCs? Exist a SAP standard for such process?

We receive the IDOC as normal IDOC. Would it be more easy to save the IDOCs

directly as flat file on ERP file system??

System PI 7.11




Edited by: Christian Riekenberg on Feb 1, 2012 2:41 PM

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

3 Answers

  • Best Answer
    Posted on Feb 01, 2012 at 03:53 PM


    there is even a blog from Bill about this:

    + remember that only from 7.31 you can create multiple IDOCs in one flat file (and the other way round)

    till 7.31 you can only work on single IDOC basis


    Michal Krawczyk

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member

      Hey folks!

      We have a PI 7.31 SPS5 Java-only installation here and are using the module IDOCFlatToXmlConvertor. For single IDocs with one line for the EDC_DC40 header and the others for the IDoc payload the conversion works. But when we want to process multiple IDocs from the same type within one file, we see this error in the log:

      Module Exception ' No data segments for DOCNUM = ' found, cause: <null>

      Are there any requirements how the multiple IDocs have to be structured within the file?

      Best regards



      I found out that the module wants each record to contain the corresponding DOCNUM to find the matching records. The non-SAP sender system normally does not set this value. Is there a way to "convince" the module to convert the IDocs nevertheless?

  • author's profile photo Former Member
    Former Member
    Posted on Feb 01, 2012 at 03:42 PM


    If the target format is the flat idoc format then the best scenario is to save the idoc from the ECC system as flat and then transfer the file as a normal file-to-file pattern.

    In this case the return flow flat idoc inbound to the ECC would be a bit more complex, but if you don't need any changes in the idoc then you can also do file to file and then use startrfc (if that's still available) []

    If however the target format is a different file you then need the xml idoc with mapping and file content conversion and vice-versa.



    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Feb 01, 2012 at 01:48 PM
    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.