cancel
Showing results for 
Search instead for 
Did you mean: 

Difference in XML structure from design time to run time

Former Member
0 Kudos

Hi,

My source message type that i have constructed has the following XML structure

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

<ns0:Messages xmlns:ns0="http://sap.com/xi/XI/SplitAndMerge">

<ns0:Message1>

<ns1:Employee_MT xmlns:ns1="http://accenture.com/RoutingBasedOnContextobjects">

<Record>

<Emp_Header>

<Key/>

<Emp_ID/>

<Emp_Name/>

<Emp_Location/>

</Emp_Header>

<Emp_Weekly_Details>

<Key/>

<Week_No/>

<Week_Hours/>

<Week_Wages/>

</Emp_Weekly_Details>

<Emp_Summary>

<Key/>

<Total_Hours/>

<Total_Wages/>

</Emp_Summary>

</Record>

</ns1:Employee_MT>

</ns0:Message1>

</ns0:Messages>

Whereas when I test the scenario using a test file based on my file content conversion that I have configured in the sender file adapter the XML for the sender message type that is constructed is as follows

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

<ns:Employee_MT xmlns:ns="http://accenture.com/RoutingBasedOnContextobjects">

<Record>

<Emp_Header>

<Emp_ID>1000888</Emp_ID>

<Emp_Name>Alex</Emp_Name>

<Emp_Location>PDC</Emp_Location>

</Emp_Header>

<Emp_Weekly_Details>

<Week_No>1</Week_No>

<Week_Hours>45</Week_Hours>

<Week_Wages>900</Week_Wages>

</Emp_Weekly_Details>

<Emp_Weekly_Details>

<Week_No>3</Week_No>

<Week_Hours>45</Week_Hours>

<Week_Wages>900</Week_Wages>

</Emp_Weekly_Details>

<Emp_Summary>

<Total_Hours>90</Total_Hours>

<Total_Wages>1800</Total_Wages>

</Emp_Summary>

</Record>

<Record>

<Emp_Header>

<Emp_ID>1000880</Emp_ID>

<Emp_Name>Sam</Emp_Name>

<Emp_Location>PDC</Emp_Location>

</Emp_Header>

<Emp_Weekly_Details>

<Week_No>1</Week_No>

<Week_Hours>45</Week_Hours>

<Week_Wages>900</Week_Wages>

</Emp_Weekly_Details>

<Emp_Weekly_Details>

<Week_No>3</Week_No>

<Week_Hours>45</Week_Hours>

<Week_Wages>900</Week_Wages>

</Emp_Weekly_Details>

<Emp_Summary>

<Total_Hours>90</Total_Hours>

<Total_Wages>1800</Total_Wages>

</Emp_Summary>

</Record>

</ns:Employee_MT>

The actual message mapping has the XML structure as

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

<ns0:Messages xmlns:ns0="http://sap.com/xi/XI/SplitAndMerge">

<ns0:Message1>

<ns1:Employee_MT xmlns:ns1="http://accenture.com/RoutingBasedOnContextobjects">

<Record>

</Record>

</ns1:Employee_MT>

</ns0:Message1>

</ns0:Messages>

whereas the XML structure that is being constructed by my sender file adapter is

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

<ns:Employee_MT xmlns:ns="http://accenture.com/RoutingBasedOnContextobjects">

<Record>

</Record>

<Record>

</Record>

</ns:Employee_MT>

Could someone tell me why there is difference in the XML structure that is being generated by my file sender adapter and how can I fix this problem.

As a result of this when i copy the source payload from SXMB_MONI and put it in the test tab of message mapping the XML is not being well formed.

Cheers,

S

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

these tag gets added automatically when u use multimapping concepts(by changing the messge type occ)

copy ur entire source xml (from sxmb_moni) and paste it under the Messages and Message1 tags to test under ESR (test tab):

something like this:


<?xml version="1.0" encoding="UTF-8"?>
<ns0:Messages xmlns:ns0="http://sap.com/xi/XI/SplitAndMerge">
<ns0:Message1>

<ns:Employee_MT xmlns:ns="http://accenture.com/RoutingBasedOnContextobjects">
<Record>
<Emp_Header>
<Emp_ID>1000888</Emp_ID>
<Emp_Name>Alex</Emp_Name>
..................
</Record>
<Record>
..........
</Record>
</ns:Employee_MT>


</ns0:Message1>
</ns0:Messages>

Former Member
0 Kudos

Hi,

From provided message structure i could see the differece that, following node is extra.

<ns0:Message1>

The above node like <ns0:Message1> or <ns0:Message2> is added when you have multi mapping or mapping split. So i suggest you to check at the mapping program , you might have given some value for multi-mapping and or even empty row at test tab of MM. Check that it may help you.

Thanks,

RK