Selection Criteria
USE:
Selection criteria are used to fetch relevant records from tables specified in the previous step. For each table, it must be specified how the rows should be selected based on values stored in variables or fetched from records from preceding steps. Technically the configuration is used to prepare WHERE conditions for database queries. The queries that will be generated will be used to fetch references and newly created documents.
PROCEDURE:
- For edited configuration object, select step in the DB Comparision rules screen:
- Double click on Selection Criteria
- Add selection criteria to the particular table selected in step 1.
Selection criteria consist of the following parameters
Parameter Name | Description |
---|---|
Field name | Name of database field from database table defined for the step or one of the joined tables. |
Select Options | SQL Comparison Operator based on the list: = Equal |
Reference Type | Type of value used for comparison.
|
Reference Value | Reference value depending on Reference Type.
|
+ | (optional) SQL Logical operator used in case of multiple criteria are defined for the table. Available options:
which means if the criteria should be considered together or separately |
EXAMPLE:
Example 1. Fetch headers of reference and newly created sales order based on variable PO_ORDER_NUMBER
The variable PO_ORDER_NUMBER was configured to fetch from reference XML the field that contained the purchase order number. Then the variable was regenerated with a new value from the IFTT number range and substituted into the new XML.
The DB definition is Step 1, and the table name VBAK. Now let's see the selection criteria:
Field name | Select Options | Ref. Type | Ref. Value |
---|---|---|---|
BSTNK | = | Variable | PO_ORDER_NUMBER |
this means that the particular query, which will be built is:
SELECT * FROM VBAK WHERE BSTNK = value from PO_ORDER_NUBER, for example 'PO123'.
Example 2. We would like to fetch all order items for headers that were fetched in the first example.
The tables representing business document (The DB comparison rules screen):
Now we are editing selection criteria for step 2, which is VBAP (sales order items) table depended on parent step 1 (VBAK - sales order header):
Field name | Select Options | Ref. Type | Ref. Value |
---|---|---|---|
VBELN | = | DB Reference | VBELN |
that means:
SELECT * FROM VBAP where VBELN = (Sales order number fetched from step 1. Technically, the value that was stored in VBAK~VBELN field). For example, '0000022519'.
If the conditions are built on the queries that use JOIN, then the field name must be specified with table name like for example VBKD~BSTKD
© 2017 - 2022 Int4 AG All rights reserved