cancel
Showing results for 
Search instead for 
Did you mean: 

Mapping Exception (File to IDOC scenario)

Former Member
0 Kudos

Hello,

I just tested the IDOC adapter in our PI7.3 system in a simple file to IDOC scenario. The file adapter reads in material information from a simple XML file and then it goes via IDOC into a SAP ERP 6.0 system. Reading the file works fine, but I always get this error in SXMB_MONI:

<SAP:Error SOAP:mustUnderstand="" xmlns:SAP="http://sap.com/xi/XI/Message/30" xmlns:SOAP="http://schemas.xmlsoap.org/soap/envelope/">

<SAP:Category>Application</SAP:Category>

<SAP:Code area="MAPPING">EXCEPTION_DURING_EXECUTE</SAP:Code>

<SAP:P1>com/sap/xi/tf/_Material_to_MATMAS_MATMAS02_</SAP:P1>

<SAP:P2>com.sap.aii.utilxi.misc.api.BaseRuntimeException:</SAP:P2>

<SAP:P3>The end-tag for element type "ns1:MT_Material" mus</SAP:P3>

<SAP:P4>t end with a '>' delimiter.</SAP:P4>

<SAP:AdditionalText />

<SAP:Stack>Runtime exception occurred during application mapping com/sap/xi/tf/_Material_to_MATMAS_MATMAS02_; com.sap.aii.utilxi.misc.api.BaseRuntimeException:The end-tag for element type "ns1:MT_Material" must end with a &#39;>&#39; delimiter.</SAP:Stack>

<SAP:Retry>M</SAP:Retry>

</SAP:Error>

My mapping is very simple, I tested it in the designer and there were no errors:

The XML file looks like this (the content is just test data and no real material masterdata):

<?xml version="1.0"?>

          <ns1:MT_Material xmlns:ns1="http://mynamespace">

          <BRGEW>100.000</BRGEW>

          <NETGEW>90.000 </NETGEW>

          <ERNAM>PECHTOR</ERNAM>

          <ERSDA>21042013</ERSDA>

          <GEWEI>KG</GEWEI>

          <MAKTX>Test</MAKTX>

          <MATKL>001</MATKL>

          <MATNR>100-100</MATNR>

          <MBRSH>1</MBRSH>

          <MEINS>KG</MEINS>

          <MTART>1233</MTART>

          <MTPOS_MARA>1</MTPOS_MARA>

</ns1:MT_Material xmlns:ns1="http://mynamespace">

Has anybody an idea how I can solve this issue?

Thanks in advance!

Regards

Václav

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Vaclav,

As Raga said, the end tag is missing in the payload.

The end tag should be like this..

and moreover no need to add name space at the end tag, Remove the namespace and try it out. it will work.

Former Member
0 Kudos

Hi Guys,

thanks for your suggestions, this is what I tried today:

  • Remove the namespace from the end tag. The XML looks now like this:

<ns1:MT_Material xmlns:ns1="http://mynamespace">

<BRGEW>100.000</BRGEW>

<NETGEW>90.000 </NETGEW>

<ERNAM>PECHTOR</ERNAM>

<ERSDA>21042013</ERSDA>

<GEWEI>KG</GEWEI>

<MAKTX>Test</MAKTX>

<MATKL>001</MATKL>

<MATNR>100-100</MATNR>

<MBRSH>1</MBRSH>

<MEINS>KG</MEINS>

<MTART>1233</MTART>

<MTPOS_MARA>1</MTPOS_MARA>

</ns1:MT_Material">

Unfortunatelly this did not work and the same error came up in the message monitor

  • Testing the data in the builder:

As you can see, the test actually worked

  • I saved the payload from SXMB_MONI to a local file and opended it in internet explorer:

So, the input ssems to be fine. What else can I check?

Thanks!

Regards

Václav

Former Member
0 Kudos

Hi Vaclav,

Test the message mapping manually and take the xml from test tab and place in the source folder and try to execute the scenario end to end.

Thanks,

Satish.

former_member184720
Active Contributor
0 Kudos

Hi Vaclav,

Can you cross check if you have placed the correct file? I mean have you placed the XML after removing the namespace in the end tag?

And as per the screenshot(from sxmb_moni) i don't think the input file is an XML file.

Are you doing any content conversion in the file channel? If there is no content conversion directly place the xml from test tab into a file and process it.

Regards,

Hareesh

Former Member
0 Kudos

Hi Satish,

your soultion actually worked! I figured out that there was an error in my namespace (I used http://mynamespace instead of http://mynamespace.customer.customerdomain).

Thanks a lot!

Now I'm facing another issue - the IDOC is not transmitted propperly:

- <SAP:Error SOAP:mustUnderstand="" xmlns:SAP="http://sap.com/xi/XI/Message/30" xmlns:SOAP="http://schemas.xmlsoap.org/soap/envelope/">

<SAP:Category>XIAdapter</SAP:Category>

<SAP:Code area="IDOC_ADAPTER">ATTRIBUTE_IDOC_METADATA</SAP:Code>

<SAP:P1>I::000</SAP:P1>

<SAP:P2 />

<SAP:P3 />

<SAP:P4 />

<SAP:AdditionalText />

<SAP:Stack>Error: I::000</SAP:Stack>

<SAP:Retry>M</SAP:Retry>

</SAP:Error>

But this is a separate issue, i will open a new topic for this.

Regards

Václav

Answers (3)

Answers (3)

anupam_ghosh2
Active Contributor
0 Kudos

Hi Václav,

                    In sxmb_moni go to input payload, right click -> view source, save this in a notepad as xml file in your local system. Now try opening this xml using browser in your local system. If it shows same error your then  source xml is not complete one. It is missing the end tag. 

Regards

Anupam

former_member184720
Active Contributor
0 Kudos

Hi Vaclav,

the problem is with the input xml. This is not required. the end tag doesn't need namespace in it.

Use the below xml.

<?xml version="1.0"?>

          <ns1:MT_Material xmlns:ns1="http://mynamespace">

          <BRGEW>100.000</BRGEW>

          <NETGEW>90.000 </NETGEW>

          <ERNAM>PECHTOR</ERNAM>

          <ERSDA>21042013</ERSDA>

          <GEWEI>KG</GEWEI>

          <MAKTX>Test</MAKTX>

          <MATKL>001</MATKL>

          <MATNR>100-100</MATNR>

          <MBRSH>1</MBRSH>

          <MEINS>KG</MEINS>

          <MTART>1233</MTART>

          <MTPOS_MARA>1</MTPOS_MARA>

</ns1:MT_Material>

It works.

Regards,

Hareesh

rajasekhar_reddy14
Active Contributor
0 Kudos

it looks your test data may be misisng end tag. Test message mapping by netering values manually in test tab and test.

Let us know results.