This article is in two parts, and this is the second part that demonstrates how to use filters and how to combine filter conditions using operators.
It is a continuation of the first part, Part 1: Getting SAP Data into Your Microsoft Excel Application, which demonstrates how to quickly generate code and to modify the generated code for a GWM Excel add-in that presents SAP data in Microsoft Excel.
First, we will show how to add a filter expression to get the data for the SalesOrderID property, with values greater than 0500000050. Later, we will show how to add filter expressions using the configuration file.
TIP: We know that the SalesOrderID property is filterable.
Let's try it by following the steps below:
Now you use the filter expression in the code below, this shows how to combine filter conditions using the OR operator:
var serviceresponse = serviceContext.SalesOrderSet.AddQueryOption("$top", ExcelSettingManager.MaxRecords).AddQueryOption("$filter", "SalesOrderID gt '0500000065' or SalesOrderID eq '0500000065'").Execute() as QueryOperationResponse<GWDEMO.SalesOrder >;
Rebuild and run the project for Excel add-in application. In Microsoft Excel, click on the Fetch button, and check that the results are displayed according to the filter.
For more information on how to build filter expressions, see http://www.odata.org/documentation/uri-conventions/#SystemQueryOptions.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
6 | |
5 | |
5 | |
5 | |
5 | |
4 | |
4 | |
4 | |
3 | |
3 |