on ‎2019 Feb 28 8:13 PM
Hi Experts,
We are on SAP PO 7.5.
When we are executing the java mapping in ESR, it is throwing the below error..
Error Details:
Unable to display tree view; Error when parsing an XML document (XML document structures must start and end within the same entity.)
I have verified the output payload and could see the end tag "</ns0:MT_BD_QP_ECC>"is missing after last </row> tag.
It should not repeat after every </row> tag.
Expected output
<?xml version="1.0" encoding="UTF-8"?>
<ns0:MT_BD_QP_ECC xmlns:ns0="urn:BDG-is.com/xi/KWE/KIG/01_db">
<row>
<pSystemId>DUK</pSystemId>
<pRecordType>BD</pRecordType>
<pSourceSystem>SAPXI</pSourceSystem>
<pStatus>1</pStatus>
<pPlantCodeCHO</pPlantCode>
<pBlockCode>B</pBlockCode>
<pDateTimeFrom>2019-01-01T00:00:00.000+00:00</pDateTimeFrom>
<pDateTimeTo>2019-01-31T23:59:59.999+00:00</pDateTimeTo>
<pMaterial>Apple</pMaterial>
<pAmount>106789.055</pAmount>
<pAmountUnit>HW</pAmountUnit>
</row>
<row>
<pSystemId>DUK</pSystemId>
<pRecordType>BD</pRecordType>
<pSourceSystem>SAPXI</pSourceSystem>
<pStatus>1</pStatus>
<pPlantCode>CHO</pPlantCode>
<pBlockCode>B</pBlockCode>
<pDateTimeFrom>2019-01-01T00:00:00.000+00:00</pDateTimeFrom>
<pDateTimeTo>2019-01-31T23:59:59.999+00:00</pDateTimeTo>
<pMaterial>Orange</pMaterial>
<pAmount>189567.055</pAmount>
<pAmountUnit>HW</pAmountUnit>
</row>
</ns0:MT_BD_QP_ECC>
Error Output
<?xml version="1.0" encoding="UTF-8"?>
<ns0:MT_BD_QP_ECC xmlns:ns0="urn:BDG-is.com/xi/KWE/KIG/01_db">
<row>
<pSystemId>DUK</pSystemId>
<pRecordType>BD</pRecordType>
<pSourceSystem>SAPXI</pSourceSystem>
<pStatus>1</pStatus>
<pPlantCodeCHO</pPlantCode>
<pBlockCode>B</pBlockCode>
<pDateTimeFrom>2019-01-01T00:00:00.000+00:00</pDateTimeFrom>
<pDateTimeTo>2019-01-31T23:59:59.999+00:00</pDateTimeTo>
<pMaterial>Apple</pMaterial>
<pAmount>106789.055</pAmount>
<pAmountUnit>HW</pAmountUnit>
</row>
<row>
<pSystemId>DUK</pSystemId>
<pRecordType>BD</pRecordType>
<pSourceSystem>SAPXI</pSourceSystem>
<pStatus>1</pStatus>
<pPlantCode>CHO</pPlantCode>
<pBlockCode>B</pBlockCode>
<pDateTimeFrom>2019-01-01T00:00:00.000+00:00</pDateTimeFrom>
<pDateTimeTo>2019-01-31T23:59:59.999+00:00</pDateTimeTo>
<pMaterial>Orange</pMaterial>
<pAmount>189567.055</pAmount>
<pAmountUnit>HW</pAmountUnit>
</row>
In our mapping, we are using startElement / endElement (String uri, String localName, String qName) methods to Receive notification of the start and end of an element.
public void endElement (String uri, String localName, String qName) throws SAXException
{
newContent = true;
if(qName.equals("row"))
{
if(currentRecord.flag != null &&
currentRecord.flag.equals("OK")) // Create result entry if flag OK set
{
if (targetsystem.equals("ECC")) // ECC Result
{
// ECC is only interested in records having VTBT_DATUM >= 2010
if(Tools.DateHasValidYearECC(currentRecord.VTBT_DATUM, 2010))
{
mapToTargetRecordsXem();
}
}
}
}
else if(qName.equals("ES_MT_BD_QP_transit_ECC"))
{
// end ECC result document
result.append("</ns0:MT_BD_QP_ECC>");
}
}
Help others by sharing your knowledge.
AnswerRequest clarification before answering.
Hi Hasan,
Thanks for your reply.
It's error while pasting the payload here. We could see the below code in the output payload.
<<pPlantCode>CHO</pPlantCode>
Only problem is with end tag </ns0:MT_BD_QP_ECC>
Regards
Bhargava Krishna
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
| User | Count |
|---|---|
| 9 | |
| 5 | |
| 4 | |
| 4 | |
| 3 | |
| 3 | |
| 2 | |
| 2 | |
| 2 | |
| 2 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.