Quantcast
Channel: SCN : All Content - SAP Gateway
Viewing all articles
Browse latest Browse all 2823

Create_deep_entity issue

$
0
0

Hi Experts,

 

I am creating a deep entity with one header and 4 items. I am using postman rest client in chrome browser. I am fetching the data by GET method and the URL for GET method is http://hostname:port/sap/opu/odata/sap/ZSALESORDER_SRV/SO_HEADERS?$filter=SO_ID eq '0000004970' &$expand=SO_ITEMSet , i have copied the response along with x-csrf token and replacing the token with its value and content-type = application/atom+xml. Now changing the method to POST and in the request body i have paste the code as below.


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

<feed xml:base="http://hostname:portname/sap/opu/odata/sap/ZSALESORDER_SRV/"

xmlns="http://www.w3.org/2005/Atom"

xmlns:m="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata"

xmlns:d="http://schemas.microsoft.com/ado/2007/08/dataservices">

<id>http://hostname:portname/sap/opu/odata/sap/ZSALESORDER_SRV/SO_HEADERS</id>

  <title type="text">SO_HEADERS</title>

<updated>2015-07-21T06:46:49Z</updated>

  <author>

  <name/>

  </author>

  <link href="SO_HEADERS" rel="self" title="SO_HEADERS"/>

  <entry>

<id>http://hostname:portname/sap/opu/odata/sap/ZSALESORDER_SRV/SO_HEADERS('4970')</id>

  <title type="text">SO_HEADERS('4970')</title>

<updated>2015-07-21T06:46:49Z</updated>

  <category term="ZSALESORDER_SRV.SO_HEADER" scheme="http://schemas.microsoft.com/ado/2007/08/dataservices/scheme"/>

  <link href="SO_HEADERS('4970')" rel="edit" title="SO_HEADER"/>

  <link href="SO_HEADERS('4970')/SO_ITEMSet" rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/SO_ITEMSet" type="application/atom+xml;type=feed" title="SO_ITEMSet">

<m:inline>

<feed xml:base="http://hostname:portname/sap/opu/odata/sap/ZSALESORDER_SRV/">

<id>http://hostname:portname/sap/opu/odata/sap/ZSALESORDER_SRV/SO_HEADERS('4970')/SO_ITEMSet</id>

<title type="text">SO_ITEMS</title>

<updated>2015-07-21T06:46:49Z</updated>

<author>

<name/>

</author>

<link href="SO_HEADERS('4970')/SO_ITEMSet" rel="self" title="SO_ITEMS"/>

<entry>

  <id>http://hostname:portname/sap/opu/odata/sap/ZSALESORDER_SRV/SO_ITEMS(SO_ID='4970',ITEM_NO='000010')</id>

<title type="text">SO_ITEMS(SO_ID='4970',ITEM_NO='000010')</title>

<updated>2015-07-21T06:46:49Z</updated>

<category term="ZSALESORDER_SRV.SO_ITEM" scheme="http://schemas.microsoft.com/ado/2007/08/dataservices/scheme"/>

<link href="SO_ITEMS(SO_ID='4970',ITEM_NO='000010')" rel="edit" title="SO_ITEM"/>

<content type="application/xml">

<m:properties>

<d:SO_ID>0</d:SO_ID>

<d:ITEM_NO>10</d:ITEM_NO>

<d:MAT_NO>100-100</d:MAT_NO>

<d:PLANT>1000</d:PLANT>

<d:TARGET_QTY>4</d:TARGET_QTY>

<d:TARGET_QU>ST</d:TARGET_QU>

<d:ITEM_CATEG>TAN</d:ITEM_CATEG>

<d:PURCH_NO_C>TEST ORDER</d:PURCH_NO_C>

<d:PURCH_DATE>20150728</d:PURCH_DATE>

<d:INCOTERMS1>CIP</d:INCOTERMS1>

<d:INCOTERMS2>Nürnberg</d:INCOTERMS2>

