cancel
Showing results for 
Search instead for 
Did you mean: 

Want to Validate 0# at receiver input payload

abhay_aggarwal
Participant
0 Kudos

Dear All,

I am working on one scenario in which i am getting 0# in my input paylaod ,because of this only I think I am gettiing the mapping Error.

Error Description is Below

com.sap.aii.utilxi.misc.api.BaseRuntimeException: Fatal Error: com.sap.engine.lib.xml.parser.ParserException: XMLParser : #0 not allowed in Character data sections(:main:, row:1, col:5361080) at com.sap.aii.mappingtool.tf3.Transformer.checkParserException(Transformer.java:187) at com.sap.aii.mappingtool.tf3.Transformer.start(Transformer.java:174) at com.sap.aii.mappingtool.tf3.AMappingProgram.execute(AMappingProgram.java:118) at com.sap.aii.ibrun.server.mapping.JavaMapping.executeStep(JavaMapping.java:64) at com.sap.aii.ibrun.server.mapping.Mapping.execute(Mapping.java:92) at com.sap.aii.ibrun.server.mapping.MappingHandler.run(MappingHandler.java:90) at com.sap.aii.ibrun.sbeans.mapping.MappingRequestHandler.handleMappingRequest

to validate this invalid data can you plz suggset me which fn i have to use ................

Warm Regards

Abhay

Accepted Solutions (0)

Answers (8)

Answers (8)

abhay_aggarwal
Participant
0 Kudos

Hi All,

To Resolve this problem I have used the java mapping to handle the special charectes and after that I was grtting junk data from ECC side for this I asked abaper to change the logic on there side and worked...

I would like to thank Nutan and Stefan to helping me on this...........:)

Regards

abhay_aggarwal
Participant
0 Kudos

Hi Stefan,

That means we cannot handle special charecters in XI anyhow.

Regards

Abhay

Former Member
0 Kudos

You can handle anything you want in a Java mapping. You get an inputstream, do something with it and return an output stream. This means you can remove characters, convert them, what you want.

But in this case IT DOES NOT MAKE SENSE, because the error is on the sender side (before it even arrives in XI !!)

=> fix it on sender side, not in XI.

I think this thread will enter the hitlist regarding most answers to one question

CSY

sunil_singh13
Active Contributor
0 Kudos

Hi Abhay,

The points that Stefan trying to make is:

Do you think if by doing Java/XSLT or any other way that data get passed to Receiver system, then receiver system will accept it?

I mean to say will that be a valied data for receiver system? I think the answer will be NO.

SO you have to ask Sender system to fix that there only or if they can not then ask them how that data should be interpre in the receiver system and after doing that just do <replaceAll> with the valied data and send the proper data to Receiver.

If they say they want to send that special character only and receiver system will understand that then simply put that field in CDATA formate. anything in CDATA formate never gets validated so you will not get any error in mapping for any special character till date :-)...

I hope i am able to put my point.

Thanks,

Sunil Singh

abhay_aggarwal
Participant
0 Kudos

Hi Sunil,

I have to use this function Cdata in XSLT mapping or in java mapping ? How Can I use this C-DATA ?

Regards

Abhay

Edited by: Abahy Aggarwal on Mar 3, 2010 4:24 AM

Former Member
0 Kudos

Hi Abahy,

Instead of going around the problem, just get a confirmation from the sender system whether the data which you are receiving is correct or not.Ask them about the particular field where you are receiving this data.If they make it confirm that input data is correct, then ask whether it has to be moved in the same format to receiver.After clarifying only try for handling special characters.

I handled it because I got confirmation from the sender and receiver system.So, please get confirmation and then proceed.

Regards,

Nutan

abhay_aggarwal
Participant
0 Kudos

HI Nutan,

I checked with sender side they want the same data to receiver side(in CSV file ).I have handle the special charecters also with the below code but still I am getting the parser error.code is below.

/*

*

*

  • To change the template for this generated file go to

  • Window&gt;Preferences&gt;Java&gt;Code Generation&gt;Code and Comments

*/

package com.agr.test.replacechar;

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;

import java.util.HashMap;

import com.sap.aii.mapping.api.AbstractTrace;

import com.sap.aii.mapping.api.StreamTransformation;

import com.sap.aii.mapping.api.StreamTransformationConstants;

import com.sap.aii.mapping.api.MappingTrace;

