Skip to Content
author's profile photo Former Member
Former Member

Question about File Content Conversion and parent-child relationships...

Hello!

I have read probably every blog, article and SAP Help document on the topic, but I am stuck on this one. I am trying to convert a General Ledger flat file to an IDoc using the classic file --> IDoc scenario. The setup is done and working, but the IDocs are formatted incorrectly and I believe at least part of the reason is how I am converting the file content.

The root of my problem is that the flat file has a parent-child relationship between the document header and the document item and I want to maintain that since the IDoc type (FIDCCP01) has the same structure in the BKPF and BSEG segments.

Here is the flat (non-XML) file layout that is coming into the file adapter:

FileHeader

DocumentHeader

DocumentItem

...

...

...

DocumentHeader

DocumentItem

...

...

...

and so on (until the number of documents is complete

I would really like the content to be converted so that the line items stay under their parent document headers like this:

<FileHeader></FileHeader>

<DocumentHeader>

<ItemHeader>

...

...

...

</ItemHeader>

</DocumentHeader>

<DocumentHeader>

<ItemHeader>

...

...

...

</ItemHeader>

</DocumentHeader>

.....

But I keep getting this, where it lists the document headers first (one after another), and then all of the line items after the document headers like this:

<FileHeader></FileHeader>

<DocumentHeader></DocumentHeader>

<DocumentHeader></DocumentHeader>

<DocumentHeader></DocumentHeader>

<ItemHeader></ItemHeader>

Is is possible to maintain that parent-child relationship from the flat file and pass it over to the XML?

Thanks,

John

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

2 Answers

  • author's profile photo Former Member
    Former Member
    Posted on Jan 31, 2008 at 04:39 AM

    John,

    If you have any key field between the document header and item then you can read easily using the file adapter.

    Regards,

    ---Satish

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      Hi,

      Check some links on FCC.

      /people/venkat.donela/blog/2005/03/02/introduction-to-simplefile-xi-filescenario-and-complete-walk-through-for-starterspart1

      /people/venkat.donela/blog/2005/03/03/introduction-to-simple-file-xi-filescenario-and-complete-walk-through-for-starterspart2

      /people/arpit.seth/blog/2005/06/02/file-receiver-with-content-conversion

      /people/anish.abraham2/blog/2005/06/08/content-conversion-patternrandom-content-in-input-file

      /people/shabarish.vijayakumar/blog/2005/08/17/nab-the-tab-file-adapter

      /people/venkat.donela/blog/2005/03/02/introduction-to-simplefile-xi-filescenario-and-complete-walk-through-for-starterspart1

      /people/venkat.donela/blog/2005/03/03/introduction-to-simple-file-xi-filescenario-and-complete-walk-through-for-starterspart2

      /people/venkat.donela/blog/2005/06/08/how-to-send-a-flat-file-with-various-field-lengths-and-variable-substructures-to-xi-30

      /people/anish.abraham2/blog/2005/06/08/content-conversion-patternrandom-content-in-input-file

      /people/shabarish.vijayakumar/blog/2005/08/17/nab-the-tab-file-adapter

      /people/jeyakumar.muthu2/blog/2005/11/29/file-content-conversion-for-unequal-number-of-columns

      /people/shabarish.vijayakumar/blog/2006/02/27/content-conversion-the-key-field-problem

      /people/michal.krawczyk2/blog/2004/12/15/how-to-send-a-flat-file-with-fixed-lengths-to-xi-30-using-a-central-file-adapter

      /people/arpit.seth/blog/2005/06/02/file-receiver-with-content-conversion

      http://help.sap.com/saphelp_nw04/helpdata/en/d2/bab440c97f3716e10000000a155106/content.htm

      Regards,

      Phani

      Reward points if Helpful 😊

  • author's profile photo Former Member
    Former Member
    Posted on Jan 31, 2008 at 02:20 PM

    Hey Satish;

    You certainly got me in the right direction. I was able to at least get the line items underneath their respective document headers so there is the correspondence within the XML.

    The rest of the change was in the message type; I move the line item to the same level as the document header, instead of a level below, and now the message is getting mapped correctly.

    Thanks!

    John

    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.