Technology Blogs by Members
Explore a vibrant mix of technical expertise, industry insights, and tech buzz in member blogs covering SAP products, technology, and events. Get in the mix!
Showing results for 
Search instead for 
Did you mean: 
Active Participant


Maybe when you execute a message mappping with the character & the error  "Unable to display tree view; Error when parsing an XML document (The entity name must immediately follow the '&' in the entity reference.)" is returned.

The solution for this problem is simple, just develop the java mapping for change the character & by &. 



In your Message Mapping, in the tab Functions copy and past the code below int the area Attributes and Methods, (or if you prefer, create a java mapping in NWDS with the same code, works the same way).

public void transform(TransformationInput transformationInput, TransformationOutput transformationOutput) throws StreamTransformationException {
try {
InputStream inputstream = transformationInput.getInputPayload().getInputStream();
OutputStream outputstream = transformationOutput.getOutputPayload().getOutputStream();

byte[] b = new byte[inputstream.available()];;
String encoding ="UTF-8";
String inputXML=new String(b);

inputXML = inputXML.replaceAll("&(?!amp;)", "&");

} catch (Exception exception) {
throw new StreamTransformationException(exception.toString());



Open your Message Mapping (or operation mapping if you create a jar in NWDS), in Text View, fill the field with the & and run a test.

I hope I have collaborated with the community, and I await your feedback.

1 Comment
Labels in this area