import com.sap.aii.mapping.api.StreamTransformationException;

import java.io.IOException;

import java.io.InputStream;

import java.io.OutputStream;

/**

*

  • To change the template for this generated type comment go to

  • Window&gt;Preferences&gt;Java&gt;Code Generation&gt;Code and Comments

*/

public class ReplaceAmpersnd implements StreamTransformation {

private Map param = null;

private AbstractTrace trace = null;

public void setParameter (Map param)

{

this.param = param;

if (param == null)

{

this.param = new HashMap();

}

else

{

trace =(AbstractTrace) param.get(StreamTransformationConstants.MAPPING_TRACE);

}

}

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)

{

trace.addWarning("Error " + e.getMessage());

}

}

}

NOw there is now # and $ charecters are coming sttill I am getting this error

Edited by: Abahy Aggarwal on Mar 3, 2010 5:10 AM

abhay_aggarwal
Participant
0 Kudos

I am still getting this error

com.sap.aii.utilxi.misc.api.BaseRuntimeException: Fatal Error: com.sap.engine.lib.xml.parser.ParserException: Invalid char #0xb(:main:, row:1, col:83739) at com.sap.aii.mappingtool.tf3.Transformer.checkParserException(Transformer.java:187) at com.sap.aii.mappingtool.tf3.Transformer.start(Transformer.java:174) at com.sap.aii.mappingtool.tf3.AMappingProgram.execute(AMappingProgram.java:118) at com.sap.aii.ibrun.server.mapping.JavaMapping.executeStep(JavaMapping.java:64) at com.sap.aii.ibrun.server.mapping.Mapping.execute(Mapping.java:92) at com.sap.aii.ibrun.server.mapping.MappingHandler.run(MappingHandler.java:90) at com.sap.aii.ibrun.sbeans.mapping.MappingRequestHandler.handleMappingRequest(MappingRequestHandler.java:95) at

abhay_aggarwal
Participant
0 Kudos

Hi All,

below is the XML paylaod below 3rd XML of TEXT tag I am getting some charecter if I am removing this then it is processing suc

abhay_aggarwal
Participant
0 Kudos

Edited by: Abahy Aggarwal on Feb 23, 2010 12:31 PM

Edited by: Abahy Aggarwal on Feb 23, 2010 12:39 PM

Former Member
0 Kudos

Hi,

http://wwwimages.adobe.com/www.adobe.com/products/indesign/scripting/pdfs/indesign_and_xml_technical...

In the last page of the docuemnt, there is some table given. In that table, there are some symbols are there and corresponding XML equivalents are also given. These characters may present inthe iput data as a result your mapping program is failing.

Please check the data of the record in SAP tables. and identify what is the value exactly exists in SAP. then see MONI data in SAP R3 itself to identify how the record is coming to moni of R3. If you can observe deviation, then post your observation.

Thanks,

Subbu

Former Member
0 Kudos

What XML encoding is used in this incoming document (see first line) ? Maybe a wrong encoding is used.

CSY

abhay_aggarwal
Participant
0 Kudos

Hi ,

I am using UTF8 Encoding...........

I have total 60K records in tables. For testing I am sending Records in 10K slots .I have observed that first 40K it is not showing error in this 40K records

SAP Desktop Application Launcher Demo Role #2 like this text I am getting from input side.

And for Next 10K records where I am getting the Text is Like this.............

según las posiciones de ingresos y # gastos#

plz suggest me how I can handle this.

Regards

Abhay

Edited by: Abahy Aggarwal on Feb 23, 2010 5:23 AM

stefan_grube
Active Contributor
0 Kudos

Are the first 40k texts which ascii characters only?

It seems to have an issue with non-ascii characters.

You should inspect the ABAP code of the sending application.

There might be a string -> char conversion or something which corrupts the encoding.

If it is a non-unicode system the ABAP code has to deal also with different languages.

I know that I repeat myself, but it is definitely an issue in the sender application.

Fix the issue there. In PI you cannot do anything.

Former Member
0 Kudos

The # is a hint that the problem already occurs in the sender application. We had a similar issue some time ago. Go in your SAP RFC destination (SM59) from where you send the data. You will see some field which says that a # will be sent when the character cannot be translated correctly. Check in your RFC destination that you have turned on Unicode (Unicode & MDMP settings tab).

With Unicode, you should be able to send this Spanish text correctly without problems.

