cancel
Showing results for 
Search instead for 
Did you mean: 

Sorting in SAPUI5 Grid Table

08-10-2021 9:34 AM
Mayanksaxena15 Participant
716 views 1 comments
0 Likes
SAP Managed Tags
Subscribe

Hello Experts,

We are using grid table to display large set of data. We have enabled column header level sorting for different columns in the table. As we have thousands of records, we have enabled the pagination and on scrolling only getting top 100 records from the backend service. Currently when user use the sort feature for any of the column, only top 100 records are being sorted as we are fetching only 100 records. When user fetch another 100, that new set of 100 records in not sorted.

If we sort all thousand of records at the backend and then provide the data in batch of 100 records, it will cause the performance issue because we are sorting thousands of records.

How standard Fiori apps handles this type of requirements ?

0 Likes

Accepted Solutions (0)

Answers (1)

Answers (1)

ThorstenHoefer
Active Contributor
0 Likes

Hi a558598283927,

how do you select the data in the backend? If you are using open sql, you should use "up to" and offset

https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abapselect_up_to_offset.htm

The combination of offset and up to n rows is also possible

SELECT *
       FROM scustom
       WHERE custtype = 'B'
       ORDER BY discount DESCENDING
       INTO TABLE @DATA(result)
       UP TO 3 ROWS.

SELECT fldate
       FROM sflight
       WHERE carrid = 'LH' AND connid = '400'
       ORDER BY seatsocc ASCENDING, fldate
       INTO TABLE @DATA(result)
       OFFSET 10.