cancel
Showing results for 
Search instead for 
Did you mean: 

Handling Data in ABAP Proxy

sahithi_moparthi
Contributor
0 Kudos

I have a scenario from ABAP Proxy to JDBC.I have "ShipTo Name " Field in the ABAP Proxy.When the Data has comma it is working,but when the field has teh value as "LACOMBE FERTILIZER & FARM SUPPLY LT" it is throwing error as "The entity name must immediately follow the '&' in the entity reference. com.sap.aii.utilxi.misc.api.BaseRuntimeException: The entity name must immediately follow the '&' in the entity reference".Please let me know ho wto handle this erroe.Appreciate for your Answer.Thanks in Advance

Accepted Solutions (0)

Answers (4)

Answers (4)

former_member184681
Active Contributor
0 Kudos

Hi,

I believe you have two basic options here:

1. Replace all the XML special characters with escape sequences, like & for the ampersand ("&"). The best option would be dealing with it on the sender side. Since you are using ABAP Proxy, simply use the ESCAPE_HTML static method of CL_HTTP_UTILITY class for each of the fields there you expect XML special characters (like: for customer name, but not necessarily customer number).

2. Enclose the tags where special characters can occur in CDATA sections, as suggested earlier. Again, you could possibly do this on the sender side, for each potentially problematic field.

I did not really get it from the earler discussion, where is it that you get the error in processing: while sending data from ECC to PI? at the mapping step in PI? at the receiver adapter? Depending on the answer, you could also think of converting to XML escape sequences or CDATA sections during mapping.

Regards,

Greg

iaki_vila
Active Contributor
0 Kudos

Hi Sahithi,

You could use a CDATA XML structure in order to avoid that exception. Later you could extract the values from that field.

http://en.wikipedia.org/wiki/CDATA

Regards.

sahithi_moparthi
Contributor
0 Kudos

Hi,

Thanks for your Reply.

    But i have to implement the Logic in Mapping.Can anyone Give me the Idea how it can be Done??

  From ABAP Proxy we are getting the data as LACOMBE FERTILIZER & FARM SUPPLY LT" ,,,Now in Mapping how can i handle this "&" .

Thanks..

Former Member
0 Kudos

Hi, where in the scenario does the error occur?

First guess is that you have to replace the '&' with '&'. The ampersand character is an XML/HTML entity which is reserved. See e.g. w3schools

sahithi_moparthi
Contributor
0 Kudos

Thanks a lot..Solved my Problem.

Former Member
0 Kudos

Hi again, I tested myself. The ABAP proxy runtime is automatically escaping & with & when serializing the XML. I tested with datatype xsd:token.

What datatype has your  "ShipTo Name " Field in ABAP proxy?

sahithi_moparthi
Contributor
0 Kudos

Thanks a lot..i am using XSD:String data type,,automatically escaping & with &.

Ryan-Crosby
Active Contributor
0 Kudos

Hi,

This is happening because the ampersand (&) character is not allowed by itself in the XML specification.  To use (&) within the XML content you want to replace & with & in the ABAP proxy and then it should work fine.

Regards,

Ryan Crosby