Quantcast
Channel: SCN : All Content - All Communities
Viewing all articles
Browse latest Browse all 8735

oData $filter parameter trouble

$
0
0

Hi Guys,

 

I am a beginner for developing with SAPUI5 and I am currently working on creating SAP-Fiori-like UIs for mobile Clients. Right now I want to just read from an oData Service we created. If I ask for the metadata I get the following:

 

<EntityType Name="Bonuseintrag" sap:content-version="1">                <Key>                    <PropertyRef Name="Guid" />                </Key>                <Property Name="Guid" Type="Edm.Binary" Nullable="false" sap:label="Guid" sap:creatable="false" sap:updatable="false" sap:sortable="false" sap:filterable="false" />                <Property Name="Hjahr" Type="Edm.String" Nullable="false" MaxLength="1" sap:label="Halbjahr" sap:creatable="false" sap:updatable="false" sap:sortable="false" sap:filterable="false" />                <Property Name="Kjahr" Type="Edm.String" Nullable="false" MaxLength="4" sap:label="Kalenderjahr" sap:creatable="false" sap:updatable="false" sap:sortable="false" sap:filterable="false" />                <Property Name="Bpartner" Type="Edm.String" Nullable="false" MaxLength="10" sap:label="Beteiligter" sap:creatable="false" sap:updatable="false" sap:sortable="false" />            </EntityType>

Now I won't to access some sample Data in the following way:

 

// Using OData model to connect against a real service  var url = "proxy/http/crs.rz.sys.aok.de:8841/sap/opu/odata/sap/ZCM22_SERVICES_SRV_01/";  var oModel = new sap.ui.model.odata.ODataModel(url, false);  var params = {  context : null,  urlParameters : null,  async : false,  filters : [new sap.ui.model.Filter("Bpartner", sap.ui.model.FilterOperator.EQ, "5000076093")],  sorters : null,  success : function(oData, response) {  console.log(response),  console.log("-------"),  console.log(oData)  },  error : function(err) {  console.log(err)  }  };  oModel.read("BonuseintragSet", params);  //oView.setModel(oModel);

There is my problem. It seems like the read functions does not acknowledge the filter because I cannot see it in the GET request. In addition to this, I found something strange in the SDK API Reference OpenUI5 SDK - Demo Kit

sap.PNG

As you can hopefully see, all the Parameters have a s at the end but not the filters nor the sorters array. Does that mean something or am I just doing something horribly wrong? I am not even that sure, that we implemented the Service properly in the System.

 

Thanks a lot.

Nils


Viewing all articles
Browse latest Browse all 8735

Trending Articles



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