<d:PMNTTRMS>ZB01</d:PMNTTRMS>

<d:PRICE_DATE>20150721</d:PRICE_DATE>

<d:SALES_UNIT>ST</d:SALES_UNIT>

<d:DIVISION>00</d:DIVISION>

<d:CURRENCY>EUR</d:CURRENCY>

</m:properties>

</content>

</entry>

<entry>

  <id>http://hostname:portname/sap/opu/odata/sap/ZSALESORDER_SRV/SO_ITEMS(SO_ID='4970',ITEM_NO='000020')</id>

<title type="text">SO_ITEMS(SO_ID='4970',ITEM_NO='000020')</title>

<updated>2015-07-21T06:46:49Z</updated>

<category term="ZSALESORDER_SRV.SO_ITEM" scheme="http://schemas.microsoft.com/ado/2007/08/dataservices/scheme"/>

<link href="SO_ITEMS(SO_ID='4970',ITEM_NO='000020')" rel="edit" title="SO_ITEM"/>

<content type="application/xml">

<m:properties>

<d:SO_ID>0</d:SO_ID>

<d:ITEM_NO>20</d:ITEM_NO>

<d:MAT_NO>100-100</d:MAT_NO>

<d:PLANT>1000</d:PLANT>

<d:TARGET_QTY>3</d:TARGET_QTY>

<d:TARGET_QU>ST</d:TARGET_QU>

<d:ITEM_CATEG>TAN</d:ITEM_CATEG>

<d:PURCH_NO_C>TEST ORDER</d:PURCH_NO_C>

<d:PURCH_DATE>20150728</d:PURCH_DATE>

<d:INCOTERMS1>CIP</d:INCOTERMS1>

<d:INCOTERMS2>Nürnberg</d:INCOTERMS2>

<d:PMNTTRMS>ZB01</d:PMNTTRMS>

<d:PRICE_DATE>20150721</d:PRICE_DATE>

<d:SALES_UNIT>ST</d:SALES_UNIT>

<d:DIVISION>00</d:DIVISION>

<d:CURRENCY>EUR</d:CURRENCY>

</m:properties>

</content>

</entry>

<entry>

  <id>http://hostname:portname/sap/opu/odata/sap/ZSALESORDER_SRV/SO_ITEMS(SO_ID='4970',ITEM_NO='000030')</id>

<title type="text">SO_ITEMS(SO_ID='4970',ITEM_NO='000030')</title>

<updated>2015-07-21T06:46:49Z</updated>

<category term="ZSALESORDER_SRV.SO_ITEM" scheme="http://schemas.microsoft.com/ado/2007/08/dataservices/scheme"/>

<link href="SO_ITEMS(SO_ID='4970',ITEM_NO='000030')" rel="edit" title="SO_ITEM"/>

<content type="application/xml">

<m:properties>

<d:SO_ID>0</d:SO_ID>

<d:ITEM_NO>30</d:ITEM_NO>

<d:MAT_NO>100-100</d:MAT_NO>

<d:PLANT>1000</d:PLANT>

<d:TARGET_QTY>2</d:TARGET_QTY>

<d:TARGET_QU>ST</d:TARGET_QU>

<d:ITEM_CATEG>TAN</d:ITEM_CATEG>

<d:PURCH_NO_C>TEST ORDER</d:PURCH_NO_C>

<d:PURCH_DATE>20150728</d:PURCH_DATE>

<d:INCOTERMS1>CIP</d:INCOTERMS1>

<d:INCOTERMS2>Nürnberg</d:INCOTERMS2>

<d:PMNTTRMS>ZB01</d:PMNTTRMS>

<d:PRICE_DATE>20150721</d:PRICE_DATE>

<d:SALES_UNIT>ST</d:SALES_UNIT>

<d:DIVISION>00</d:DIVISION>

<d:CURRENCY>EUR</d:CURRENCY>

</m:properties>

</content>

</entry>

