Skip to Content
author's profile photo
Former Member

File conversion of complex XML file

Hi,

we are trying to collect several IDOCs to a flat file. Therefore I create one message with the following structure:

<i><File>

<Message>

<Segment1>

<value1>a</value1>

...

</Segment1>

<Segment2>

<value1>b</value1>

...

</Segment2>

</Message>

<Message>

[Same Message body]

</Message>

...

</File></i>

Each segment should be converted to a new line.

Unfortunately this structure is to complex to convert it using the Content Conversion of the file adapter.

Is there any way to solve this problem without using the Append mode of the adapter ?

Best regards,

Linus

Add comment
10|10000 characters needed characters exceeded

3 Answers

  • author's profile photo
    Former Member
    Posted on Jan 18, 2005 at 04:39 PM

    Hi Linus,

    We had the same problem, the only way we could solve it was with the ABAP function IDX_XML_TO_IDOC.

    You can call this function in an ABAP-mapping and put the IDOC in a string message type. Send the string message type to the fileadapter and you have your flat-file IDOC. There is a "how to" guide about abap mappings.

    Cheers,

    Frank

    Add comment
    10|10000 characters needed characters exceeded

  • Posted on Jan 20, 2005 at 10:23 AM

    Hi Linus,

    I am not sure that I understand your problem, is it that you cannot convert a complex XML message to a file, if so could this not be solved by using the dispatcher within the outbound file adapter.

    If you require hints on using the dispatcher please take a look at my previous post using the URL :-

    https://www.sdn.sap.com/sdn/collaboration.sdn?node=linkFnode6-1&contenttype=url&content=https://outbounding-complex-text-files

    If I have completely misunderstood please reply and I will try and help.

    Regards

    Ian Passfield

    Add comment
    10|10000 characters needed characters exceeded

  • author's profile photo
    Former Member
    Posted on Jan 20, 2005 at 01:56 PM

    Hi,

    thanks for your answers.

    The problem in our case is, that there could be "several messages in one", meaning:

    <i><XML Message>

    <SubMessage1>

    <Seg1>

    </Seg1>

    <Seg2>

    </Seg2>

    <Seg2>

    </Seg2>

    <Seg3>

    </Seg3>

    </SubMessage1>

    <SubMessage2>

    <Seg1>

    </Seg1>

    <Seg2>

    </Seg2>

    <Seg2>

    </Seg2>

    <Seg3>

    </Seg3>

    </SubMessage2>

    ...additional submessages...

    </XML Message></i>

    This structure should be converted to the following:

    <i>L1 [Seg1]: value;value;value...

    L2 [Seg2]: value;value...

    L3 [Seg2]: value;value...

    L4 [Seg2]: value;value...

    L5 [Seg3]: value;value...

    L6 [Seg1]: value;value...

    ....</i>

    The problem is, that I don't know how to map the n elements of m complex elements of an XML message to n*m simple elements (which could be converted by the file adapter).

    Could you see my problem?

    Best regards,

    Linus

    Add comment
    10|10000 characters needed characters exceeded