cancel
Showing results for 
Search instead for 
Did you mean: 

how to deal with special character in source file

Former Member
0 Kudos

Hi experts,

i am doing a file to file scenario in which my source file contains many special characters when i am puting this file into moni its going with the special character .My source file is a fixed length file so in content conversion i have specified the file length but due to these special charcters these field lenght is also varing.So please guide me how to deal with these special characters in sender adapter

regards,

Saurabh

Accepted Solutions (0)

Answers (5)

Answers (5)

Former Member
0 Kudos

Hi,

For handling the special character follow the blog,

https://www.sdn.sap.com/irj/sdn/weblogs?blog=/pub/wlg/9420 [original link is broken] [original link is broken] [original link is broken]

Former Member
0 Kudos

Hi,

What you can do is while defining the file adapter define the file type as Text and mention the proper file encoding as UTF-16. if it does not then check if those character are which type of characters, if its a diff langague then you can try other encodings as well.

you will find the list of encodings at

http://help.sap.com/saphelp_erp2004/helpdata/en/0b/9a50465ccf84479e39a6d50c90fb3f/frameset.htm

Regards,

Gaurav Jain

stefan_grube
Active Contributor
0 Kudos

The content conversion in file adapter counts the characters, not the bytes.

Make sure, that you apply the coorect codepage to the file adapter.

If you want the content conversion to count the bytes instead of the characters, there is no easy solution for this.

Regards

Stefan

Former Member
0 Kudos

Check this blog

https://www.sdn.sap.com/irj/sdn/weblogs?blog=/pub/wlg/9420 [original link is broken] [original link is broken] [original link is broken]

Thanks

Sebin

GabrielSagaya
Active Contributor
0 Kudos

you could try using a Java Mapping to change the encoding manually. For that, set the encoding of the OutputFormat of the XML you'll serialize. Try the following code piece for the mapping (inside a try/catch declaration):

DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();

DocumentBuilder documentBuilder = factory.newDocumentBuilder();

Document input = documentBuilder.parse(in);

OutputFormat format = new OutputFormat(XML, "ISO-8859-1", false);

XMLSerializer serializer = new XMLSerializer(out, format);

For more details check this guide:

https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/uuid/502991a2-45d9...