<entry>

  <id>http://hostname:portname/sap/opu/odata/sap/ZSALESORDER_SRV/SO_ITEMS(SO_ID='4970',ITEM_NO='000040')</id>

<title type="text">SO_ITEMS(SO_ID='4970',ITEM_NO='000040')</title>

<updated>2015-07-21T06:46:49Z</updated>

<category term="ZSALESORDER_SRV.SO_ITEM" scheme="http://schemas.microsoft.com/ado/2007/08/dataservices/scheme"/>

<link href="SO_ITEMS(SO_ID='4970',ITEM_NO='000040')" rel="edit" title="SO_ITEM"/>

<content type="application/xml">

<m:properties>

<d:SO_ID>0</d:SO_ID>

<d:ITEM_NO>40</d:ITEM_NO>

<d:MAT_NO>100-100</d:MAT_NO>

<d:PLANT>1000</d:PLANT>

<d:TARGET_QTY>1</d:TARGET_QTY>

<d:TARGET_QU>ST</d:TARGET_QU>

<d:ITEM_CATEG>TAN</d:ITEM_CATEG>

<d:PURCH_NO_C>TEST ORDER</d:PURCH_NO_C>

<d:PURCH_DATE>20150728</d:PURCH_DATE>

<d:INCOTERMS1>CIP</d:INCOTERMS1>

<d:INCOTERMS2>Nürnberg</d:INCOTERMS2>

<d:PMNTTRMS>ZB01</d:PMNTTRMS>

<d:PRICE_DATE>20150721</d:PRICE_DATE>

<d:SALES_UNIT>ST</d:SALES_UNIT>

<d:DIVISION>00</d:DIVISION>

<d:CURRENCY>EUR</d:CURRENCY>

</m:properties>

</content>

</entry>

</feed>

</m:inline>

  </link>

  <link href="SO_HEADERS('4970')/$links/SO_ITEMSet" rel="http://schemas.microsoft.com/ado/2007/08/dataservices/relatedlinks/SO_ITEMSet" type="application/xml" title="SO_ITEMSet"/>

  <content type="application/xml">

<m:properties>

<d:SO_ID>0</d:SO_ID>

<d:CURRENCY>EUR</d:CURRENCY>

<d:DOC_TYPE>OR</d:DOC_TYPE>

<d:DOC_DATE>20150721</d:DOC_DATE>

<d:SALES_ORG>1000</d:SALES_ORG>

<d:DIST_CHANNEL>10</d:DIST_CHANNEL>

<d:DIVISION>00</d:DIVISION>

<d:SALES_GRP>130</d:SALES_GRP>

<d:SALES_OFF>1030</d:SALES_OFF>

<d:REQ_DATE_H m:null="true"/>

<d:PURCH_DATE m:null="true"/>

<d:INCOTERMS1>CIP</d:INCOTERMS1>

<d:INCOTERMS2>Nürnberg</d:INCOTERMS2>

<d:PMNTTRMS>ZB01</d:PMNTTRMS>

<d:PRICE_DATE>20150721</d:PRICE_DATE>

<d:PURCH_NO_C>TEST ORDER</d:PURCH_NO_C>

</m:properties>

  </content>

  </entry>

</feed>

 

For POST method, the URL is http://hostname:port/sap/opu/odata/sap/ZSALESORDER_SRV/SO_HEADERSwhen i execute it the break point not triggered in the create_deep_entitty method and i am getting the error as


<?xmlversion="1.0" encoding="utf-8"?>

<error
    xmlns="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata">
    <code>CX_ST_MATCH_ELEMENT/544FAE4641562346A1372144E7396586</code>
    <messagexml:lang="en">System expected the element '{http://www.w3.org/2005/Atom}entry'</message>
    <innererror>
        <transactionid>5A7D2FE5FAE1F1609A3F005056BE7049</transactionid>
        <errordetails/>
    </innererror>
</error>

 

 

Please help me to resolve this issue.

 

Thanks,

Gowtham


Viewing all articles
Browse latest Browse all 2823

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>