<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>Question Re: Get specific amount of data from OData in Technology Q&amp;A</title>
    <link>https://community.sap.com/t5/technology-q-a/get-specific-amount-of-data-from-odata/qaa-p/11415701#M4241328</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Ok, sorry, I forgot to add ? between. Now in the Gateway Client it's working fine but for my app I get a bad-request (400) error. Any clue?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 26 Nov 2015 17:06:19 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2015-11-26T17:06:19Z</dc:date>
    <item>
      <title>Get specific amount of data from OData</title>
      <link>https://community.sap.com/t5/technology-q-a/get-specific-amount-of-data-from-odata/qaq-p/11415695</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I consume data from my OData service which I would like to store into JSON. It looks like this:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
&lt;P&gt;var oModel = new sap.ui.model.json.JSONModel();&lt;/P&gt;
&lt;P&gt;var url = "/Service-url/EntitySet";&lt;/P&gt;
&lt;P&gt;oModel.loadData(url,"",false);&lt;/P&gt;
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;But because I'm consuming a huge amount of data I get a Time-Out error. &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;1. How can I say just give me only 100 fields? How does the code look like for this approach?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;Thank you in advance.&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 26 Nov 2015 14:10:24 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/get-specific-amount-of-data-from-odata/qaq-p/11415695</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2015-11-26T14:10:24Z</dc:date>
    </item>
    <item>
      <title>Re: Get specific amount of data from OData</title>
      <link>https://community.sap.com/t5/technology-q-a/get-specific-amount-of-data-from-odata/qaa-p/11415696#M4241323</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P style="font-size: 11.9999990463257px; color: #333333; background: #ffffff;"&gt;Can you try this&lt;/P&gt;&lt;P style="font-size: 11.9999990463257px; color: #333333; background: #ffffff;"&gt;&lt;/P&gt;&lt;P style="font-size: 11.9999990463257px; color: #333333; background: #ffffff;"&gt;&lt;A class="jive-link-external-small" href="https://sapui5.hana.ondemand.com/sdk/#docs/api/symbols/sap.ui.model.Model.html#setSizeLimit" style="font-weight: inherit; font-style: inherit; font-size: 11.9999990463257px; font-family: inherit; color: #3778c7; background: transparent;"&gt;https://sapui5.hana.ondemand.com/sdk/#docs/api/symbols/sap.ui.model.Model.html#setSizeLimit&lt;/A&gt;&lt;/P&gt;&lt;P style="font-size: 11.9999990463257px; color: #333333; background: #ffffff;"&gt; setSizeLimit&lt;SPAN class="signature" style="margin: 0 0 0 0.25em; font-style: inherit; font-size: 11.9999990463257px; font-family: inherit; color: #363636; background: transparent;"&gt;(&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 11.9999990463257px; font-family: inherit; background: transparent;" title="(int) size limit"&gt;collection&lt;/SPAN&gt;)&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 11.9999990463257px; color: #333333; background: #ffffff;"&gt;&lt;/P&gt;&lt;P style="font-size: 11.9999990463257px; color: #333333; background: #ffffff;"&gt;Regards,&lt;/P&gt;&lt;P style="font-size: 11.9999990463257px; color: #333333; background: #ffffff;"&gt;Karthik A&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 26 Nov 2015 15:00:04 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/get-specific-amount-of-data-from-odata/qaa-p/11415696#M4241323</guid>
      <dc:creator>karthikarjun</dc:creator>
      <dc:date>2015-11-26T15:00:04Z</dc:date>
    </item>
    <item>
      <title>Re: Get specific amount of data from OData</title>
      <link>https://community.sap.com/t5/technology-q-a/get-specific-amount-of-data-from-odata/qaa-p/11415697#M4241324</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I may sound like a broken record already, but please, &lt;STRONG&gt;do not load OData services in a JSONModel&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Use ODataModel instead, it will take care of loading, paging/growing etc&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 26 Nov 2015 15:23:25 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/get-specific-amount-of-data-from-odata/qaa-p/11415697#M4241324</guid>
      <dc:creator>Qualiture</dc:creator>
      <dc:date>2015-11-26T15:23:25Z</dc:date>
    </item>
    <item>
      <title>Re: Get specific amount of data from OData</title>
      <link>https://community.sap.com/t5/technology-q-a/get-specific-amount-of-data-from-odata/qaa-p/11415698#M4241325</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Ok, let's switch to an ODataModel. So first I'm going to:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
&lt;P&gt;var oModel = new sap.ui.model.odata.ODataModel();&lt;/P&gt;

