首页 > SAP > HANA > OData Query Options in SAP Netweaver Gateway
2019
08-27

OData Query Options in SAP Netweaver Gateway

Hello everyone, in this tutorial we will learn what are the different query options available in SAP Netweaver Gateway OData service.

1.What are Query Options ?

Query Options are parameters added to the OData service by an application to control the amount and order of data retrieved.The name of all query options will starts with “$”.

2.Available OData Query Options

$select
$count
$expand
$format
Read $links
$value
$orderby
$top
$skip
$filter
$inlinecount
$skiptoken

Some of the above OData query options can be used directly and some required additional implementation to be done from code perspective.Lets see what are they

3.OData Query Options – Implementation NOT needed

You can directly add these query options directly to the service and the service will respond accordingly.

$select

Syntax :  http://<server>:<port>/sap/opu/odata/sap/<service_name>/ProductsSet?$select=ProductId,Name,Description

$count

Syntax : http://<server>:<port>/sap/opu/odata/sap/<service_name>/ProductsSet??$count

$expand

Syntax : http://<server>:<port>/sap/opu/odata/sap/<service_name>/Suppliers?$expand=Products

$format

Syntax : http://<server>:<port>/sap/opu/odata/sap/<service_name>/ProductsSet?$format=json

Read $links

Syntax : http://<server>:<port>/sap/opu/odata/sap/<service_name>/Products(‘1001’)/$links/Category

$value

Syntax : http://<server>:<port>/sap/opu/odata/sap/<service_name>/Products(‘1000’)/Name/$value

4.OData Query Options – Implementation needed

You need to change the ABAP code in DPC extension class to use these query options.

$orderby
$top
$skip
$filter
$inlinecount
$skiptoken

In our next tutorial we will dig deep into these OData query options one by one. Stay tuned to us for more SAP Netweaver Gateway tutorials.

Thank you. Please feel free to comment and let us know your feedback.

最后编辑:
作者:yangsen
本站为个人博客网站,全由我个人维护,我从事SAP开发13年,其它ERP开发7年,基本都是零售行业。本站记录工作学习的过程, 有SAP相关询问专、兼职工作可随时联系我。 有网站相关的问题可直接在文章下方留言,或者联系我。 邮件:yan252@163.com给我。 QQ:415402519