Parameterized CDS View oData Service and its test in gateway client
The post shows how to test a parameterized oData service in the gateway client.
Below we have a simple CDS view with one parameter.
Test the CDS view with Data Preview- Provide the input.
The oData Service is created – lets test in gateway client.
Service Meta data-
Choose the Entity Set-
Provide the parameter details- and execute. Not found error.
In addition to the parameter value , also pass the key field value. and execute.
We have the result-
With another input-
In above we can retrieve a single row but we can try to retrieve multiple rows with below input. Still we have the single row because of the nature of SCARR table with one carrid there is only one record.
Below is a parameterized CDS view and here 2 fields form the key and the where clause is on carrid. So here we can retrieve multiple records.
Test the cds view- Data Preview.
Gateway client test of the oData service after registration. With entity set and pass the parameter value and the key fields values and we have one row.
If we just want query with the parameter value to get multiple row, use the entity and parameter value and the association “Set” and we have all rows retrieved. [ few rows shown below but we get all the matching records]