cancel
Showing results for 
Search instead for 
Did you mean: 

Create Deep Entity Error 'System expected the element'{http://www.w3.org/2005/Atom}entry'

0 Kudos

Hi,

I see some of the posts are talking about the same issue but I had gone through the solution what ever they discussed and it did not help actually for me. I have implemented the GET_ENTITYSET to get my fields and used as a Request for my POST operation for the same EntitySet to test my CREATE_ENTITY logic. But during the request I am facing the issue System expected the element '{http://www.w3.org/2005/Atom}entry'.

My XML request is pasted here

<feed 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"

xml:base="******/">

<id>************</id>
<title type="text">TagPrintSet</title>
TagPrintSet" rel="self" title="TagPrintSet"/>
<entry>
<id>http://*******(Tanum='0000123455',Lgnum='811',Ldest='11M1',Zdetag='001')</id>
<title type="text">TagPrintSet(Tanum='0000123455',Lgnum='811',Ldest='11M1',Zdetag='001')</title>
<updated>2019-01-29T04:54:18Z</updated>
<category term="ZMWM_PICKLIST_SRV.TagPrint" scheme="http://schemas.microsoft.com/ado/2007/08/dataservices/scheme"/>
<link href="TagPrintSet(Tanum='0000123455',Lgnum='811',Ldest='11M1',Zdetag='001')" rel="self" title="TagPrint"/>
<content type="application/xml">
<m:properties xmlns:m="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata" xmlns:d="http://schemas.microsoft.com/ado/2007/08/dataservices">
<d:Tanum>0000123455</d:Tanum>
<d:Lgnum>811</d:Lgnum>
<d:Ldest>11M1</d:Ldest>
<d:Zdetag>001</d:Zdetag>
</m:properties>
</content>
</entry>
</feed>

Thanks,

Karthik

View Entire Topic
Andre_Fischer
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi Karthik,

this is because though you specified a filter that presumably contains all four key fields of your entity you still perform a GET request on the ressource /sap/opu/odata/SAP/ZMWM_SAMPLE/TagPrintSet.

As a result the GET_ENTITYSET is called and if being implemented you would be able to retrieve the filter and search for the items for which the filter applies.

I order to get a single item you have to specifiy the key in brackets as follows

/sap/opu/odata/SAP/ZMWM_SAMPLE/TagPrintSet(f1='11111',f2='811',f3='11M1',f4='1')

In this case the GET_ENTITY method will be called.

I suggest that you implement both, the GET_ENTITYSET as well as the GET_ENTITY method.

Then you can perform a GET request on the Entity set, get back a list and select a single entry from the payload.

https://sapes5.sapdevcenter.com/sap/opu/odata/iwbep/GWSAMPLE_BASIC/SalesOrderLineItemSet(SalesOrderID='0500000001',ItemPosition='0000000010')

Will deliver the following Response (a single entry)

while

https://sapes5.sapdevcenter.com/sap/opu/odata/iwbep/GWSAMPLE_BASIC/SalesOrderLineItemSet?$filter=SalesOrderID%20eq%20'0500000001'%20and%20ItemPosition%20eq%20'0000000010'

Returns a list with just one entry, but a list (a feed in ATOM terms).

For more details on how to implement GET_ENTITY and GET_ENTITYSET see my following blog

https://blogs.sap.com/2016/05/31/odata-service-development-with-sap-gateway-code-based-service-devel...

Regards,

Andre


If one or more answers have answered your question please click on "✓ Accept"

0 Kudos

Awesome... It works.Thank you Fischer.

0 Kudos

May I ask one more question.. If I have an internal table(only one Internal table no other fields) as an input to my function module. Is it necessary to go with DEEP_ENTITY_SET? I see in the blog all the DEEP_ENTITY_SET examples are talking about header/item association. But I dont have any header/line item here.