+ All Categories
Home > Documents > GWPAM Excel Add Filter

GWPAM Excel Add Filter

Date post: 30-Dec-2015
Category:
Upload: vkvk362
View: 31 times
Download: 0 times
Share this document with a friend
Description:
GWPam
Popular Tags:
11
1 Welcome to this presentation about SAP NetWeaver Gateway productivity accelerator for Microsoft Excel. This presentation covers the Add Filter topic. You will learn how to use filters to limit results when fetching data from SAP.
Transcript
Page 1: GWPAM Excel Add Filter

1

Welcome to this presentation about SAP NetWeaver Gateway productivity acceleratorfor Microsoft Excel.

This presentation covers the Add Filter topic. You will learn how to use filters to limitresults when fetching data from SAP.

Page 2: GWPAM Excel Add Filter

2

Page 3: GWPAM Excel Add Filter

Filters allow you to limit the result set of a query operation, by retrieving only asubset of entries from the collection. The subset is determined by the specifiedquery option. Filter query options are defined by adding a $filter option to the URI.

Example: http://<host>:<port>/sap/opu/odata/sap/ZGWSAMPLE_SRV/BusinessPartnerCollection?$filter=CompanyName eq 'SAP'

This example URI limits the result set of the BusinessPartnerCollection by adding athe $filter option and specifying that the CompanyName property has to be equalto ‘SAP’.

You should familiarize yourself with the OData Service you are going to use inGWPAM Excel. It is important to understand which properties are filterable, whichones are mandatory and what are the expected filter values. This can be seen inthe Service Metadata Document and in the Gateway Service Builder.

You should also have an understanding of how to apply multiple filters and thelogical operators that are supported by your OData Service. Your particular servicesmight not support all operators that the OData specification allows for. Also see SAPNote 1671893 on how Gateway converts filters to ABAP select options and theresulting limitations. You can use the Gateway Client tool to test filters and validate theircorrectness.

3

Page 4: GWPAM Excel Add Filter

In the Gateway Service Builder, which can be accessed via transaction SEGW, you caninspect the OData Service. You can verify which of the properties of an entity are markedas filterable. You can also familiarize yourself with the data type and other properties ofeach parameter to gain a better understanding of the expected filter values. Alternativelythis information can be seen in the metadata document.

To take this a step further you could also look into the DPC Class to verify the handling ofeach filter property in the GET_ENTITYSET method.

Furthermore you can utilize the Gateway Client tool to test and verify any filter queryoption you intend to use in your GWPAM Excel solution.

Equipped with this knowledge you should now be in a good position to set a proper filterquery option in Excel.

4

Page 5: GWPAM Excel Add Filter

During the Binding process, the business expert sets the filters. To access the Add Filter screen youhave to navigate through the GWPAM Excel Wizard until you arrive at the Property Binding screen.Here you will find the Add Filter button that opens the Add Filter screen.

The list of properties only contains the ones that are flagged as filterable in the Gateway ServiceBuilder.

To create a simple filter you can use the Add button. It assists you in creating a valid filter stringfor the particular parameter. You can choose from available operators, like ‘Equals To’ or ‘GreaterThan’. If available for the particular property, then a search help or F4 help will be offered. Alsosome basic validation of the filter value will be performed, e.g. data type checks.

If you require to create a more complex filter then you can try either of these two ways:• In the Filter Values column, you can enter a filter query option directly.• In order to compose a free-style filter query option you can enter it directly in the Service URL

field by appending it to the end of the URL.

If you assign filter values to multiple parameters then they will be connected by a logical ANDoperator. To verify the final filter query option, take a look at the Service URL, which will reflect thequery you assembled. Also take advantage of the Test Filter option to verify your query stringagainst the Gateway system.

Also take note of the Allow user to set filter values option. When selected the end user will begiving the possibility to enter or adjust the value when fetching the data. More about that later.

5

Page 6: GWPAM Excel Add Filter

Option 1 - Add button: Via the Set Filter Values window, you can choose from availableoperators, like ‘Equals To’ or ‘Greater Than’. Keep in mind the list contains operators thatare part of the OData specification but it is your responsibility to choose from the ones thatare actually supported by your OData Service. If available for a particular property, then asearch help or F4 help will be offered. Also some basic validation of the data will beperformed, e.g. data type checks preventing you from entering a text into a numeric field.To clear a selection, you should select a row in the table and then hit the DELETE key.Option 2 - Filter Values Column: Enter the filter parameter in the Filter Values column. Thisis very useful in the case that you want to use a logical OR expression. For example, tospecify multiple filter values for CompanyName property you can set the following filtervalue: CompanyName eq ‘SAP' or CompanyName eq ‘Becker Berlin’Option 3 – Service URL: Enter the filter query string at the end of the URL to compose afree-style filter query option. Furthermore you are not allowed to change the base URL.

Complex Filters: Some limitations do apply when assembling more complex filters. E.g. ifyou assign filters to multiple parameters then they will be connected by a logical ANDoperator. Therefore carefully test and validate your filter string.

Reset: The filters set in the URL field and in the Filter Values column might get reset shouldyou switch between the different options.

“Allow the user to specify the filter values”: Select the “Allow the user to specify the filtervalues” option to allow the end user to specify the filter values in Microsoft Excel whilefetching the data. This option only works for simple filters.

6

Page 7: GWPAM Excel Add Filter

Now let’s look at the filtering from the end user’s point of view. After specifying a filterquery option the business expert hands over the Excel document to the end user.

The end user fetches the records from the SAP System and will be presented with a subsetof entries that satisfies the filter query option.

If the business expert has previously selected the option “Allow the user to set the filtervalues” for any of the filter parameters, then the end user has the possibility to modify thefilter. When fetching the records, the Select Filter Value window appears, where the filtercan be modified.

If the business expert previously did not specify the filter condition, then the end user willbe able to specify both the Operator and Value. If the filter condition was specified, thenthe Operator drop-down list will not be open for selection.

7

Page 8: GWPAM Excel Add Filter

Initially upon first opening of the Excel Workbook, the end user clicks the Fetch Recordsmenu and selects either Fetch Records or Modify Filters to modify the existing filter values.The Modify Filter option is only available, if the business expert has previously selected theoption “Allow the user to set the filter values” in the Set Filter Value window.

The Select Filter Values window appears. Here the user can modify the filter in thefollowing ways:• If the filter condition was not specified by the business expert in the Set Filter Value

window, then the user will be able to specify both the Operator and Value.• If the filter condition was specified in the Set Filter Value window, then the Operator

drop-down list will not be open for selection.

After specifying the operators and filter values, the user chooses Apply to fetch recordsbased on the specified filter query option. The Do not show again option will suppress thiswindow during the next Fetch Records action, and can be accessed again via the ModifyFilters option.

8

Page 9: GWPAM Excel Add Filter

9

This concludes the presentation about the Add Filter feature of SAP NetWeaver Gatewayproductivity accelerator for Microsoft Excel.

Page 10: GWPAM Excel Add Filter

10

Page 11: GWPAM Excel Add Filter

11


Recommended