Skip to Content
avatar image
Former Member

Query related message mapping: Play with queue.

Hi

i have a text file which i converting using File Content Conversion of file sender adapter. My file was very nested so i couldn't convert it the way i wanted i.e.

<Header></Header>

<Detail>

<Weights></Weights>

</Detail>

<Trailer></Trailer>

So now I m left with this kind of source xml:

<ns: MT_REQ>

<header>

............

</header>

<Detail>

........

........

</Detail>

<Weight>

........

..........

</Weight>

<Weight>

..........

...........

</Weight>

<Detail>

........

........

</Detail>

<Weight>

........

..........

</Weight>

<Weight>

..........

...........

</Weight>

<trailer>

.........

</trailer>

And i want to map it to the same message type <ns: MT_REQ> but due to queuing of data it gives the following result:

<ns: MT_REQ>

<header>

<Identifier>H</Identifier>

............

</header>

<Detail>

<Identifier>D</Identifier>

Identifier>

........

</Detail>

<Detail>

<Identifier>D</Identifier>

........

</Detail>

<Weight>

<Identifier>W</Identifier>

..........

</Weight>

<Weight>

<Identifier>W</Identifier>

...........

</Weight>

<Weight>

<Identifier>W</Identifier>

..........

</Weight>

<Weight>

<Identifier>W</Identifier>

...........

</Weight>

<trailer>

<Identifier>T</Identifier>

.........

</trailer>

i.e. all detail together then weights and header trailer on top and bottom. Now the problem is there is no relation between the weights and detail except that in the monitoring it comes like

1. First detail tag opens and closes with its data

2 then weights which are the heirarchy detail 1 open and closes

3 then second detail opens and closes and then weights of second detail comes under it before any third detail tag opens

So i was wondering if with the help of functions provided in the message mapping it will generate exact mirror image of my source <ns: MT_REQ> into the target <ns: MT_REQ1> which is the exact replica of the former.

I tried it with FormatByExample but dd not work. Is there any Userdefined function or something foe my problem.

Please help !!

Naina

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

3 Answers

  • Best Answer
    Jun 10, 2010 at 02:18 PM

    Do not use ignorerecordset=true, as the record is an important keeper of the context.

    Alternating lines in a files can be handled with parameter: record sequence = ascending,

    then you have following result:

    record

    - detail

    - weight

    - weight

    record

    - detail

    - weight

    ...

    so the detail nodes and corresponding weight nodes are in same context regarding record.

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member

      Stefen

      My Inbound file was coming correctly like this :

      record

      - detail

      - weight

      - weight

      record

      - detail

      - weight

      ...

      but when mapping to the target in same style it was going this way

      - detail

      - detail

      - weight

      - weight

      - weight

      ...

      so what i did...i asked the portal people to add an identifier to the details and weights so that i can read it and write a UD to finally map it correctly:

      - 1detail

      - 2detail

      - 1weight

      - 1weight

      - 2weight

      - 2weight

      ...

      it is working properly now....thanks to you all.....have given the points

  • avatar image
    Former Member
    Jun 10, 2010 at 03:05 PM

    Hi Naina,

    There is no need to write the UDFs.

    Check this links and use the key field

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

    /people/shabarish.vijayakumar/blog/2007/08/03/file-adapter-receiver--are-we-really-sure-about-the-concepts

    https://wiki.sdn.sap.com/wiki/display/XI/XI_File_Content

    Regards

    Ramesh

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Jun 16, 2010 at 07:14 AM

    regards

    Naina

    Add comment
    10|10000 characters needed characters exceeded