Quantcast
Channel: SCN : Discussion List - SAP for Mobile
Viewing all articles
Browse latest Browse all 5806

oModel Data and List BindItems message

$
0
0

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:


<entryxmlns="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/">

 

<scriptid="tinyhippos-injected"/>

 

 

 

<titletype="text">

 

ApplicationServiceSet(fld='0007',fld2='0007',fld3='65')

</title>

<updated>2014-06-05T13:39:15Z</updated>

<categoryterm="MyService_SRV.ApplicationServiceSet"scheme="http://schemas.microsoft.com/ado/2007/08/dataservices/scheme"/>

<linkhref="ApplicationServiceSet(fld='0007',fld2='0007',fld3='65')"rel="self"title="applicationid"/>

 

<contenttype="application/xml">

 

 

<m:properties>

 

 

<d:fld1>0004</d:fld1>

 

<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


Viewing all articles
Browse latest Browse all 5806

Trending Articles



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