on 11-27-2009 2:30 PM
Hi,
We are using the ORDCHG IDoc ,under the segment E!EDKA1->NAME->payload(Distribution Center 8 & 9).This is errored in X,due to the payload.
How to handle the special character &.Let me know.
Thanks,
Srinivasa
Hi Srinivasa,
We can handle the special characters in the message mapping with the help of small java code.
Check the above users mentioned link. or
Take the below java code and generate the class file, after take the ".Class" file and "aii_map_api" and zip this and import this code in the Imported Archived and add this program to the message mapping (normal message mapping program with this program [select the add button in the operation mapping and select mapping type as java and add this program zip file].
import java.io.InputStream;
import java.io.OutputStream;
import java.util.Map;
import com.sap.aii.mapping.api.StreamTransformation;
import com.sap.aii.mapping.api.StreamTransformationException;
public class HandleAmpersand implements StreamTransformation {
public void setParameter(Map arg0) {
}
public void execute(InputStream in, OutputStream out) {
try {
int read_data;
while ((read_data = in.read())!=-1)
{
if (read_data != '&')
out.write(read_data);
else
out.write("&".getBytes());
}
out.flush();
} catch (Exception e) {
}
}
}
Regards
Ramesh
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Canot be handled by Message Mapping:
You either need JAVA mapping asmentioned here: https://weblogs.sdn.sap.com/pub/wlg/9420 [original link is broken] [original link is broken] [original link is broken]
Or enclose the corresponding field in CDATA element in an XSLT mapping (lots of exmaples available on SDN)
Regards,
Abhishek.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
as mentioned earlier, my suggestion is to use a simple java mapping before your message mapping to change the & to its xml format as specified in the blog - https://weblogs.sdn.sap.com/pub/wlg/9420 [original link is broken] [original link is broken] [original link is broken]
User | Count |
---|---|
91 | |
10 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.