cancel
Showing results for 
Search instead for 
Did you mean: 

In message Mapping field

Former Member
0 Kudos

hi,

i have the source structure like

<Header> occurs 0..unbounded

Lineitem 1 occurs 1..1

Lineitem 2 occurs 1..1

Lineitem 3 occurs 0..unbounded

Lineitem 4 occurs 1..1

Lineitem 5 occurs 1..1

Target sturcture

<header> occurs 0..unbounded

Line item 1 occurs 0..1

Line item 2 occurs 0..1

Line item 3 occurs 0..1

Line item 4 occurs 0..1

Now my doubt is Line item 4 is the grand total, if the segments repeats the grandtotal should come in the last occurence of the header. But it is coming in the first occurence of the header.

could you please help me in the regard.

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Can you explain your doubt with an example?

Former Member
0 Kudos

Header> occurs 0..unbounded

Lineitem 1 occurs 1..1

Lineitem 2 occurs 1..1

Lineitem 3 occurs 0..unbounded

Lineitem 4 occurs 1..1

Lineitem 5 occurs 1..1

Target sturcture

<header> occurs 0..unbounded

Line item 1 occurs 0..1

Line item 2 occurs 0..1

Line item 3 occurs 0..1

Line item 4 occurs 0..1

Now my doubt is Line item 4 is the grand total, if the segments repeats the grandtotal should come in the last occurence of the header. But it is coming in the first occurence of the header.

could you please help me in the regard.

Former Member
0 Kudos

I can see the same example in your question, why you are replying the same again???

If you want the ans on SDN you have to be polite and thoughtful.

Former Member
0 Kudos

<?xml version="1.0" encoding="UTF-8" ?>

- <ns0:MT_context xmlns:ns0="/http://Create">

- <Header>

<Matno>001</Matno>

<MatDesc />

- <item>

<matno />

<itemno>1</itemno>

<matgrp />

<price>3</price>

</item>

- <item>

<matno />

<itemno>2</itemno>

<matgrp />

<price>4</price>

03

</item>

- <item>

<matno />

<itemno>3</itemno>

<matgrp />

<price>5</price>

</item>

</Header>

- <Header>

<Matno>002</Matno>

<MatDesc />

- <item>

<matno />

<itemno>01</itemno>

<matgrp />

<price>13</price>

</item>

- <item>

<matno />

<itemno>02</itemno>

<matgrp />

<price>14</price>

</item>

- <item>

<matno />

<itemno>03</itemno>

<matgrp />

<price>15</price>

</item>

</Header>

</ns0:MT_context>

Target is

<?xml version="1.0" encoding="UTF-8" ?>

- <ns0:MT_context_tar xmlns:ns0="http://create">

- <Material_Details>

<matno>001</matno>

<item_details>123</item_details>

<total>12</total>

<grandtotal>54</grandtotal>

</Material_Details>

- <Material_Details>

<matno>002</matno>

<item_details>010203</item_details>

<total>42</total>

</Material_Details>

</ns0:MT_context_tar>

see now the grandtotal is coming in the first material details

but i need in the last material details of the occurence

cud u help me now??

Former Member
0 Kudos

The way you have create your target structure will not help you to get the grand total at last.

Target sturcture should be like this..

>

>-<header> occurs 0..unbounded

>----Line item 1 occurs 0..1

>----Line item 2 occurs 0..1

>----Line item 3 occurs 0..1

>-</header>

>-<GrandTotal> 0..1

>----Line item 4 occurs 0..1

>-</GrandTotal>

>

Do like this and try..

Former Member
0 Kudos

hi sarvesh,

i tried with your idea.

No it is coming as same, now it is coming with node at the same place of the first segment.

regards,

sasi

Former Member
0 Kudos

send the source & target xml structure from your system, then I can try..