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

Filter Offline Store in Native Android App for SMP 3

$
0
0

Hello,

 

I develop a native Android App that use a OData Gateway Service. For that I followed the guides postet by Claudia for the offline store.

Everything works fine for the following example:

My OData Service http://hostname:port/sap/servicename.srv/ returns for a unfilterted request of ProductSet all Products

In my code:

 

[...]

ODataOfflineStoreOptions options = new ODataOfflineStoreOptions();

options.addDefiningRequest("ProductSet", "ProductSet", false);

offlineStore.openStoreSync(options);

[...]

 

String resourcePath = "ProductSet?$filter=Manufactor%20eq%20%27ABC%27%20;
ODataRequestParamSingle request = new ODataRequestParamSingleDefaultImpl();
request.setMode(ODataRequestParamSingle.Mode.Read);
request.setResourcePath(resourcePath);
ODataResponseSingle response = (ODataResponseSingle) offlineStore.executeRequest(request);

 

So if the unfiltered service return 20 Products, the filtered returns 3 Products. Everything is fine.

 

My Problem is now that the OData Gateway Service return 0 Products for unfiltered Requests. Thats because of to large Data and security reasons.

So http://hostname:port/sap/servicename.srv/ProductSet return 0

     http://hostname:port/sap/servicename.srv/ProductSet?$filter=Manufactor eq 'ABC' return 3

 

That means for my Code snippet above an empty offline store and my filtered request is useless. I have to fill the offline store with a filter. So I tried

 

[...]

ODataOfflineStoreOptions options = new ODataOfflineStoreOptions();

options.addDefiningRequest("ProductSet", "ProductSet?$filter=Manufactor%20eq%20%27ABC%27%20", false);

offlineStore.openStoreSync(options);

[...]

 

But that also leads to an empty store. How can I get a Offline Store with pre-filtered Data?

 

Thanks in advance,

Mirco


Viewing all articles
Browse latest Browse all 3353

Trending Articles



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