CSY

abhay_aggarwal
Participant
0 Kudos

hi

I have checked in Sender Payload there I am getting & # 0 in one element . I have tested with this in test tab

and when I am excuteing my mapping with & # 0, I am getting error and when I excuteing mapping without & # 0, it is getting processed sucessfully.

Regards

Abhay

Edited by: Abahy Aggarwal on Feb 23, 2010 11:26 AM

Edited by: Abahy Aggarwal on Feb 23, 2010 12:39 PM

Edited by: Abahy Aggarwal on Feb 23, 2010 12:40 PM

Edited by: Abahy Aggarwal on Feb 23, 2010 12:45 PM

Edited by: Abahy Aggarwal on Feb 23, 2010 1:05 PM

Edited by: Abahy Aggarwal on Feb 23, 2010 1:06 PM

Edited by: Abahy Aggarwal on Feb 23, 2010 1:10 PM

stefan_grube
Active Contributor
0 Kudos

what else is in that element?

abhay_aggarwal
Participant
0 Kudos

<TEXT>benu00F6tigt. & # 0;</TEXT>

Former Member
0 Kudos

Hi,

That sysmbol is NULL . Request R3 guys to delete that null form data record in R3. some how NULL got inserted in the data. This is my openion. Cross check if it works.

Thanks,

Subbu

Former Member
0 Kudos

Hi Abhay,

As you posted that if the input data is having & # 0; its failing in mapping. I think you have not used any java mapping for handling it.So,its failing to convert.I tried the data which you have provided with my java mapping it worked fine.

TEXT>benötigt. & # 0;</TEXT>

Here, is the step for that

1.> Create IA(Imported Archieve)

2.> Use it before your actual mapping.

Please try:

The code for java mapping:

public class HandleSpecialCharacter implements StreamTransformation {

public void setParameter(Map param)

{ }

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("&amp;".getBytes());

}

}

out.flush();

}

catch (Exception e)

{

}

}

}

I believe, it will resolve the issue.

Regards,

Nutan

stefan_grube
Active Contributor
0 Kudos

> I believe, it will resolve the issue.

This would fix the issue on the wrong side.

Besides the text in the element would not be as expected anyway.

stefan_grube
Active Contributor
0 Kudos

<TEXT>benötigt. & # 0;</TEXT>

Check the ABAP program for type conflicts between char and string.

debug the sender application to see, why there is a zero in the field.

Former Member
0 Kudos

Hi Stefan/Abhay,

Is it because of 0 coming in the input or XI is unable to convert the special characters properly. Because, similar type of issue happened with me. Our input data was having special characters as Euro and Pound sign, which was failing in mapping, due to conversion problem. So, I handled in java mapping and it worked.

It's very important to get clear idea from the sender system about the input data. May be it's an error of the sender system while generating the file also.

Regards,

Nutan

abhay_aggarwal
Participant
0 Kudos

Hi Nutan,

Thanks for your Reply...

I have posted this value & # 0; with space beacuse it is not allowing me write and post without space .I think this is also happening beacuse xml does not accept the null value ...........as & # 0; returing null value....

Can't we write a UDF and handle this & in graphical mapping only...........

Regards

Abhay

Edited by: Abahy Aggarwal on Mar 1, 2010 12:01 PM

stefan_grube
Active Contributor
0 Kudos

> Can't we write a UDF and handle this & in graphical mapping only...........

No you can't.

abhay_aggarwal
Participant
0 Kudos

Hi All,

I have used this java code to handle & charecter in XI then

public class HandleSpecialCharacter implements StreamTransformation {

public void setParameter(Map param)

{ }

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)

{

}

}

}

I got the error which says

Java class TEST/TestJar does not implement the required interface &quot;StreamTransformation&quot;</

I have checked on SDN for this error and this useful link

I have checked for in my program

import com.sap.aii.mapping.api.StreamTransformation;

it is there in my program..

PLease suggest me on this.............

Regards

Abhay

Edited by: Abahy Aggarwal on Mar 2, 2010 7:09 AM

stefan_grube
Active Contributor
0 Kudos

This Java program does not help you at all..

FIX THE ISSUE IN THE ABAP PROGRAM AT SENDER SIDE

stefan_grube
Active Contributor
0 Kudos

> row:1, col:5 361 080

5 Million?

It might be an unexpected "end of file" sign.

