on 04-07-2014 3:02 PM
Error in UseOneAsMany Function Error in SAP XI
Hi Experts,
I am trying the Example of function UseOneAsMany. My Input and Output XML Files are provided below:
<?xml version="1.0" encoding="UTF-8"?>
<ns0:MT_MM4 xmlns:ns0="http://test/mapping.test">
<Header>
<MatNo>MatNo</MatNo>
<MatDesc>MatDesc</MatDesc>
</Header>
<Item>
<MatNo>MatNo1</MatNo>
<ItemNo>ItemNo1</ItemNo>
<MatGroup>MatGroup1</MatGroup>
<Mattype>Mattype1</Mattype>
<Plant>Plant1</Plant>
</Item>
<Item>
<MatNo>MatNo2</MatNo>
<ItemNo>ItemNo2</ItemNo>
<MatGroup>MatGroup2</MatGroup>
<Mattype>Mattype2</Mattype>
<Plant>Plant2</Plant>
</Item>
</ns0:MT_MM4>
My Expected Output should be :
<?xml version="1.0" encoding="UTF-8"?>
-<ns0:MT_MM4R xmlns:ns0="http://test/mapping.test">
-<Header>
<MatNo>MatNo</MatNo>
<MatDesc>MatDesc</MatDesc>
<MatGroup>MatGroup1</MatGroup>
</Header>
-<Item>
<MatNo>MatNo1</MatNo>
<ItemNo>ItemNo1</ItemNo>
<Mattype>Mattype1</Mattype>
<Plant>Plant1</Plant>
</Item>
-<Header>
<MatNo>MatNo</MatNo>
<MatDesc>MatDesc</MatDesc>
<MatGroup>MatGroup2</MatGroup>
</Header>
-<Item>
<MatNo>MatNo2</MatNo>
<ItemNo>ItemNo2</ItemNo>
<Mattype>Mattype2</Mattype>
<Plant>Plant2</Plant>
</Item>
</ns0:MT_MM4R>
But for me Headers are coming first and then followed by two items. Please let me know how to solve the issue and also please provide the explanation.
Thanks,
GIRIDHAR
Hello,
Change ur structure little bit (add parent node "Record") and then use java mapping pasted in below blog to remove Record node to get ur desired structure.
<?xml version="1.0" encoding="UTF-8"?>
-<ns0:MT_MM4R xmlns:ns0="http://test/mapping.test">
<Record> --- 0..Unbounded
-<Header>
<MatNo>MatNo</MatNo>
<MatDesc>MatDesc</MatDesc>
<MatGroup>MatGroup1</MatGroup>
</Header>
-<Item>
<MatNo>MatNo1</MatNo>
<ItemNo>ItemNo1</ItemNo>
<Mattype>Mattype1</Mattype>
<Plant>Plant1</Plant>
</Item>
</Record>
<Record>
-<Header>
<MatNo>MatNo</MatNo>
<MatDesc>MatDesc</MatDesc>
<MatGroup>MatGroup2</MatGroup>
</Header>
-<Item>
<MatNo>MatNo2</MatNo>
<ItemNo>ItemNo2</ItemNo>
<Mattype>Mattype2</Mattype>
<Plant>Plant2</Plant>
</Item>
</Record>
</ns0:MT_MM4R>
Thanks
Amit Srivastava
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Giri,
your output and expected output structure is not same. MatGroup is not present in your output structure.
Please check your output structure.
regards,
Harish
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Harish,
My Expected Output should be like this.
<?xml version="1.0" encoding="UTF-8"?>
-<ns0:MT_MM4R xmlns:ns0="http://test/mapping.test">
-<Header>
<MatNo>MatNo</MatNo>
<MatDesc>MatDesc</MatDesc>
</Header>
-<Item>
<MatNo>MatNo1</MatNo>
<ItemNo>ItemNo1</ItemNo>
<Mattype>Mattype1</Mattype>
<Plant>Plant1</Plant>
</Item>
-<Header>
<MatNo>MatNo</MatNo>
<MatDesc>MatDesc</MatDesc>
</Header>
-<Item>
<MatNo>MatNo2</MatNo>
<ItemNo>ItemNo2</ItemNo>
<Mattype>Mattype2</Mattype>
<Plant>Plant2</Plant>
</Item>
</ns0:MT_MM4R>
Regards,
GIRIDHAR
Hi Giri,
you can not change the position of header using graphical mapping if they are in same level.
You need to use XSLT or Java map to chagne the position.
But why you want second header to come after item/items. I think it is better to change the output structure and place item under the header segment.
regards,
Harish
Hi Giri - Both Header and Item are under same level?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
83 | |
9 | |
9 | |
8 | |
7 | |
7 | |
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.