on 10-03-2008 10:18 AM
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.
Can you explain your doubt with an example?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.
<?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??
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..
User | Count |
---|---|
87 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.