on 12-13-2011 9:29 AM
Hello guys,
I have a problem with one mapping. The error is that there is an invalid character ( Unicode: 0x0 ). I have seen this is the null character, but how can I found it?
I can't test the message mapping because we have a dynamic configuration function, or there is anyway to test it avoiding the function?
How can I know what is the wrong character? There is any tool that opening the file I can see the character in error.
The scenario is File -> PI -> Proxy
The error is in the message mapping of PI, and file is being taken with Content Conversion, Text Format and UTF-8.
In message mapping the occurence is 0..unbounded so there are no mandatory fields.
Normally this interface is running well but sometimes we have this error.
Many thanks in advance.
Regards,
Xavi.
open your file with a hex editor.
You will find free hex editiors for download with google.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello guys,
one more thing, this interface is using Dynamic Configuration to take the File Name. Always is working, but I can not test the message mapping.
If I change the message mapping without taking dynamic configuration is working.
Could this be the problem? Reviewing monitoring the File Name is well-formed and with no strange characters.
Many thanks,
Xavi.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello guys,
we have seen that the problem is in the original file, sometimes is coming NULL ( we can see it opening with notepad ++ and encoding UTF-8)
The question is, how can we delete this nulls? There is any way to do it in the content conversion of the file adapter? Or we have to create a java module or java class?
Many thanks,
Xavi.
Hello Stefan,
this files are extracts created from different banks, and the client don't want to ask them to change the way they fill the file, so we have to manage to delete this nulls.
Should we have to create a java module to delete? In the operating system command we can call a java class? I suppose that in sender file adapter there is no way to delete the nulls from the lines.
I suppose we have to do it before to take the file, or another way could be to take the file without content conversion, and with a java mapping delete the nulls and create the message we send to R/3.
What do you think about this?
Many thanks,
Xavi.
Hi Xavi,
" suppose we have to do it before to take the file, or another way could be to take the file without content conversion, and with a java mapping delete the nulls and create the message we send to R/3.
What do you think about this?"
Ans)
Yes that's correct. You can follow this blog http://www.sdn.sap.com/irj/scn/weblogs?blog=/pub/wlg/4018
where without FCC the mapping code directly creates the target XML. you can add code to replace all null characters as example shown below
String line = bin.readLine();
String s="";
for(int i=0;i<line.length();++i)
{
if(line.charAt(i)!=)0X00)
{
s=s+line.charAt(i);
}
}
line=s;
Any source interface is fine in interface mapping and no need to use FCC. Rest all setrtings will be normal as per the blog.
Regards
Anupam
Hello guys,
I thought the error was with characters like 'ç' or 'ñ' and I changed the file encoding to ISO-8859-1 but I have the same error of the invalid character.
In the original file there are empty lines, but this shouldn't be a problem because the other files are running well.
The files are from different partners, so we think the error could be in the adapter not in the file.
Maybe we have to do another configuration in the adapter?
Many thanks,
Xavi.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
This guide talks about encoding in PI, can you check will it be helpful for you.
[http://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/502991a2-45d9-2910-d99f-8aba5d79fb42|http://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/502991a2-45d9-2910-d99f-8aba5d79fb42]
Regards
Ramesh
Hi,
Unicode: 0x0 means you get null value for certain element. Please check whether you look for value from the null element during mapping or so? Are you configuring optional elements as mandatory in the file adapter and that cause the error?
regards,
ganesh.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello ganesh,
ther are no mandatory fields.
The configuration of the adapter is in content conversion:
Document number: XXXX
Recordset Structure: ROW,*
Recordset Sequence: Ascending
Recordsets per Message: 1
And in configuration:
ROW.endSeparator 'nl'
ROW.fieldSeparator 'nl'
ROW.fieldNames Line
ignoreRecordsetName true
In processing we have File Type: Text and Encoding: UTF-8
Is strange because this interface is failing only a few times.
Regards,
Xavi.
Hi,
Defining Special Characters in Strings for Separators
You can specify non-printable ASCII characters in all strings for separators (NameA.fieldSeparator, NameA.beginSeparator, and NameA.endSeparator).
○ Insert these characters individually in the strings in the form ´0xHH´ (including quotation marks). HH represents the character encoded as a hexadecimal value.
○ Add a line break using the character ´nl´ (including the quotation marks); nl stands for new line.
○ The special character ´0´ is not a separator character.
regards,
ganesh.
User | Count |
---|---|
88 | |
23 | |
11 | |
9 | |
8 | |
5 | |
5 | |
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.