Hi guys, this week we will continue to learn together about CDS view again. As you know, we discussed about CDS view basic from two articles last week as setup ADT (ABAP Development Tool), working with ODATA, create CDS view from many resources (Standard table, standard S/4 CDS view…). In fact, when we create CDS view, we can not allow front end get all data from backend because this will no good for performance. We need to espose ODATA from CDS view with some parameter for front end input there to call fewer data of backend.
You can reference
OK let’s go
SCENARIO-01 : One parameter
SFLIGHT table have many data, so we need to use parameter which named P_CARRID allow front end input CARRID number to get data
We will not show step by step How to create CDS view. If you want, you can reference PART_01, PART_02
Create CDS view with parameter
When we execute this view by F8, we have to input data for parameter
Publish this CDS view to ODATA and view metadata of it. We will see
At this time, we can call with paramter : /<Service Name>(name:value,name:value)/Set
Scenario-02: Many parematers
Next, we will create many parameter on CDS view anh expose for frond end call.
On scenario-01, result will have many data, now we want to get just flight with one more parameter seatsocc_f
In this article, We discussed about How to publish CDS view with parameter. This will help improve performance with big data and we do not want allow front end get all data. Thanks for your reading and any advise kindly leave your comment on this.