Download as pptx, pdf, or txt
Download as pptx, pdf, or txt
You are on page 1of 7

$filter Query Option in SAP

OData Service

http://
www.saplearners.com/filter-query-option
-in-sap-odata-service

septiembre 1, 2018
Como crear un $filter Query Option in SAP OData
Service 
• What $filter query option does?
• Query option $filter adds filtering capabilities to the SAP gateway OData
service. So that you can able to filter the OData service feed/collection
based on the fields available in the Entity Type set.
• Supported System Version
• SAP NetWeaver Gateway Release 2.0 Support Package >=03
• Business Example
• A gateway OData service is getting all the products from the back-end
system, but you don’t want to get all the products and you want to apply
filters on the OData service so that required products are retrieved.
Como crear un $filter Query Option in SAP OData
Service 
• Sintax
• http://<server>:<port>/sap/opu/odata/sap/<service_name>/Produc
tsSet?$filter=ProductId eq ‘HT-1000’
– $filter = <fieldname> <operator> <value> ,
• where:
• <fieldname> is the name of the field.
• <operator> must be from the list of supported operators.
• <value> can be a string value and should be enclosed in
quotation marks (‘value’).
$filter Query Option in SAP OData Service 
• How to Implement $filter query option in OData Service
• In this section we will adjust the OData service to respond to $filter query
option.
– $filter query option should be applied only to Entity Type sets. We assume that you have
already built the OData service to get the list of products. if you have not click here.
– 1. After successful creation of OData service. Go back to service builder SEGW, Navigate
to the ABAP workbench for the Product Entity set.
$filter Query Option in SAP OData Service 
• How to Implement $filter query option in OData Service
• In this section we will adjust the OData service to respond to $filter query
option.
– 2. Code inside the method PRODUCTSSET_GET_ENTITYSET will look like below i.e before
adjusting the service to $filter query option.
$filter Query Option in SAP OData Service 
• How to Implement $filter query option in OData Service
• In this section we will adjust the OData service to respond to $filter query
option.
– 3. In the above code snippet, we have retrieved the list of products generally by
providing the max rows.
• Now we will adjust the code to adapt it to the $filter query option. Filter query option is available in the
method by accessing the importing parameter IT_FILTER_SELECT_OPTIONS.
Como acceder al contenido del Payload de un
ABAP PROXY síncrono

https://www.se80.co.uk/sapfms/s/srtu/srtu
til_convert_xml_to_table.htm/

You might also like