on 06-05-2014 2:56 PM
I have an sap.m.List that I aggregate with data from an oModel. But I am coming back with this message that I see from SMP 2.3 logs because my List is empty; I've validated that the query is correct and does return data when I run this same query from Chrome.
The error message from SMP 2.3 logs:
The request URI is not valid. The segment 'ApplicationServiceSet' refers to an entity set and not to a single entity
When run through the browser this is the result:
<entry 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="http://MyService_SRV/">
ApplicationServiceSet(fld='0007',fld2='0007',fld3='65')
</title>
<updated>2014-06-05T13:39:15Z</updated>
<category term="MyService_SRV.ApplicationServiceSet" scheme="http://schemas.microsoft.com/ado/2007/08/dataservices/scheme"/>
<link href="ApplicationServiceSet(fld='0007',fld2='0007',fld3='65')" rel="self" title="applicationid"/>
<d:fld2>0007</d:fld2>
<d:fld3>My Loc</d:fld3>
</m:properties>
</content>
</entry>
My binding to my List is this:
.....var omodel = sap.ui.model.odata.ODataModel(serviceURL, false, username, pwd);
.....
var oCore = sap.ui.getCore().setModel(omodel);
myList.bindItems({
path: /ApplicationServiceSet,
template: mytemplate,
filters: [f1, f2, f3]
});
I have this same setup on another application that uses this exact code but calling a different OData Model and that is working fine. The difference is that the model on the other application is a list of fld3, in this case is a list of materials base on location and date.
In this issue, the user searches specifically for material#, location and date so I expect only one result. I was thinking that the code should work I just need to change the sPath, field names are even the same. Only difference is that this List, though aggregated, should still work. However, I get the above message of "refers to an entity set and not a single entity"......
So not sure if there's a different way of implementing how a record is returned when it comes to using the API or if this is something on the BAPI end?
Any help is greatly appreciated. Thanks.
J
Looks like your url should be using... $filter=
Are you defining your filters with sap.ui.model.Filter?
Regards,
Jamie
SAP - Customer Experience Group
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks Jamie. I do have my filters defined and for testing, I have hard coded the values. There's a few more info I should have added.
1. I have the same application using the same code for another service which works fine. Since the query is essentially the same, I just needed to change the URL to point to the right service and the correct sPath
2. We are going through SMP 2.3 to get to Gateway so the alias or the end point is: http://mydomain:port/com.my.applicationID
3. I used RESTcClient to test the end point directly to GW and it is fine. I don't think this is an SMP issue, but I'm not sure.
Thanks for the reply
User | Count |
---|---|
88 | |
23 | |
11 | |
9 | |
8 | |
5 | |
5 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.