Skip to Content
Author's profile photo Mahesh Z

SAPUI5 – Pagination in sap.m.Table using skip and top values of OData Service

Hi ,

As a part of my project actiities, I need to fetch the data from OData service and show it inside sap.m.Table , however the data was huge and there was a need to implement pagination using $skip and $top values of OData service. There is a chance that user may not view all the records hence , fetching all data in one call and putting it inside model was not advisable hence we went ahead with this approach.

Sample implementation is as follows :

We created a table using XML View which is following the normal coding and at the footer , we placed a button which calls the method getNextOrders.

Inside that method , code is written as follows :


  var sServiceUrl = “ServiceURL”;

  var oDataModel = new sap.ui.model.odata.ODataModel(sServiceUrl);

  var oModel = new sap.ui.model.json.JSONModel();

  var oUrlParams = “$skip=” + gskipValue + “&$top=” + gTopValue;“/Orders”,null,oUrlParams,true,function(oData, response){





  gskipValue = gskipValue + gTopValue;


gSkipValue and gTopValue are global variable which stores the values to be fetched and skipped. For our implementation , we kept both values as 10. So at a time 10 records will be shown on the screen.

Hope this helps in implementing the pagination for others too. Please share any improving points on the same. Will be helpful for me 🙂 .

Screenshot with demo data from sample service is attached.

Thanks & Regards,


Assigned Tags

      You must be Logged on to comment or reply to a post.
      Author's profile photo Matt Harding
      Matt Harding

      Hi Mahesh,

      Quick question - Any reason you didn't use the Growing functionality in sap.m.Table, and set the growingThreshold to 10 to achieve the same result, albeit it would scroll rather than stay in place?



      Author's profile photo Mahesh Z
      Mahesh Z
      Blog Post Author

      Hi Matt,

      Thanks for your reply.

      Even we tried that thing however what is does is , it fetches all the data in single call. As per our client , the data they have is really huge and there is less chances that user verifies all the data at once. Also , client wanted us to develop some use case where in user can focus on set of order. Growing functionality would append the data to existing results in a table( Correct me if i m wrong) hence if we add more n more orders to table , it would b difficult for user to go through all. Hence we followed this approach.

      But yes, It can be an alternate solution.

      I heard there is some inbuilt pagination in case of sap.ui.table.Table , Currently I am trying that out, Will update this blog once I get any positive output from that.

      Thanks & Regards,

      Mahesh Zeple.

      Author's profile photo Shibaji Chandra
      Shibaji Chandra

      Hi Mahesh,

      I think alternatively you could have used the following :

      These properties are of sap.m.ListBase which is the parent class of sap.m.Table.

      In case if you need to fetch 10 records at a time then you need to set growingThreshold = 10.



      Author's profile photo Former Member
      Former Member

      Hi Mahesh Z

      Did you use growing property to solve the paging problem? I also met this problem

      Author's profile photo Mahesh Z
      Mahesh Z
      Blog Post Author

      Hello Jun,

      I did not use growing property as I was using JSONModeling at that time. But you can surely use it with Tables here.



      Author's profile photo Former Member
      Former Member

      Growing property doesn't solve the pagination issue, it'll still remain as an issue for the end user. Do we have any other solution apart from the one explained & growing property?

      I am looking something of this type:

      Please let me know if anybody have any idea on this.

      Thanks & Best Regards,


      Author's profile photo Sharmila Gurubelli
      Sharmila Gurubelli

      Hi Venkatesh,

      This may helps you 🙂

      Thank you,