cancel
Showing results for 
Search instead for 
Did you mean: 

Mapping Problem

Former Member
0 Kudos

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

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

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

Answers (9)

Answers (9)

Former Member
0 Kudos

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

Former Member
0 Kudos

Hi,

is it possible without BPM?

if i want to use BPM.. how to know my BPM is running fine on the system..

thanks

Seshu

Former Member
0 Kudos

Hi Seshu,

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

cheers,

Prashanth

Former Member
0 Kudos

Hi,

one final question: how to map this.. multiple senders

1.

DT_Out_Orders

Orders

Order 1-unbounded

OrderNo

2.

DT_Out_OrdersItems

Items

Item 1-unbounded

OrderNo

Item

Qty

Price

Sender is coming from 2 text files

and need to club them as one file.. i.e orderno should match(from sender files), and one orderno may contain multiple items.

<u>Receiver</u>

DT_In_Bills

Bills

Bill 1-unbounded

RefNo

Item

Amount

thanks

Seshu

bhavesh_kantilal
Active Contributor
0 Kudos

Seshu,

Can you explain the requirements further?

Are your Files going to be picked by 2 independent File adapters or the same file adapter?

You can use a single File adapter to pick up multiple Files. See <a href="http://help.sap.com/saphelp_nw04/helpdata/en/3c/b4a6490a08cd41a8c91759c3d2f401/content.htm">Specifying Additional Files</a> in the File adapter for more info.

So, if you can look into the posswiblity of haveing multiple files picked by a single file adapter, then you can avoid a BPM.

File adapter will pick the 2 files, then perfrom the mapping based on the requirements you have and then send out the single message which you want.

Regards,

Bhavesh

Former Member
0 Kudos

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

Former Member
0 Kudos

Hi Seshu,

It is the header mapping making the difference.

cheers,

Prashanth

Former Member
0 Kudos

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

Former Member
0 Kudos

Hi,

thanks for replies. Problem solved.

i changed Data type like this..

<u>BEFORE:</u>


DT_Out_Orders
   Orders       1-Unbounded
      OrderNo
      Item
      Qty
      Price

<u>AFTER</u>


DT_Out_Orders
   Orders           1
     Order          1-Unbounded
       OrderNo
       Item
       Qty
       Price

What makes the difference? anybody can explain me please.

thanks

Former Member
0 Kudos

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..

Former Member
0 Kudos

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>

bhavesh_kantilal
Active Contributor
0 Kudos

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

Former Member
0 Kudos

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

Former Member
0 Kudos

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

Former Member
0 Kudos

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

moorthy
Active Contributor
0 Kudos

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