&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Now let's say I have:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;OData Service Url&lt;/STRONG&gt;: /ODataServiceUrl/ (which is also already set in manifest if this info is necessary),&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;EntitySet: /&lt;/STRONG&gt;ESSet&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now how can I say just give me 100 records from the "&lt;SPAN style="font-size: 13.3333px;"&gt;ODataServiceUrl/&lt;SPAN style="font-size: 13.3333px;"&gt;ESSet". How would you continue from my code above? Can you show the code, please?&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 26 Nov 2015 15:33:08 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/get-specific-amount-of-data-from-odata/qaa-p/11415698#M4241325</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2015-11-26T15:33:08Z</dc:date>
    </item>
    <item>
      <title>Re: Get specific amount of data from OData</title>
      <link>https://community.sap.com/t5/technology-q-a/get-specific-amount-of-data-from-odata/qaa-p/11415699#M4241326</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Really, if you use ODataModel, you don't need to worry about the number of data, because it will be loaded upon demand (for instance, with a table, it will only load 20 records, but if you scroll or paginate further, it will load more data in a new request)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But if you really want to set a hard stop, use $skip=0&amp;amp;$top=100 in your service URL&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 26 Nov 2015 15:41:57 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/get-specific-amount-of-data-from-odata/qaa-p/11415699#M4241326</guid>
      <dc:creator>Qualiture</dc:creator>
      <dc:date>2015-11-26T15:41:57Z</dc:date>
    </item>
    <item>
      <title>Re: Get specific amount of data from OData</title>
      <link>https://community.sap.com/t5/technology-q-a/get-specific-amount-of-data-from-odata/qaa-p/11415700#M4241327</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The reason is that I'm using vizFrame and I set for its path: /ESSet. This will cause a crash. Even the SAP Gateway Client will crash because of the huge amount of data. For this reason I would like to limit the access.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regarding your Code: I tried it in the Gateway Client like ODataServiceUrl/ESSet&lt;SPAN style="color: #333333; font-size: 12px;"&gt;$skip=0&amp;amp;$top=100 or &lt;SPAN style="font-size: 13.3333px;"&gt;ODataServiceUrl/ESSet/&lt;/SPAN&gt;&lt;SPAN style="color: #333333; font-size: 12px;"&gt;$skip=0&amp;amp;$top=100 and it's throwing back a 400/404 Error.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 26 Nov 2015 15:54:22 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/get-specific-amount-of-data-from-odata/qaa-p/11415700#M4241327</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2015-11-26T15:54:22Z</dc:date>
    </item>
    <item>
      <title>Re: Get specific amount of data from OData</title>
      <link>https://community.sap.com/t5/technology-q-a/get-specific-amount-of-data-from-odata/qaa-p/11415701#M4241328</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Ok, sorry, I forgot to add ? between. Now in the Gateway Client it's working fine but for my app I get a bad-request (400) error. Any clue?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 26 Nov 2015 17:06:19 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/get-specific-amount-of-data-from-odata/qaa-p/11415701#M4241328</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2015-11-26T17:06:19Z</dc:date>
    </item>
    <item>
      <title>Re: Get specific amount of data from OData</title>
      <link>https://community.sap.com/t5/technology-q-a/get-specific-amount-of-data-from-odata/qaa-p/11415702#M4241329</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;In the browser's network tab, can you check the actual request being made? I suspect it is ill-formatted&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 27 Nov 2015 08:38:21 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/get-specific-amount-of-data-from-odata/qaa-p/11415702#M4241329</guid>
      <dc:creator>Qualiture</dc:creator>
      <dc:date>2015-11-27T08:38:21Z</dc:date>
    </item>
    <item>
      <title>Re: Get specific amount of data from OData</title>
      <link>https://community.sap.com/t5/technology-q-a/get-specific-amount-of-data-from-odata/qaa-p/11415703#M4241330</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The request is made and I have to admit that there are several lines of "-.-.-.-.-". Is this the ill-format you are talking about? &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 27 Nov 2015 09:18:29 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/get-specific-amount-of-data-from-odata/qaa-p/11415703#M4241330</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2015-11-27T09:18:29Z</dc:date>
    </item>
    <item>
      <title>Re: Get specific amount of data from OData</title>
      <link>https://community.sap.com/t5/technology-q-a/get-specific-amount-of-data-from-odata/qaa-p/11415704#M4241331</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Could well be; a 400 error usually means the server receives a request which is not in the expected format, or the (generated) URL to your OData service request is not entirely correct. Check your Gateway logs for an indication of what might be the issue.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 27 Nov 2015 09:26:01 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/get-specific-amount-of-data-from-odata/qaa-p/11415704#M4241331</guid>
      <dc:creator>Qualiture</dc:creator>
      <dc:date>2015-11-27T09:26:01Z</dc:date>
    </item>
    <item>
      <title>Re: Get specific amount of data from OData</title>
      <link>https://community.sap.com/t5/technology-q-a/get-specific-amount-of-data-from-odata/qaa-p/11415705#M4241332</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Robin,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Gateway log says: Invalid system query options value. And the frontend is mentioning a bad request (400 Error). &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;You know&lt;/STRONG&gt;, I try this workarounds to reduce the consumption of data. I implemented a Viz Chart and different to a SmartTable it's consuming whole data coming from my OData Service. These are huge and cause a crash.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now this workaround is not working:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
&lt;P&gt;var oVizDataset = new sap.viz.ui5.data.FlattenedDataset({&lt;/P&gt;
&lt;P&gt;&amp;nbsp; data: {&lt;/P&gt;
&lt;P&gt;&amp;nbsp; path: "/EntitySet?$top=10";&lt;/P&gt;
&lt;P&gt;&amp;nbsp; }&lt;/P&gt;
&lt;P&gt;&amp;nbsp; });&lt;/P&gt;
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I also tried to do it this way:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
&lt;P&gt;var uri = "serviceUrl/"; &lt;/P&gt;
&lt;P&gt;var oModel = new sap.ui.model.odata.ODataModel(uri, true); &lt;/P&gt;
&lt;P&gt;oModel.setSizeLimit(1);&lt;/P&gt;
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Based on setSizeLimit nothing happens.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So, do you may have an idea? Is this a known issue regarding Viz?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 30 Nov 2015 12:19:21 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/get-specific-amount-of-data-from-odata/qaa-p/11415705#M4241332</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2015-11-30T12:19:21Z</dc:date>
    </item>
  </channel>
</rss>

