on 10-22-2007 1:13 PM
Hi,
In my scenario I'm using Graphical mapping tool and I have to replace the & that's coming in the input xml with & in the output with in the message mapping, Is Value mapping is the only solution or do we have any other options that we can use for this.
Basically I'm getting runtime error in the message Mapping since I had a & in the value which is not recognized.
thanks,
Joe.P
When you have an ampersand in the incoming stream, then the graphical mapping cannot parse the mapping and you cannot change this value inside the mapping. You have to change the ampersand before the mapping. You can do this with a Java mapping, but here you have to ensure that the ampersand is not used to start an escape sequence.
When you use ABAP proxy to send messages, then the ampersand should be escaped by & amp ; If this is not the case, write an OSS message for this.
When you use the test tool to simulate the message, then replace the ampersand by your own.
Regards
Stefan
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello Stefan,
I've followed your advice and used a java mapping. With this I could successfully replace
"&" by "&". My receiver file adapter now gets the XML-message propery with "&" instead of "&". However I need to apply content conversion as we need the output as a csv.-file.
As soon as I use content conversion an error is thown during the content conversion:
..File Content Conversion starting.
Message konnte nicht an den JCA-Adapter weitergeleitet werden. Grund: org.xml.sax.SAXParseException: The entity name must immediately follow the & in the entity reference.
.....
So do you see a solution approach when I have to use content conversion?
Thanks for your appreciated feedback.
Kind regards
Christof Johner
I am trying this on SP13. What is your SP??
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Joe,
For this no need to do value mapping. You get rid of by using "<b>replaceString</b>" function in your message mapping.
There will be 3 input boxes in this function. In first box Map ur source, in second box map a constant (value should be &) and in the third input box again map a constant (enter the value which want to be replaced with "&" if you want that only "&" should be removed that just leave the constant <b>BLANK</b>) and then map your target node.
SOURCE ---> replaceString -
> TARGET.
Regards,
Sarvesh
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
thanks for the response, that did not help me I still get the same parse exception on the row where there is a &. Here is the error that I'm seeing.
Fatal Error: com.sap.engine.lib.xml.parser.ParserException: XMLParser: Entity Reference must end on ;(:main:, row:586, col:52)
and this is my in comming data.
<Position_Desc>Director Finance M&A_Dept771_SSC7000</Position_Desc>
trying to replace& there with &
Hi Joe
Sorry, I still don't understand why you want to replace & with &.
This may help you ...
You incoming message & is represented as
<b> & amp;</b>
internally
This is because & is a special character and is treated specially in XML.
Regards
Vijendra
Message was edited by:
Vijendra Bhanot
Message was edited by:
Vijendra Bhanot
Message was edited by:
Vijendra Bhanot
Hi,
that did not help me here is the mapping that I'm using based on what you said. if you can give me your email
_______
<b>Please not request or provide email IDs
SND XI Forum Moderator</b>
_______
I can send the screen shot from the mapping tool. I can't attach the image over here.
Source -
Constant = & -
replaceString -
Target.
Constant = & -
thanks,
What is the source?
The Source if sending an XML will have to send & as & amp ; ( without spaces) the reason is that & is the escape sequence in XML and a standard XML represents & as & amp ;.
Trying to replace this in Graphical Mapping will not help as , if the Source sentds & as simple & , the XML parser internally used by Graphically Mapping will error out as the input XML is not a a valid XML.
Regards
Bhavesh
Hi Bhavesh,
My scenario is RFC-ABAPProxy--XI- File.
so the RFC is sending me as & instead of &.
this is what I see in the my incoming xml and this failing during runtime.
<?xml version="1.0" encoding="UTF-8"?>
<ns0:Messages xmlns:ns0=" http://sap.com/xi/XI/SplitAndMerge">;
<ns0:Message1>
<nr1:MT_HCMPositionData xmlns:nr1="http://XXXX.com/xi/HCM/Recruitment ">
<PositionIDs>
<PositionID>20008644</PositionID>
<Position_Desc>Director Finance M&A_Dept771_SSC7000</Position_Desc>
<Job_Code>Director Finance M&A</Job_Code>
<Staffing_Stat>1</Staffing_Stat>
<Org_Type>DEPARTMENT</Org_Type>
</PositionIDs>
</nr1:MT_HCMPositionData>
</ns0:Message1>
</ns0:Message1>
Hi Joe
I saw your mail. What you are trying to do is already taken care of by XI's XML parser. There is no need to replace &. Now this is true that you are getting error. So I would suggest that activate your mapping and execute the scenario end-to end once more ... and see if error still occure. If it does .. then copy the error payload to message mapping Test and that way you will be in better position to debug it. Also share across the error message payload and error log.
Good Luck
Vijendra
Hi Joe
What's the value with & in your incoming message?
Vijendra
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
86 | |
10 | |
9 | |
9 | |
9 | |
6 | |
6 | |
5 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.