cancel
Showing results for 
Search instead for 
Did you mean: 

error in file to file using FCC

Former Member
0 Kudos

hey guys

i m doin File to file scenario using FCC and getting the followin error in message mapping when i load the payload from SXMB_MONI

23:43:10 Start of test

Fatal Error: com.sap.engine.lib.xml.parser.ParserException: XML Declaration not allowed here.(:main:, row:1, col:8)

23:43:10 End of test

the payload is of the form

<?xml version="1.0" encoding="utf-8" ?>

- <ns:DT_sender xmlns:ns="http://thoughtbyte.com">

- <Recordset>

- <Row>

<Name><?xml version="1.0" encoding="utf-8" ?></Name>

</Row>

- <Row>

<Name>- <ns:DT_sender xmlns:ns="http://thoughtbyte.com"></Name>

</Row>

- <Row>

<Name>- <Recordset></Name>

</Row>

- <Row>

<Name>- <Row></Name>

</Row>

- <Row>

<Name><Name><?xml version="1.0" encoding="UTF-8"?></Name></Name>

</Row>

- <Row>

<Name></Row></Name>

</Row>

- <Row>

<Name>- <Row></Name>

</Row>

- <Row>

<Name><Name><ns:MT_sender xmlns:ns="http://thoughtbyte.com"></Name></Name>

</Row>

- <Row>

<Name></Row></Name>

</Row>

- <Row>

<Name>- <Row></Name>

</Row>

- <Row>

<Name><Name><Recordset></Name></Name>

</Row>

- <Row>

<Name></Row></Name>

</Row>

- <Row>

<Name>- <Row></Name>

</Row>

- <Row>

<Name><Name><Row></Name></Name>

</Row>

- <Row>

<Name></Row></Name>

</Row>

- <Row>

<Name>- <Row></Name>

</Row>

- <Row>

<Name><Name><Name>ewqe</Name></Name></Name>

</Row>

- <Row>

<Name></Row></Name>

</Row>

- <Row>

<Name>- <Row></Name>

</Row>

- <Row>

<Name><Name><Age>das</Age></Name></Name>

</Row>

- <Row>

<Name></Row></Name>

</Row>

- <Row>

<Name>- <Row></Name>

</Row>

- <Row>

<Name><Name><Dept>fggfgf</Dept></Name></Name>

</Row>

- <Row>

<Name></Row></Name>

</Row>

- <Row>

<Name>- <Row></Name>

</Row>

- <Row>

<Name><Name></Row></Name></Name>

</Row>

- <Row>

<Name></Row></Name>

</Row>

- <Row>

<Name>- <Row></Name>

</Row>

- <Row>

<Name><Name></Recordset></Name></Name>

</Row>

- <Row>

<Name></Row></Name>

</Row>

- <Row>

<Name>- <Row></Name>

</Row>

- <Row>

<Name><Name></ns:MT_sender></Name></Name>

</Row>

- <Row>

<Name></Row></Name>

</Row>

- <Row>

<Name></Recordset></Name>

</Row>

- <Row>

<Name></ns:DT_sender></Name>

</Row>

</Recordset>

</ns:DT_sender>

any idea where the error might be?

thanx

ahmad

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Ahmad,

Dont copy and paste the payload as it is. Download the xml from moni, then view the source of xml,get the content and test.

ur current xml has invalid chars '-' eg -<Row>

Correct ur xml and test.

Regards,

Sudharshan

Former Member
0 Kudos

hey guys

i m still getting the same error,even though i have changed the payload

<?xml version="1.0" encoding="utf-8" ?>

<ns:DT_sender xmlns:ns="http://thoughtbyte.com">

<Recordset>

<Row>

<?xml version="1.0" encoding="UTF-8"?>

</Row>

<Row>

<ns:MT_sender xmlns:ns="http://thoughtbyte.com">

</Row>

<Row>

<Recordset>

</Row>

<Row>

<Row>

</Row>

<Row>

<Name>dsfdf</Name>

</Row>

<Row>

<Age>ghhg</Age>

</Row>

<Row>

<Dept>gfgfg</Dept>

</Row>

<Row>

</Row>

</Row>

<Row>

</Recordset>

</Row>

<Row>

</ns:MT_sender>

</Row>

</Recordset>

</ns:DT_sender>

i didnt knew why i waz getting <name></name> so i manually deleted them and also deleted the "-" and the pasted this in the file to be picked,file is pickin up but not being delivered and the error is still the same

00:27:23 Start of test

Fatal Error: com.sap.engine.lib.xml.parser.ParserException: XML Declaration not allowed here.(:main:, row:1, col:8)

00:27:23 End of test

thanx

ahmad

former_member192798
Active Contributor
0 Kudos

Hi Ahmad,

Your xml structure is not well formed and you have made xml declarations within the structure which has caused the ParserException error.

What are you trying to achieve thro' File Content Conversion within this structure. How should your output look like. Can you elaborate.

Regards.

Praveen

Former Member
0 Kudos

Hey

actually i m in the learning phase of SAP XI so m just doin thsi by myself.

my sender and target both have same structure(Name,Age,Dept)

