Managing and displaying large amounts of data in an application tends to require a lot of consideration, as it is easy to make performance suffer. I recently built a very performant list page for a S/4 HANA Cloud endpoint with 65k+ records using SAP Build Apps which will become available in a template later on, but meanwhile I wanted to share with you my solution so you can already adopt it in your SAP Build Apps application, if you are having performance issues in your list view.
The list page I created has a table type list with sorting, filtering and paging.
The main secrets of its great performance are:
The core of this logic is placed on the page's logic canvas. The main logic for loading the data happens when the page is mounted, but there are events for when the user wants to see more data (but all data has not loaded yet) and when the data on the page needs sorting/filtering.
The page variables and their purposes are the following:
As for the logic with which the items from the list containing all the items into the filtered list that is used in the list, I concocted the following formula:
SLICE(ORDER(IF(!IS_EMPTY(pageVars.searchQuery), SELECT<partner>(data.A_BusinessPartner1, SOME<column>(pageVars.columns, CONTAINS(LOWERCASE(ENCODE_JSON(LOOKUP(partner, column.fieldName))), LOWERCASE(pageVars.searchQuery)))), data.A_BusinessPartner1), IF(!IS_EMPTY(pageVars.sortBy), ENCODE_JSON(LOOKUP(item, pageVars.sortBy)), index), pageVars.sortDirection), 0, pageVars.pageSize)
This formula first figures out if there is a filter used (= searchQuery is something other than empty), and if yes, it only selects the items from the master list that contain the search query in one of the fields used in the columns. If no, the full master list goes into the next stage. In the next stage it checks if there is a column to sort by (= sortBy is something other than empty), and sorts the filtered master list based on this field into the desired sortDirection. After that the page is cut into size, which is usually 50, unless the user has pressed the Show more button.
There are many additional small details that make me proud of this particular list page, but this concludes the main ones that contribute towards its great performance. If you have any further questions about creating table lists in SAP Build Apps, please comment below.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.