cancel
Showing results for 
Search instead for 
Did you mean: 

Error when parsing the XML document

rodrigoalejandro_pertierr
Active Contributor
0 Kudos

hi all.

i have the next problem.

the sender sistem send to XI an XML. some tags send a '#' caracter.

Sender Service send:

-


Torre B1 - B#Unimev

when Im traying to test XML inbound, XI show the next error:

Error when parsing the XML document (Fatal Error: com.sap.engine.lib.xml.parser.ParserException: Invalid char #0x14(:main:, row:1, col:992))

XML:

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

- <ZDEBMAS6>

- <IDOC BEGIN="1">

- <EDI_DC40 SEGMENT="1">

<TABNAM>EDI_DC40</TABNAM>

<MANDT>300</MANDT>

<DOCNUM>0000000000339708</DOCNUM>

<DOCREL>640</DOCREL>

<STATUS>30</STATUS>

<DIRECT>1</DIRECT>

<OUTMOD>2</OUTMOD>

</EDI_DC40>

- <E1KNA1M SEGMENT="1">

<MSGFN>009</MSGFN>

<REGIO>07</REGIO>

<STCD1>20147972750</STCD1>

<FITYP>01</FITYP>

<STCDT>80</STCDT>

<STCD3>0</STCD3>

- <Z1KNA1M SEGMENT="1">

<MSGFN>009</MSGFN>

<KUNNR>0001000563</KUNNR>

<ZZSOCRCV>3100</ZZSOCRCV>

<ZZGBDAT>00000000</ZZGBDAT>

<b> <ZZAD_STREET_CO>Torre B1 - B Unimev</ZZAD_STREET_CO></b>

<ZZAD_ROOMNUM_CO>PB</ZZAD_ROOMNUM_CO>

<ZZAD_FLOOR_CO>E</ZZAD_FLOOR_CO>

<ZZAD_PSTCD1_CO>M5521AAR</ZZAD_PSTCD1_CO>

<ZZAD_CITY1_CO>Mendoza</ZZAD_CITY1_CO>

<ZZAD_REGIO_CO>07</ZZAD_REGIO_CO>

</Z1KNA1M>

<Z1ADRCM SEGMENT="1">

<MSGFN>009</MSGFN>

<KUNNR>0001000563</KUNNR>

<b><STREET>Torre B1 - B Unimev</STREET></b>

<FLOOR>PB</FLOOR>

<HOUSE_NUM2>E</HOUSE_NUM2>

<CITY1>Mendoza</CITY1>

<POST_CODE1>5521</POST_CODE1>

<COUNTRY>AR</COUNTRY>

<REGION>07</REGION>

<LANGU>S</LANGU>

</Z1ADRCM>

</E1KNA1M>

</IDOC>

</ZDEBMAS6>

Message was edited by: Rodrigo Pertierra

Message was edited by: Rodrigo Pertierra

Accepted Solutions (0)

Answers (2)

Answers (2)

former_member192798
Active Contributor
0 Kudos

Hi Rodrigo,

Do you use a specific "encoding" like UTF-8 or ISO-8859-1 in your Sender CC.

Try changing the Transfer mode to Binary instead of Text.

Also go through these links:-

http://help.sap.com/saphelp_nw2004s/helpdata/en/e3/94007075cae04f930cc4c034e411e1/content.htm

Hope this provides a solution.

Regards.

Praveen

bhavesh_kantilal
Active Contributor
0 Kudos

Rodrigo,

We faced a similar issue and raised an OSS with SAP.

It was found that the data that the R3 system was sending was invalid and corrupted and the R3 team was asked to correct the data.

Regards,

Bhavesh

rodrigoalejandro_pertierr
Active Contributor
0 Kudos

hi Bhavesh.

but there no way that XI can accept this character in a XML document?

Regards

Rodrigo Pertierra

Message was edited by: Rodrigo Pertierra

henrique_pinto
Active Contributor
0 Kudos

Rodrigo,

sure there is, but you'll need to use an encoding other than UTF-8. Try ISO-8859-1.

Regards,

Henrique.

rodrigoalejandro_pertierr
Active Contributor
0 Kudos

How can I change the encoding?

R3 team must configure this for outbound IDOCS?

I must change it from XI when i recive the idoc? in this case, how can I do this?

Regards.

Rodrigo Pertierra

Message was edited by: Rodrigo Pertierra

bhavesh_kantilal
Active Contributor
0 Kudos

Rodrigo,

We faced a similar issue. We received the XML message in XI with the junk value. When we opened the IDOC in the R3 system , in we02 , we found that the charcter was ( or rather looked like ) a # .

We thought XI was not able to handle the # and so, manually made the entries for # and once again found that it worked fine. So, resorted to an OSS with SAP and they came up with the fact that the data from the R3 is corrupted and asked the R3 team to correct the data.

As it was a multi vendor project, am not aware of how the R3 team went about correcting this issue, but rest assured, it was made clear that this was not an XI issue at all.

Regards,

Bhavesh

rodrigoalejandro_pertierr
Active Contributor
0 Kudos

Thanks Bhavesh for your quick answer!

but, how can I Change the Encodign? i dont have idea how.

i must change it from XI or R3 team must do it before send the IDOC??

when R/3 send me the IDOC?? who generate de XML, XI or R/3?? wich moment? is there any way to debug it

I check in WE02 outbound IDOC and "#" character appears.

Regards,

Rodrigo

Message was edited by: Rodrigo Pertierra

former_member206604
Active Contributor
0 Kudos

Hi,

Try using this XSLT Mapping before you are giving the Graphical mapping while doing the Interface mapping.

<?xml version="1.0" encoding="UTF-8" standalone="yes" ?> 
<xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="text/xml" version="1.0" encoding="ISO-8859-1" indent="yes"/>
<xsl:template match="/">
<xsl:copy-of select="child::node()"/>
</xsl:template>
</xsl:stylesheet>

Thanks,

Prakash

rodrigoalejandro_pertierr
Active Contributor
0 Kudos

Sorry, I dont understand what you want i do.

Whats that use XSLT mapping? how can i access to this?

When I access to Payload to get IDOC inbound, I recive <b>Torre B1 - B Unimev</b>, is there any function o program that i can debug to find why "#" caracter appears like at the moment that XML document is being creted?

I have checked WE02 in SAP R/3 and found "#" character -->

STREET | Torre B1 - B#Unimev but in XML I recive:

<STREET>Torre B1 - B Unimev</STREET>

Regards,

Rodrigo

Message was edited by: Rodrigo Pertierra

former_member206604
Active Contributor
0 Kudos

Hi,

Oh you mean to say that # is converted before mapping. Means that incoming message itself is not proper, then for sure you need to check some settings in R/3 as Bhavesh was saying. Also try some options of Unicode might help but am not sure.

If your incoming payload is not proper that you cannot do anything with the XSLT, that will jjust change the encoding type of the payload while mapping.

Thanks,

Prakash

rodrigoalejandro_pertierr
Active Contributor
0 Kudos

i have been post a mesasge in SAP GUI forum. when have enogh sufficient information i will talk with R/3 team for try to resolve this serious problems.

This problem appears when data was being loaded to PRD.

in one week the sistem will begin productive so i need to resolve it as soon as posible..

Thanks and Regards,

Rodrigo

former_member206604
Active Contributor
0 Kudos

Hi Rodrigo,

I wish your problem will be solved soon. Please do post us once this problem is solved.

Thanks,

Prakash

rodrigoalejandro_pertierr
Active Contributor
0 Kudos

hi again guys.

the problem is.

sender system send an IDOC to XI.

when I check the IDOC in WE02 found that one of fields of the idoc have a "#" (Torre B1 - B#Unimev). When XI recive the IDOC with XML format the "#" character is transformer to " "(Torre B1 - B Unimev). any ideas why it can be?

repeat, when i check in sxi_monitor> inbound message> payloads>MainDocument> I see <ZZAD_STREET_CO>Torre B1 - B Unimev</ZZAD_STREET_CO>

but i should recive <ZZAD_STREET_CO>Torre B1 - B#Unimev</ZZAD_STREET_CO>

Who must resolve it, R/3 team or XI??

another doubt i have is: who create XML document: R/3 or XI??

Thanks & Regards,

Rodrigo

bhavesh_kantilal
Active Contributor
0 Kudos

Rodrigo,

Like mentioned earlier, this is the exact issue we faced.

Why dont u try this~~ just go to we19 and open this IDOC and then replace this # casuing the issue by just deleting the # and adding another # manually . I can confirm that it will work.

The r3 team has to correct its data. I wish i had more details, but an OSS with SAP will confirm exactly what I have stated.

Regards,

Bhavesh