cancel
Showing results for 
Search instead for 
Did you mean: 

Query related message mapping: Play with queue.

Former Member
0 Kudos

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

Accepted Solutions (1)

Accepted Solutions (1)

stefan_grube
Active Contributor
0 Kudos

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.

Former Member
0 Kudos

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

Answers (2)

Answers (2)

Former Member
0 Kudos

regards

Naina

Former Member
0 Kudos

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