on 2024 Aug 23 7:10 AM
Hi Community,
I have created a custom entity based on Maintenance order i_maintenanceordertp and Operation I_Maintenanceorderoperationtp to get the measuring point based.
when i execute the custom entity i get only 20 records i am not able to get all the records in display
i have written following code
DATA(top) = CONV i( io_request->get_paging( )->get_page_size( ) ).
DATA(lv_skip) = CONV i( io_request->get_paging( )->get_offset( ) ).
DATA(lv_max_rec) = top + lv_skip.
and using lv_max_rec in my select
SELECT *
FROM i_maintenanceordertp WITH PRIVILEGED ACCESS
WHERE (lv_conditions)
ORDER BY maintenanceorder
INTO TABLE @@DATAlt_mo) UP TO @lv_max_rec ROWS. " OFFSET @LV_skip.
Please help and guide me at your earliest to get all the rows displayed in the output.
Thanks for your help and quick guidance.
Nitin
Request clarification before answering.
Hi, you can try it. you must return the total counts, then use 'UP TO XXX ROWS OFFSET XXXX' return partial data for each requests.
DATA(lo_paging) = io_request->get_paging( ).
DATA(lv_offset) = lo_paging->get_offset( ).
DATA(lv_rows) = lo_paging->get_page_size( ).
DATA(lv_max_rows) = COND #( WHEN lv_rows =
if_rap_query_paging=>page_size_unlimited THEN 0 ELSE lv_rows ).
IF io_request->is_total_numb_of_rec_requested( ) = abap_true.
SELECT COUNT( * ) FROM i_maintenanceordertp WHERE (lv_filter) INTO @DATA(Lv_counts).
io_response->set_total_number_of_records( Lv_counts ).
ENDIF.
SELECT * FROM i_maintenanceordertp WHERE (lv_filter)
ORDER BY (lv_orderby_string) INTO TABLE @DATA(lt_items)
UP TO @LV_max_rows ROWS OFFSET @LV_offset.
io_response->set_data( lt_items ).
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
17 | |
9 | |
7 | |
6 | |
6 | |
6 | |
5 | |
4 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.