Query Operation with GET_ENTITYSET.
The post describes how to implement the data provider extension class for the Query operation. [ Check the link oData(Part2)- Read Operation for the Read Operation]
The SCARR table entries.
Go to the data provider extension class- ZCL_ZSCARR_DEMO_DPC_EXT. Right click on it and choose Go to ABAP workbench.
Select change mode, select the method SCARRS_GET_ENTITYSET and select redefine button.
Depending upon different url parameters different import parameters are filled.
Now just put a select query and fill the ET_ENTITYSET table.
Activate and go back
From the Service Maintenance , select Maintain buttn.
Choose Call Browser.
The XML format is displayed.
Now lets get all the records by the URL:
https://server address/sap/opu/odata/sap/ZSCARR_DEMO_SRV/Scarrs
we can set the url that uses filter
https://server address/sap/opu/odata/sap/ZSCARR_DEMO_SRV/Scarrs?$filter=Carrid eq ‘LH’
For that lets change the method accordingly.
https://server address/sap/opu/odata/sap/ZSCARR_DEMO_SRV/Scarrs?$filter=Carrid eq ‘LH’
https://server address/sap/opu/odata/sap/ZSCARR_DEMO_SRV/Scarrs?$filter=(Carrid eq ‘LH’ or Carrid eq ‘AC’)
URL with multiple Carrid .