Parameterized CDS View with oData

light111Parameterized 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.

1

Test the CDS view with Data Preview- Provide the input.

2

Result-

3

The oData Service is created – lets test in gateway client.

4

Service details-

5

Service Meta data- 

6

Choose the Entity Set-

7

Provide the parameter details- and execute. Not found error.

8

In addition to the parameter value , also pass the key field value. and execute.

9

We have the result- 

10

With another input- 

11

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.

 

12


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.

13

Test the cds view- Data Preview.

14

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.

15

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] 

161718


 

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s