SAP CDS view查询的fixed limit

54 阅读1分钟

When I use the fixed limit – I hard coded 100 – in the code, the performance in ABAP becomes equal in HANA studio – 2 seconds to finish the query.
[外链图片转存失败(img-QdnMafdc-1563690178506)(user-images.githubusercontent.com/5669954/327…)]
However in CRM WebUI, this limit is specified by end user, it seems we should not hard code it.
[外链图片转存失败(img-7rJG14CG-1563690178507)(user-images.githubusercontent.com/5669954/327…)]
And in S4 Fiori Search, the limit is not used any more.
[外链图片转存失败(img-KxwEPvsc-1563690178507)(user-images.githubusercontent.com/5669954/327…)]
When end user clicks search in S4, the total number of found product is displayed and only the first 25 product is returned from backend.
clipboard4

[外链图片转存失败(img-ClZyork0-1563690178508)(user-images.githubusercontent.com/5669954/327…)]
This paging logic could be observed in Chrome:
clipboard6
When end user scrolls to the bottom of search list, another 25 products will be fetched.
[外链图片转存失败(img-GQyWKTuo-1563690178509)(user-images.githubusercontent.com/5669954/327…)]

[外链图片转存失败(img-aYNagQnL-1563690178510)(user-images.githubusercontent.com/5669954/327…)]