and i m trying to send a XML file from the sender and convert that XML using FCC to a flat file which should display the Name,Age and Dept.

i always get the same error every time i do any scenario like dis,i m not sure which XML structure and how should i paste in the sender file to make mapping work?

thanx

ahmad

bhavesh_kantilal
Active Contributor
0 Kudos

Ahmad,

Like I told the problem is due to incorrect XMl declaration. You have

<i><Row>

<?xml version="1.0" encoding="UTF-8"?>

</Row></i>

this is not a valid XML.

Regards,

Bhavesh

former_member192798
Active Contributor
0 Kudos

Hi Ahmad,

The scenario which you are trying is quite simple. Refer to this document and you can easily achieve it.

http://help.sap.com/saphelp_nw04/helpdata/en/d2/bab440c97f3716e10000000a155106/frameset.htm

If you are still unable to do it, do let me know.

Regards.

Praveen

bhavesh_kantilal
Active Contributor
0 Kudos

Ahmad,

Use the TEST tool to create your Source XML. Go to your message mapping > TEST tab> fill the XML with values and then click on SRC and copy the source and paste this as an XML file.

Use this as an XML and test your scenario.

Regards.

Bhavesh

former_member192798
Active Contributor
0 Kudos

Hi Ahmad,

Your source XML file should be of this stucture:-

<?xml version="1.0" encoding="UTF-8"?>

<ns0:MT_Employee xmlns:ns0="urn:f2r3.com/xi">

<EmployeeDetails>

<Name>Ahmad Ansari</Name>

<Age>25</Age>

<Dept>XI</Dept>

</EmployeeDetails>

</ns0:MT_Employee>

Thereafter, you can do the file content conversion.

Regards.

Praveen

Former Member
0 Kudos

Hey

this is my XML structure i m using in the scenario

<?xml version="1.0" encoding="UTF-8"?>

<ns:MT_sender xmlns:ns="http://thoughtbyte.com">

<Recordset>

<Row>

<Name>Mark</Name>

<Age>25</Age>

<Dept />

</Row>

</Recordset>

</ns:MT_sender>

but its still giving me the same problem

thanx

ahmad

former_member192798
Active Contributor
0 Kudos

Hi Ahmad,

Your structure is correct. I think you are doing some mistake in the file content conversion part.

Check the parameters which you are specifying in the file content conversion.

Regards.

Praveen

bhavesh_kantilal
Active Contributor
0 Kudos

Hi,

Is your source Datatype confirming to this XML?

Regards,

Bhavesh

Former Member
0 Kudos

Yeah it does confirm to the XML but every time in the payload in moni i see an extra <Name> tag for e.g. <Name></ns:MT_sender></Name> and i dont know how it is comin and whether it is right or wrong.

thanx

ahmad

bhavesh_kantilal
Active Contributor
0 Kudos

Hi,

Are you using Content Conversion on the sender file adapter? If yes, for the moment can you remove the same on the sender file adapter and then use the XML posted above in your thread and check the same?

Also, open the XMl file in a browser like Internet Explorer and see if the format is what you have listed above actually?

Regards,

Bhavesh

former_member192798
Active Contributor
0 Kudos

Hi Ahmad,

Your file content conversion parameters should be :-

Recordset Structure = Recordset,Row

Recordset.endSeparator = 'nl'

Recordset.fieldNames = Row

Recordset.fieldSeparator = 'nl'

Recordset.fieldFixedLengths = 37 (specify the total Length of Name, Age and Dept)

Row.fieldNames = Name,Age,Dept

Row.fieldFixedLengths = 20,7,10

Row.endSeparator = 'nl'

Regards.

Praveen

Former Member
0 Kudos

Hey

if i remove the fcc the file is being delivered properly ,does that means problem is with my fcc parameters?

thanx ahmad

former_member192798
Active Contributor
0 Kudos

Hi Ahmad,

Yes as I replied you earlier, the problem is with your file content conversion parameters.

I have already given some tips on FCC parameters in my earlier reply. Refer to that and implement it. You should be able to achieve.

Regards.

Praveen

Former Member
0 Kudos

Thanx Praveen and Bhavesh

really appreciate help of u guys,now its working fine

thanx

ahmad

bhavesh_kantilal
Active Contributor
0 Kudos

Ahmad,

At times self debugging can go a loong way in helping you understand things.

Do try to understand the error you are getting and the reason for the same always.

Regards,

Bhavesh

former_member192798
Active Contributor
0 Kudos

Hi Ahmad,

You should document your errors and learnings thereon so that you can help others during a similar situation and at the same time will help you in future.

Regards.

Praveen

Answers (1)

Answers (1)

bhavesh_kantilal
Active Contributor
0 Kudos

Ahmad,

There is a "-" in your XML. Pleae remove these "-" from your XML and then it will work fine.

Alsom you have <i><Name><?xml version="1.0" encoding="utf-8" ?></Name></i> in your source XML which doesnt make sense.

And, at places you have made NAME as a Node and at places the NAME acts as an ELEMENT. Please ensure that your Source XML is valid.

Regards,

Bhavesh