This article shows how to use static lists and SELECT statements in the WHERE Clause Editor.
Note: List parameters or not yet supported by the Table component.
Static Lists #
The following example statement returns all the active customers (rows in the table KNA1) that have an address in one of the following cities: Berlin, Stuttgart, Paris, Seattle, Hong Kong or Dongguan.
- Create a Table extraction for the SAP table KNA1, see Online Help: Defining a Table Extraction.
- Navigate to the WHERE Clause tab in the main window of the extraction and click [Editor Mode] to open the WHERE clause editor.
- Click [Add criteria] and [Default with literal] to create an empty template in the WHERE clause editor.
- Select the column ORT01 from KNA1 as the data you want to filter.
- Select IN as the operator. IN is the only operator that can be used for lists.
- Select List as the type of the static filter value.
- Click [Press to Edit] in the static value component of the WHERE clause. The window “Edit List” opens.
- Select String as the Type of the list. When working with numbers, select Number.
- Click [Add] to add items to the list. You can edit items via double-click.
- Click [OK] to confirm your input.
- Click [Load live Preview] or run the extraction to check the output.
SELECT Statement #
SELECT statements can be used to select data from SAP tables, see ABAP Documentation: Open SQL SELECT.
The following example statement returns all the active customers (rows in the table KNA1) that have a sales document in the table VBAK for sales document header data.
Note: The usage of SELECT statements is only possible as of SAP Release 7.40, SP05.
- Create a Table extraction for the SAP table KNA1, see Online Help: Defining a Table Extraction.
- Navigate to the WHERE Clause tab in the main window of the extraction and click [Editor Mode] to open the WHERE clause editor.
- Click [Add criteria] and [Default with literal] to create an empty template in the WHERE clause editor.
- Select the column KUNNR from KNA1 as the data you want to filter.
- Select IN as the operator. IN is the only operator that can be used for lists.
- Select List as the type of the static filter value.
- Click [Press to Edit] in the static value component of the WHERE clause. The window “Edit List” opens.
- Select SELECT as the Type of the list.
- Enter the SELECT statement
SELECT KUNNR FROM VBAK
to create a list that contains all items of the column KUNNR from the SAP table VBAK.
- Click [OK] to confirm your input.
- Click [Load live Preview] or run the extraction to check the output.