Preventive Service Planning
Abstract
The document provides an overview of how to use SAP Delta Filter in CPD (Cloud Pak for Data) to extract specific data based on various conditions.
Content
SAP Delta Extract Filter Query in CPD
Summary of SAP Delta Filters in CPD
Operator Support for SAP Delta Extract - till Release 5.1.2
Operator Support for SAP Delta Extract from Release 5.1.3 & onwards
Introduction
The document provides an overview of how to use SAP Delta Filter in CPD (Cloud Pak for Data) to extract specific data based on various conditions. It covers the use of operators like EQ (Equal) and BT (Between) to filter data for extraction, along with practical examples of how to structure queries for multiple fields using uniform separators. Additionally, it explains the steps for setting up filter queries in CPD.

SAP Delta Extract Filter Query in CPD
To design a new DataStage flow job, follow these steps.












Summary of SAP Delta Filters in CPD
In CPD (Cloud Pak for Data), the query provided would be written in the filter section when setting up an SAP Delta Extract connection or a similar data extraction process. Here's the query as it would be input in CPD.
Query in CPD:
{"column":"SPRAS","op":"EQ","value":"E”}
- Operator: EQ(Equal)
- Value: E(English)
{"column":"MATNR","op":"EQ","value":"000000000000000011"}
- Operator: EQ(Equal)
- Value: 000000000000000011 (specific material number)
- Column: This represents the filed in the data being filtered. In the CPD UI, a filed called 'SAP Delta Filter' can be seen, where the filter can be input.
- Operator (op): The operator defines the condition or comparison type applied to the column.
- Value: The value is the specific condition being filtered for. This is typically a field where the actual value is input to compare the data against. For example, E for the SPRAS column or 000000000000000011 for the MATNR column.
The filter support options like EQ and BT are used to define the conditions for data extraction. Here's what they mean:
1. EQ (Equal):
- Definition: The EQ operator stands for "Equal." It is used to filter data based on an exact match.
- Use Case: When you need to extract data that is exactly equal to a specific value. For example, you can use EQ to extract records where a certain field (e.g., a date, status, or ID) matches a specific value.
- Example: {"column":"MATNR","op":"EQ,"value":"42433"}
- Definition: The BT operator stands for "Between." It is used to filter data that falls within a specified range of values.
- Use Case: When you need to extract records where a field value falls within a range, such as a date range or numeric range.
- Example: {"column": "MATNR", "op": "BT", "value": "000000000000000015", "value": "000000000000000022"}
|
OPERATOR |
QUERY |
|
EQ |
{"column":"MATNR","op":"EQ,"value":"42433"}; {"column": "MATNR", "op": "EQ", "value": "000000000000000019"} |
|
BT |
{"column": "MATNR", "op": "BT", "value": "000000000000000015", "value": "000000000000000022"}; {"column": "MATNR", "op": "BT", "value": "000000000000000022", "value": "000000000000000030"} |
"AND" Separator till Release 5.1.2
Starting from release/5.0.2 till release/5.1.2, the "AND" keyword functioned as a separator rather than a logical operator. The connector did not handle logical combinations directly instead, it sent independent filters to SAP for processing.
Example: {"column":"SPARS","op":"EQ","value":"E"}AND{"column":"MATNR","op":"EQ","value":"000000000000000011"}
In this case, SAP processed each condition separately and extracted data from SAP.
- The separator (;) used with the same field will act as an OR operation in SAP.
- The separator (;) used with different fields will act as an AND operation in SAP.
- Example: {"column":"SPRAS","op":"EQ,"value":"E"}; {"column": "MATNR", "op": "EQ", "value": "000000000000000011"}
- When you specify conditions on multiple fields using a separator (;).
- The connector itself doesn't manage these logical combinations directly but sends individual filters to SAP, which then interprets them. Filters on different fields are automatically combined with an AND condition by SAP.
- Example: {"column":"SPRAS","op":"EQ,"value":"E"}; {"column": "MATNR", "op": "EQ", "value": "000000000000000011"}.
- When you apply conditions to the same field using a (;), The connector itself doesn't manage these logical combinations directly but sends individual filters to SAP, which then interprets them. Filters on the same fields are automatically combined with an OR condition.
- This means the records returned will match any of the specified values for that field, like how an OR condition works.
- Example: {"column":"SPRAS","op":"EQ,"value":"Z"}; {"column": "SPRAS", "op": "EQ", "value": "D"}
|
Query |
Syntax |
SAP internal Interpretation |
|
Query on same field |
{“column”:” field_1”,” op”:” operator_name”,”value”:”value_name1”}. {“column”:” field_1”,” op”:” operator_name”,”value”:”value_name2”}
|
Field_1 IN (‘value_name1’,’value_name2’) |
|
Query on different field |
{“column”:” field_1”,” op”:” operator_name”,”value”:”value_1”}. {“column”:” field_2”,” op”:” operator_name”,”value”:”value_2”} |
Field_1 = ‘value_1’ AND field_2 = ‘value_2’ |
|
Datasource |
FieldName |
Operator |
Query |
Interpretation OR/AND as per SAP behaviour |
|
0material_text |
Same_field (OR) |
EQ |
{"column":"SPRAS","op":"EQ,"value":"Z"}; {"column": "SPRAS", "op": "EQ", "value": "D"} |
SPRAS IN (‘Z’,’D’) |
|
Different_field (AND) |
EQ |
{"column":"SPRAS","op":"EQ,"value":"E"}; {"column": "MATNR", "op": "EQ", "value": "000000000000000011"} |
MATNR= ‘000000000000000011’ AND SPRAS = ‘E’ |
|
|
0material_attr |
Same_field (OR) |
EQ |
{"column":"MTART","op":"EQ,"value":"XYZ"}; {"column": "MTART", "op": "EQ", "value": "ROH"} |
MTART IN (‘ROH’,’XYZ’) |
|
Different_Field (AND) |
EQ |
{"column":"MTART","op":"EQ,"value":"ROH"}; {"column": "MATNR", "op": "EQ", "value": "000000000000000014”} |
MATNR = ‘000000000000000014’ AND MTART = ‘ROH’ |
|
|
Zds_demo_filter |
Same_Field (OR) |
EQ |
{"column":"TIME_FIELD","op":"EQ","value":"083000"}; {"column": "TIME_FIELD", "op": "EQ", "value": "101010"}; {"column":"TIME_FIELD","op":"EQ","value":"120000"} |
TIME_FIELD IN (‘083000’, ‘101010’,’120000’) |
|
Different_Field (AND) |
EQ |
{"column":"TIME_FIELD","op":"EQ,"value":"083000"}; {"column": "DATE_FIELD", "op": "EQ", "value": "20250115"}; {"column":"CREATED_ON","op":"EQ,"value":"20250115"} |
TIME_FIELD = ’083000’ AND DATE_FIELD = ‘20250115’ AND CREATED_ON = ‘20250115’ |
Was this topic helpful?
Document Information
Modified date:
07 April 2025
UID
ibm17230237