cancel
Showing results for 
Search instead for 
Did you mean: 

Paginate JSON Data in REST Communication Channel

harish_babu5
Participant
0 Kudos

Hi all,

I am doing a synchronous REST ---  PI  ---- ECC scenario. In the response message at times, PI is sending lots of records. I am delivering the response message as JSON. Since the output is huge, the client is asking for pagination in the output.

Does the REST communication channel support this?

If it is possible, which is best way to paginate? According to the records in response message or as per the html page length?

Regards

Harish

Accepted Solutions (1)

Accepted Solutions (1)

vadimklimov
Active Contributor
0 Kudos

Hi Harish,

Pagination is not supported by a REST adapter: it transmits the whole response message (XML or JSON formatted) to a caller in a single transaction and session, in a single chunk. Thus, if a caller needs to receive smaller sets of data, they should:

  • limit amount of records returned (like maximum number of rows, etc.), which will be propagated to a receiver system (SAP ECC), so that the receiver can take this limit into account, or
  • consider switching from synchronous communication to asynchronous and using mechanisms of message splitting which are available in PI. In this way, large message which is sent in response by SAP ECC, can then be split into smaller messages, that are sent back to a sender system.

Generally speaking, usage of synchronous communication mode for interfaces regularly generating and processing large messages, is not recommended, and shall be avoided and replaced with asynchronous mode whenever possible.

Regards,

Vadim

Answers (2)

Answers (2)

smkangethe
Participant
0 Kudos

Hi,

I have a reverse situation with a REST Receiver channel and Proxy sender and the results fetched are paginated, with a next link ($skip token) for the next records to be fetched in sequence. Is there an easy way to fetch paginated results with the REST adapter, so that the proxy makes a single call but PI fetches all records in the result set?

former_member660414
Discoverer
0 Kudos

Hi...Have you found a way to do this by any chance?

smkangethe
Participant
0 Kudos

Hi, Not yet

former_member186851
Active Contributor
0 Kudos

Hello Harish,

Why dont do you in ECC side,I mean proxy channel.

Get all the messages in PI ,for each record in REST trigger one proxy in SAP ECC.