cancel
Showing results for 
Search instead for 
Did you mean: 

RAP - Page size overrun: Query implementation of 'ZI_ZVOML_CUST' returned too many records

shareef_shaik
Explorer

Hello Experts,

When I execute Fiori App which is based on CDS custom Entity( data fetching through FM) is giving below error. Could you please help me how we can over come this issue. i have tried pagination but its limiting to 25 records on screen but unable to load further data.

I am unable to display all records in fiori preview while testing. i haven't created Fiori App.

Your help would be apricated.

Runtime Error(ST22):

The application has indicated exception "CX_SADL_DUMP_APPL_MODEL_ERROR" as the reason for the termination:
Processing was aborted because of an application modeling error: See previous in exception chain.

The exception is related to the previous exception
"CX_RAP_QUERY_PAGE_SIZE_OVERRUN" that occurred in program "CL_RAP_ABQI_ADAPTER===========CP", in line 320 of include "CL_RAP_ABQI_ADAPTER===========CCIMP".

The reason for this exception was:
Page size overrun: Query implementation of 'ZI_ZVOML_CUST' returned too many records

andre.fischer

former_member776480
Discoverer
0 Kudos

Hi Masthan,

I am also facing same error. Did you find any solution for this.

Accepted Solutions (0)

Answers (5)

Answers (5)

Andre_Fischer
Product and Topic Expert
Product and Topic Expert

As shown here you would have to retrieve the $top and $skip values provided by the UI.
teched2020-DEV268/README.md at main SAP-samples/teched2020-DEV268 (github.com)

and you have to tell the framework how many records there are and how many have been returned.

 DATA(top)     = io_request->get_paging( )->get_page_size( ).
 DATA(skip)    = io_request->get_paging( )->get_offset( ).
....
 io_response->set_total_number_of_records( lines( business_data ) ).
 io_response->set_data( business_data ).

0 Kudos

Hello andre.fischer

How the top & skip helps to retrieve the entire records? In my scenario, the top value is 20 & the total lines of records is 101. How do we make sure to display all the records in the front end application.

I am getting the same error Page Size Overrun : Query Implementation returns too many records.

Thanks & Regards,

Siji Thomas

ThorstenHoefer
Active Contributor
0 Kudos

You need to restrict your query with

up to n rows offset x

SELECT - UP TO, OFFSET - ABAP-Schlüsselwortdokumentation (sap.com)

rcaziraghi
Participant
0 Kudos

Hello!

I'm experiencing the same issue. I'm doing what Andre pointed out previously and I've also set the top on the request:

IF top > 0 .
read_list_request->set_top( top ).
ENDIF.

read_list_request->set_skip( skip ).

However, I'm still having issues. It seems that the top does nothing (I'm inserting 20 rows in top and still get more) and because of that I still get an error.

Any ideas?

Rafael

max95
Discoverer
0 Kudos

Hey together,

i am facing a comparable issue. I am trying to test the limits of the RAP Services and when using the default CDS View to get the content of a table, the Service caps the paging top at 5000. I already found a blog post by andre.fischer which supports this thesis BUT i wanted to check the response time of my service by limittesting it with a large amount of data. I can live with CDS Views not getting above 5000 entries in the standard, but had hoped that this would not apply to custom entities. But the paging is also limited to 5000 here. andre.fischer Is there any way to bypass the paging at this point?

This is not a productive system, but a comparison to the old SEGW dpc_ext implentations, there were no limits set.

Greets and Thank you.

Edit: Is there a reason why a RAP default implemented Entity needs nearly double the time to responde than a custom entity doing only a SELECT on the same table, so in my head not going over the View? (As a comparison, for 5000 entries my RAP entity needs about 125 seconds and my custom entity 67 seconds)

HFLISS
Discoverer
0 Kudos

With rap custom entity you are in the unmanaged area. That means you have to do almost everything by yourself.

If you use Chrome and look with F12 ( Developer Console ) how the Odata Requests to the backend look like you can see something like this:

GET Your-Custom-Entity?sap-client=12345&$skip=0&$top=20&$select=your-select-statement.

as soon as you scroll:

client=12345&$skip=20&$top=20&$select=your-select-statement..

This means that as soon as you scroll, your implementation class is called again.

You have to program it so that you return not more than 20 lines with each call.

With skip you know which entry you are at.

"Use this to see which part of your table you have to return

DATA(skip) = io_request->get_paging( )->get_offset( ).

DATA(top) = io_request->get_paging( )->get_page_size( ).

I then did something like this:

data: lt_line_out type table of lty_line,

DATA( lv_start ) = skip + 1.

DATA (lv_end ) = skip + top.

append lines of lt_line from lv_start to lv_end to lt_line_out.

io_response->set_total_number_of_records( lines( lt_line ) ).

io_response->set_data( lt_line_out ).

https://help.sap.com/viewer/923180ddb98240829d935862025004d6/Cloud/en-US/6e61d176b14a48d8904a28d2653...

csolleti
Discoverer
0 Kudos

Hi All, it worked for me , please see sample code below ,

Below is the example on internal table, preferred is using the skip and top on select statement

data(lv_page_size) = io_request->get_paging( )->get_page_size( ).
data(lv_skip) = io_request->get_paging( )->get_offset( ).]
data(lv_max_rows) = cond #( when lv_page_size = if_rap_query_paging=>page_size_unlimited then 0
else lv_page_size ).

" First time get records from 0 to 20 (assuming page size 20)

" Second time get records from 21 to 40 and next 31 to 60
lv_max_rows = lv_skip + lv_page_size.
if lv_skip > 0.
lv_skip = lv_skip + 1.
endif.

" Fill records based on Page size (Ex Assume page size of so fill each time records from0..20 , 21..40)

loop at lt_out_line_item assigning field-symbol(<lfs_out_line_item>)
from lv_skip to lv_max_rows.


ls_tab-bukrs = <lfs_out_line_item>-bukrs .
ls_tab-lifnr = <lfs_out_line_item>-lifnr .

.

.

ls_tab-tax_amount = <lfs_out_line_item>-tax_amount .
append ls_tab to lt_tab.
endloop.

data lv_tot_records type int8.
lv_tot_records = lines( lt_out_line_item ). " get total size of list Ex: 2200 records

io_response->set_total_number_of_records( lv_tot_records ). " total count to 2200

io_response->set_data( lt_tab ). " append only records of page size

former_member776480
Discoverer
0 Kudos

Its working ...Thanks Chandra

swati_singh4
Participant

Hi Chandra, This only gets executed for me once. So even though there are 180 records in my table, only the first 20 are displayed. Any idea why this is happening?

0 Kudos

Hi shareef_shaik,

Were you able to resolve this problem? Would like to know if the number of records are more than the page size, how can we avoid this error?

Regards

Geet

shareef_shaik
Explorer
0 Kudos

Hello geetrana

I am unable to resolve the issue. Still looking for solution.
If you find solution please post here too. That would be helpful.


Regards,

Shareef Shaik