Skip to Content
author's profile photo Former Member
Former Member

Mapping Problem

Hi,

i am executing Text file 2 XML..

i am getting this error, in I.R, when i am trying to execute with XML file generated from SXMB_MONI.

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

the XML File is

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

- <ns:MT_Out_Orders xmlns:ns="URN://Text">

- <Recordset>

- <Orders>

<OrderNo>1211</OrderNo>

<Item>Monitor</Item>

<Qty>5</Qty>

<Price>1200</Price>

</Orders>

+ <Orders>

<OrderNo>1213</OrderNo>

<Item>Mouse</Item>

<Qty>40</Qty>

<Price>10</Price>

</Orders>

- <Orders>

<OrderNo>1214</OrderNo>

<Item>Headphone</Item>

<Qty>90</Qty>

<Price>7</Price>

</Orders>

</Recordset>

</ns:MT_Out_Orders>

-


my incoming Datatype is like this

DT_Out_Orders
   Orders
      OrderNo
      Item
      Qty
      Price

my Sender Adapter (File)

Document Name           MT_Out_Orders
Document Namespace      URN://Text
Document Offset         0
Recordset Name 
Recordset Structure     Order,*
Recordsets per Message  *

Orders.fieldNames       OrderNo,Item,Qty,Price
Orders.fieldSeparator   ,
Orders.endSeparator     'nl'
Orders.processConfiguration FromConfiguration

Any sugg?

Thanks

Seshu

Add comment
10|10000 characters needed characters exceeded

10 Answers

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Aug 01, 2006 at 03:08 AM

    Hi Seshu,

    I do not know of any other way to do this, except by using a BPM.

    For BPM configuration, take a look at this..

    http://help.sap.com/saphelp_nw2004s/helpdata/en/3c/831620a4f1044dba38b370f77835cc/frameset.htm

    On this page, go through the tree structure on the left side of the screen. You have many examples of BPM configuration for different scenarios.

    Hope this helps!

    cheers,

    Prashanth

    P.S Please mark helpful answers

    Add comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jul 31, 2006 at 01:51 PM

    Hi Seshu,

    I agree with Sriram.Nice to see that your problem finally got solved

    cheers,

    Prashanth

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member Bhavesh Kantilal

      Hi Bhavesh,

      Thanks for reply, i will use single file adapter..

      then how to map.. hope you seen datatypes i posted in previous post in this thread..

      Thanks

      Seshu

  • Posted on Jul 29, 2006 at 08:44 PM

    Hi,

    But your post tells me that there is a error in the mapping.

    Check your input xml is in valid format ? Because if you copy the xml from SXMB_MONI , you will get - characters.. So it will give error. Delete these and check it.

    Refer this to get more.

    /people/michal.krawczyk2/blog/2005/09/16/xi-how-to-test-your-mapping-in-real-life-scenarios

    Regards,

    moorthy

    Add comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jul 29, 2006 at 10:14 PM

    Hi Seshu,

    It looks like a mapping error. Please test your mapping in IR with the payload from SXMB_MONI. You can refer michal's weblog for the same.

    /people/michal.krawczyk2/blog/2005/09/16/xi-how-to-test-your-mapping-in-real-life-scenarios

    cheers,

    Prashanth

    P.S Please mark helpful answers

    Add comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jul 29, 2006 at 10:19 PM

    Hi Seshu,

    Check with all these things ..

    1)In the sender file content conversion dont specify any name space name for the "recordset name space" and try the scenario

    2)When you pasted the xml check whether you have any spaces before start of the tag <?xml version="1.0" encoding="UTF-8"?>. If YES, remove the space and test your mapping again.

    3)Go to the test tab keep values in the fields and then click on XML and cross check this XML with your message in the SXMB_MONI.This is to check if ur XML is formatted well.

    Try these out and let me know.

    cheers,

    Prashanth

    P.S Please mark helpful answers

    Add comment
    10|10000 characters needed characters exceeded

  • Posted on Jul 31, 2006 at 03:29 AM

    Seshu,

    The problem is the "-" and "+" higlighted below. Remove them and test your scenario.

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

    <b>-</b> <ns:MT_Out_Orders xmlns:ns="URN://Text">

    <b>-</b> <Recordset>

    <b>-</b> <Orders>

    <OrderNo>1211</OrderNo>

    <Item>Monitor</Item>

    <Qty>5</Qty>

    <Price>1200</Price>

    </Orders>

    <b>+</b> <Orders>

    <OrderNo>1213</OrderNo>

    <Item>Mouse</Item>

    <Qty>40</Qty>

    <Price>10</Price>

    </Orders>

    <b>-</b> <Orders>

    <OrderNo>1214</OrderNo>

    <Item>Headphone</Item>

    <Qty>90</Qty>

    <Price>7</Price>

    </Orders>

    </Recordset>

    </ns:MT_Out_Orders></i>

    Regards,

    bhavesh

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member

      Hi Seshu,

      As suggested by Bhavesh, problem is with the '+' and '-' which are present in your message.

      To avoid this, in your sxmb_moni screen, right click on your message and select view source. Copy, paste the source of your xml file from there in your message mapping.

      Regards,

      Divija

      Message was edited by: Divija KN

  • author's profile photo Former Member
    Former Member
    Posted on Jul 31, 2006 at 04:03 AM

    You just try by giving input like this

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

    <ns0:MT_Out_Orders xmlns:ns="URN://Text">

    <Orders>

    <OrderNo>1211</OrderNo>

    <Item>monitor</Item>

    <Qty>5</Qty>

    <Price>100</Price>

    </Orders>

    <Orders>

    <OrderNo>1213</OrderNo>

    <Item>Mouse</Item>

    <Qty>5</Qty>

    <Price>10</Price>

    </Orders>

    <Orders>

    <OrderNo>1214</OrderNo>

    <Item>headphone</Item>

    <Qty>90</Qty>

    <Price>7</Price>

    </Orders>

    </ns:MT_Out_Orders>

    Add comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jul 31, 2006 at 06:21 AM

    Hi Seshu,

    The reason for the error that i am going to satae may not be the problem, but still u can try this. Hopefully the error might be resolved.

    In the sender adapter, u have mentioned:

    Recordset Structure Order,* (This Order does not end with an 's').

    But the file that u are passing has the recordset name as 'Orders'.

    Try correcting this.

    Regards

    Neetu

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      Seshu

      Ur original XML has the <recordset> tag which i think you have not removed while doing the content conversion.Actually its no way different from ur new XML tag <ORDERS> except that I think your XML instance you used for testing doesn't reference <Recordset> tag, hence the error..

      Got it.. 😊

  • author's profile photo Former Member
    Former Member
    Posted on Jul 31, 2006 at 01:45 PM

    Hi Seshu,

    It is the header mapping making the difference.

    cheers,

    Prashanth

    Add comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jul 31, 2006 at 04:18 PM

    Hi Seshu,

    Use a BPM to get the files, and check for the condition, and perform the mapping in the transformation step.

    cheers,

    Prashanth

    P.S Please mark helpful answers

    Add comment
    10|10000 characters needed characters exceeded