It is definitely a technical issue, not a mapping issue.

abhay_aggarwal
Participant
0 Kudos

Hi Stefan,

I am not able to get ur point .......... Can you plz more elborate on this . however i have tested with same input paylaod in test tab and checked and it's getting sucessfully excuted in test tab with # sign also.......

Regards

Abhay

stefan_grube
Active Contributor
0 Kudos

How many characters has your input payload? Is the #0 in the middle or the last character?

Besides: When it is an ABAP proxy, could you compare the payload in SMB_MONI in application system with the same in PI system?

Edited by: Stefan Grube on Feb 22, 2010 1:50 PM

abhay_aggarwal
Participant
0 Kudos

Hi Stefan,

0# is coming in middle of payload and now from RWB i have tested with paylaod which is having 0#, 00000 ######## like this and it is processing successfully.

SAP_AUDITOR_BA_FI_AA##AIS # Imobilizări corporale

SAP_AUDITOR_BA_FI_AA 000 ## # Imobilizări corporale

with this both cases I have tested from RWB and processing successfull.

Regards

Abhay

stefan_grube
Active Contributor
0 Kudos

the error message does not ean, that that as a character combination between 0 and #.

It stands for the ascii value zero.

ascii zero is not a valid error and you cannot enter ascii zero values with a keyboard.

In the message you have #. Is this expected? could you check, whether there should be other, foreign characters?

it might be a code page issue as well.

You see, there are man possible reasons for the error.

It is really hard to tell you, what is wrong.

An experienced guy has to look into your system.

Former Member
0 Kudos

Hi Abahy,

Please get confirmed with the sender sytsem that this data is the correct data as per their expectation.If its yes, then you have to handle it at the mapping level. As per the error it seems XML payload is not getting generated because this #0 is disturbing the XML payload. So either first get confirm that the invalid character has to be sent to receiver or not.If no then try to substring at mapping level.Or if yes, then better use Java mapping for handling special characters.But, I believe XI understand # and converts it easily.Please post the input here and kindly check which field this data is coming.

Regards,

Nutan

abhay_aggarwal
Participant
0 Kudos

Hi Nutan,

I am getting the input below like this

Date>20100222</Date>

<Identifier>AGR_TEXTS</Identifier>

<Flag>1</Flag>

<MANDT>100</MANDT>

<AGR_NAME>AUDITOR_A</AGR_NAME>

<SPRAS>4</SPRAS>

<LINE>00012</LINE>

<TEXT>SAP_AUDITOR_BA_FI_AA_A##AIS - Imobilizări corporale (Autorizaţii)</TEXT>

</row>

- <row>

<Date>20100222</Date>

<Identifier>AGR_TEXTS</Identifier>

<Flag>1</Flag>

<MANDT>100</MANDT>

<AGR_NAME>AUDITOR_A</AGR_NAME>

<SPRAS>4</SPRAS>

<LINE>00013</LINE>

<TEXT>SAP_AUDITOR_ A ##AIS - Autorizaţii centrale</TEXT>

Can you plz suggest how I can handle these special charecters....

Regards

Abhay

stefan_grube
Active Contributor
0 Kudos

It seems to be an IDoc.

Open an OSS ticket, when the IDoc data contain #0 values.

Check for SAP notes also.

abhay_aggarwal
Participant
0 Kudos

Hi ,

This is not idoc structure .we are simply sending the data through Proxy to File..........

Regards

Abhay

former_member200962
Active Contributor
0 Kudos

Is your Date in proper format?

Text Field seems to have some special characters, can you test if your scenario works if you do not send these characters in Text field (just for testing).

However I still fell that the starting line of your payload has some character (something like a space).... test your mapping in IR by manually entering the payload in the test tab .....the payload should be exactly same as your input payload....if successful, then trigger the interface with this payload.

Regards,

Abhishek.

stefan_grube
Active Contributor
0 Kudos

The sender is an ABAP proxy?

There might be an issue there.

Check the ABAP source code.

stefan_grube
Active Contributor
0 Kudos

> to validate this invalid data can you plz suggset me which fn i have to use ................

When the sender of the message provides an invalid document, please fix the error in the sender application.

former_member200962
Active Contributor
0 Kudos

You can either use JAVA or XSLT mapping to handle the special characters.....blogs for both area available....in XSLT it can be handled using CDATA tag.....also check if the sender is not passing this character unintentionally