
When requesting entity sets such as Groups, SAP Jam does not return all entities at once, but uses server-side paging to limit the size of the response body. In this case, the response XML contains a part of the entity set ("first page") plus a next link. The next link is a URL that can be used to request the "next page" containing the next part of the entity set. For more information, see the specification of the OData v2 standard.
To handle server-side paging, ABAP SMI provides the following methods in the IF_ODL_ENTITYSET interface:
| Method | Description |
|---|---|
| has_next | This method returns abap_true if and only if the entity set provides a next link. |
| get_next | This method creates and submits a request for the next link and returns this request object. |
You have an lo_request request object for which the submit method has been called. You can iterate over all parts of the entity set as follows:
DATA: lo_entityset_part TYPE REF TO if_odl_entityset. lo_entityset_part = lo_request->get_result_entityset( ). WHILE lo_entityset_part->has_next( ) = abap_true. lo_request = lo_entityset_part->get_next( ). lo_entityset_part = lo_request->get_result_entityset( ). ENDWHILE.