Quantcast
Channel: SCN: Message List
Viewing all articles
Browse latest Browse all 8459

Re: Filtering OData Model data at client side (SAP UI5 program)

$
0
0

Let me explain you Jason.

 

 

Since I had an issue with my previous example I thought of creating a new service....which is below.

 

 

'Zuserid'  field is the Key..

 

 

My MetaData when I used URL : http://domain:port/sap/opu/odata/sap/ZUI5_SAMPLEUSERINFO_SRV/$metadata

 

 

----------------

 

 

<edmx:Edmx xmlns:edmx="http://schemas.microsoft.com/ado/2007/06/edmx" xmlns:m="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata"xmlns:sap="http://www.sap.com/Protocols/SAPData" Version="1.0">

 

 

<edmx:DataServices m:DataServiceVersion="2.0">

<Schema xmlns="http://schemas.microsoft.com/ado/2008/09/edm" Namespace="ZUI5_SAMPLEUSERINFO_SRV" xml:lang="en" sap:schema-version="0000">

<EntityType Name="UserInfoSample" sap:content-version="1">

<Key>

<PropertyRef Name="Zuserid"/>

</Key>

<Property Name="Zuserid" Type="Edm.String" Nullable="false" MaxLength="12" sap:label="Chgd by" sap:creatable="false" sap:updatable="false" sap:sortable="false"/>

<Property Name="Zaddr" Type="Edm.String" Nullable="false" MaxLength="50" sap:label="Address" sap:creatable="false" sap:updatable="false" sap:sortable="false"sap:filterable="false"/>

<Property Name="Zcountry" Type="Edm.String" Nullable="false" MaxLength="50" sap:label="Address" sap:creatable="false" sap:updatable="false" sap:sortable="false"sap:filterable="false"/>

</EntityType>

<EntityContainer Name="ZUI5_SAMPLEUSERINFO_SRV_Entities" m:IsDefaultEntityContainer="true">

<EntitySet Name="UserInfoSampleSet" EntityType="ZUI5_SAMPLEUSERINFO_SRV.UserInfoSample" sap:creatable="false" sap:updatable="false" sap:deletable="false" sap:pageable="false"sap:content-version="1"/>

</EntityContainer>

<atom:link xmlns:atom="http://www.w3.org/2005/Atom" rel="self" href="http://domain:port/sap/opu/odata/sap/ZUI5_SAMPLEUSERINFO_SRV/$metadata"/>

<atom:link xmlns:atom="http://www.w3.org/2005/Atom" rel="latest-version" href="http://domain:port/sap/opu/odata/sap/ZUI5_SAMPLEUSERINFO_SRV/$metadata"/>

</Schema>

</edmx:DataServices>

</edmx:Edmx>

 

 

-----------------

 

 

Now I used URL to test my getEntity() function which I implemented and it worked fine. URL is : http://domain:port/sap/opu/odata/sap/ZUI5_SAMPLEUSERINFO_SRV/UserInfoSampleSet('123098')

 

 

-------------------

 

 

<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://nwcedev1.amat.com:8000/sap/opu/odata/sap/ZUI5_SAMPLEUSERINFO_SRV/">

<id>

http://domain:port/sap/opu/odata/sap/ZUI5_SAMPLEUSERINFO_SRV/UserInfoSampleSet('123098')

</id>

<title type="text">UserInfoSampleSet('123098')</title>

<updated>2015-01-14T19:12:09Z</updated>

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

<link href="UserInfoSampleSet('123098')" rel="self" title="UserInfoSample"/>

<content type="application/xml">

<m:properties>

<d:Zuserid>123098</d:Zuserid>

<d:Zaddr>SORENIA STREET</d:Zaddr>

<d:Zcountry>SOMANIA</d:Zcountry>

</m:properties>

</content>

</entry>

 

 

-------------------

 

 

So whatever I am able to fetch using the above url (getting ne specific record) is what I what I want to achieve using my SAPUI5 program. Please advise.


Viewing all articles
Browse latest Browse all 8459

Trending Articles



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