cancel
Showing results for 
Search instead for 
Did you mean: 

BAPI_PO_GETDETAIL1 - An invalid XML character (Unicode: 0xb) was found

Former Member
0 Kudos

Hi,

We are using BAPI_PO_GETDETAIL1 to get the Purchase Order details. it worked well in the past.

But its failing for a particular PO number.

Error Message:An invalid XML character (Unicode: 0xb) was found in the element content of the document.

I understand there might be some special character in the record. But it works well at SAP ECC.

Can someone please suggest some solution or workaround?

Thanks,

Anil

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

Hi,

I faced the same issue recently, and came accross this sap note : 1559677 : XML renderer creates invalid XML.

Take a few moments to read the contents, but here's the most important part :

If an application program uses the SAP XML renderers to create XML 1.0

documents that must strictly conform to the specifications of W3C, this

application program must ensure that problematic characters are removed

from the data before transferring this data to the SAP XML renderer.

So, you need to clean up the characters by yourself...

Best regards,

Wouter

Former Member
0 Kudos

Hi

Did you solve this issue ?

I am facing the same error in a productive environment:

exception from ZF_PP_PROCORD_PHASE_READ_TEXT, Character reference "&#31" is an invalid XML character.

ZF_PP_PROCORD_PHASE_READ_TEXT is the name of the action block and the RFC name as well

I´ve checked and the ECC system is unicode enabled.

SAP Netweaver 7.3

SAP MII 12.2.4

former_member192939
Active Participant
0 Kudos

Any messages in the NW logs.

Try clearing the JCo cache.

- Ajay

Former Member
0 Kudos

Ajay,

We are using xMII 11.5 - couldn't find something relevant in logs.

Try clearing the JCo cache - I tried that but we are able to replicate the issue in the Development environment as well. So it should not be a cache issue.

Thanks,

Anil

agentry_src
Active Contributor
0 Kudos

Hi Anil,

Did you go to BAPI or SE37 in the ERP system and test it from there?

If it throws the same error there, it is not an MII issue.

Regards,

Mike

Edited by: Michael Appleby on Feb 24, 2012 7:14 PM

Former Member
0 Kudos

Hi Mike,

Yes, the BAPI works fine in ECC for the corresponding PO no.

Thanks,

Anil

agentry_src
Active Contributor
0 Kudos

Can you scrape the content from ECC and post it? Not sure what the solution would be, but it is an interesting problem. Is the ECC system Unicode?

Regards,

Mike

Former Member
0 Kudos

Yes, the ECC is unicode enabled.

Is there any option to make the BAPI response unicode enabled in xMII server like we have the option in IDOC listener to enable the unicode by putting it 1?

Is there a solution for it in higher vserions of MII like 12.1?

Regards,

Anil

Former Member
0 Kudos

I think this is more likely an XML/XSL issue then a unicode one. I am pretty sure xml/xsl just doesn't like that character. I haven't seen this issue with RFC's before but i have seen it with iDocs so I know there are some non MII related notes out there that may fix the issue in SAP. When I came across the issue it was caused by some text that had been cut and pasted from excel. The simplest solution might be to try and isolate what data in the PO is causing the issue and see if you can get the data fixed. I don't think that character does anything useful and probably shouldn't be in there anyway.

Former Member
0 Kudos

Hi Christian,

The character cannot be romved from ECC as its a Production environment. Is there a way to remove the character in xMII? JCO action block is acting like a black box, we pass the request XML to BAPI and the response xML is corrupted. So I am not to sure where to handle that special character.

Former Member
0 Kudos

Notes like 864983 lead me to believe that this is probably not an issue with at least the latest versions of MII, but I have no way ( or time ) to confirm that for you. If you have a support agreement I would submit a ticket to SAP. If not and fixing the data in SAP is not an option and the frequency of the error merits the time involved to fix the issue you could look into trying to upgrade the JCo libraries or implementing a custom action.

Best of luck to you,

Christian