Most queries allow entering selections before query execution. Selections limit the result set of the query to extract only records that match the selection.
A selection variant can be created in SAP, see SAP Documentation: Query Variants. The purpose of a variant is to minimize the necessity to enter selections when running a query.

Note: Manual selections and variants can be combined. Manual selections overwrite any selections in the variant.

Choose a Variant #

Choose a variant from the drop-down-list Variant (1).
If you create a new variant in SAP after creating the query extraction, click refresh to load the new variant.

Variants-Section

Note: The selections of the variant are not displayed in the Selection Screen section of the window. To see the definition of a variant, open the variant in SAP.

Edit Selections #

The Selection Screen in the query window corresponds to the query’s input screen in SAP.

Note: Some selection fields only have a technical name and no description. To understand which field corresponds to a field in SAP, open the query’s input screen in SAP. Click a selection field and press the function key [F1] to display the technical name of the selection field.

Follow the steps below to edit selection fields:

  1. Click [Edit] next to the selection field you want to edit. The window “Edit selection” opens.
    Variants-Section
  2. Click [Add Selection] to add a new filter criterion.
  3. Select Include in the Sign (1) column to only include the filtered data to the output.
    Select Exclude in the Sign (1) column to exclude the filtered data from the output.
    ODP Fields
  4. Select an operator in the Option (2) column. The operator filters data according to the table below.

    Operator Meaning
    (Not)ContainsPattern True if data values do (not)contain to the content of operand 1.
    (Not)Equal True if data is (not)equal to the content of operand 1.
    GreaterOrEqual True if data is greater than or equal to the content of operand 1.
    GreaterThan True if data is greater than the content of operand 1.
    LessOrEqual True if data is less than or equal to the content of operand 1.
    LessThan True if data is less than the content of operand 1.
    (Not)Between True if data values do (not) lie between the values of operand 1 and operand 2.
  5. Enter values directly into the Low and High input fields or assign SSIS variables to the selection.
    • Static values: Enter values directly into the Low and High input fields. If SSIS variables are available, make sure that the static-value icon is displayed next to the input field. Clicking on the icon switches between static and dynamic input values.
    • SSIS variables: Click static-value to change the input type to dynamic values dynamic-value. Select an existing SSIS variable from the drop-down list.
  6. Click [OK] to confirm your input.

Note that edited selection fields overwrite the selection fields in the variant.

Tip: If you use multiple selection parameters, it is more efficient to create a variant in SAP.

Data Format #

Use the following internal SAP representation for input:

  • Date: The date 01.01.1999 has the internal representation 19990101 (YYYYMMDD).
  • Year period: The year period 001.1999 has the internal representation 1999001 (YYYYPPP).
  • Numbers: Numbers must contain the leading zeros, e.g., customer number 1000 has the internal representation 0000001000.

Warning! Values must use the internal SAP representation. Input that does not use the internal SAP representation results in error messages e.g.:
ERPConnect.ABAPProgramException: RfcInvoke failed(RFC_ABAP_MESSAGE): Enter date in the format \_.\_.\_