I have a macro that navigates to a certain screen, asks for a prompt and runs a loop to collect the data into a table. Now I also have a REST service that calls this macro when called from a client. In some of the cases, the data set is huge. It is so big, that the loop runs for about 5 minutes, before ultimately giving up and ending up in an application error.
What I want to be able to do is to have some sort of pagination on the HATS end, i.e., return only a small chunk of the data at a time. For example, when the REST service is called, return 100 rows of data. If the end user wants to see the next set of records, call the REST service again, with an indicator for the number of rows to fetch and the starting point (100, starting from 101).
Any ideas as to how this can be accomplished?