cancel
Showing results for 
Search instead for 
Did you mean: 

Handling Invalid character.

former_member181928
Participant
0 Kudos

Hello All

My message mapping is failing because of an invalid character and gives the following Exception

com.sap.aii.utilxi.misc.api.BaseRuntimeException: Fatal Error: com.sap.engine.lib.xml.parser.ParserException: Invalid char #0x1a(:main:, row:1, col:1496905) at com.sap.aii.mappingtool.tf3.Transformer.checkParserException

Upon Investigation i found that the "char #0x1a" is an EndOfFile(EOF) character and on the browser this character looks like ' ' . Is there a way by which i can just ignore this character so that that mapping does not fail.

Please suggest.

regards

Nilesh Taunk.

Accepted Solutions (1)

Accepted Solutions (1)

bhavesh_kantilal
Active Contributor
0 Kudos

What is the sender adapter you are using?

If File , you can change the Encoding Schema correspodnig to the data you are getting and then things should work fine.

If this is an Invalid XML character (,i.e ) a character that is not a part of the XML charset then you might need a Java Mapping before your graphical mapping that cleans the data and then graphical mapping will do your mapping and so on.

Regards

Bhavesh

former_member181928
Participant
0 Kudos

Hi Bhavesh

On the sender side i am using Abap Proxy . I tried using a java mapping before the message mapping but it gives a "org.xml.sax.SAXParseException:" with that invalid character.

I even tried to change the encoding to ISO-8859-1 through XSL mapping . But even there it gives a parser exception .

Actually this character is a control character.

Is there some other way i can remove or ignore this character.

Please suggest .

regards

Nilesh

bhavesh_kantilal
Active Contributor
0 Kudos

> Actually this character is a control character.>

> Is there some other way i can remove or ignore this

> character.

The same old problen A few options,

1. Write a Java Mapping or Adapter Module and use this to remove the Control Characters. The output of this Java Mapping will go to the Graphical Mapping.

2. Write a script at the OS Level and let this clean the file before XI picks up the file.

3. Ask the source to remove the control characters

Regards

Bhavesh

henrique_pinto
Active Contributor
0 Kudos

Nilesh,

the java mapping code is not supposed to parse the XML file.

You don't need to parse it, just remove the wrong char (treating the inputstream as a ByteInputStream and reading the characters directly, for example).

If you know the ascii value of that char you want to remove, it should be easy.

Another approach is to let only chars in some certain intervals (0-9, a-z, A-Z). That should also be easy.

Regards,

Henrique.

Former Member
0 Kudos

Hi

Will this help

/people/shabarish.vijayakumar/blog/2005/08/17/nab-the-tab-file-adapter

Thanks

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi Taunk

The following informatio may help you

File Sender: Special Characters in File Names

<b>o Q: I am trying to get the File Adapter to poll a file, which

contains special characters (e.g., accented characters or umlauts)

in its file name. However, irrespectively of the wildcard mask I

specify in the File Adapter sender channel configuration, the file

does not get picked up. Which configuration setting do I need to

change to get my scenario working?</b>

o A: Under certain operating system platforms, such as Solaris, the

APIs used by the Java Runtime (JRE) are not Unicode-aware.

Consequently, the JRE needs to be configured to correctly interpret

the character set it receives from the operating system.

This is configured through the "file.encoding" system property as

well as the "LANG" environment variable.

Make sure you set "file.encoding" to a character set (such as

ISO-8859-1) that supports the special characters you would like to

process. This system property can be configured by appending

"-Dfile.encoding=<encoding>" to the Java VM parameters section of

the SAP J2EE Config Tool.

Additionally, you need to set the "LANG" environment variable to a

locale that supports more than 7 bits, such as "de.ISO8859-1". The

encoding you specify in the LANG environment variable needs to

match the encoding set via "file.encoding".

You can persistently configure the environment variable by setting

it in the profile $HOME/.sapenv_$HOSTNAME.csh of the <sid>adm user:

setenv LANG de.ISO8859-1

Warm Regards,

Vijay

santhosh_kumarv
Active Contributor
0 Kudos

Hi,

Try this in the FCC parameter....

Field.enclosureSign = 0x1a / Field.enclosureSignEnd = 0x1a

Field.enclosureConversion = Yes.

The field name should be the field that contains the invalid character.

Field.enclosureSign = 0x1a

specifys the invalid string as the text delimiter and

Field.enclosureConversion = Yes.

removes the delimiter when the text is transferred so that the mapping is not errored out...

Regards

Santhosh