How to restrict data to be loaded to my sql server target using SAP extractor. I tried in query which is linked to the SAP extracto 0FI_AP_4 in the where tab. I have below code:
We are running Data Service 4.0 and we are using SAP extractor to load the data. We are able to get data using init and delta. But there “fitler” condition in the where tab is not working.
The filter condition was placed in the 'where" tab of an query transformation which is linked to the SAP ECC extractor 0FI_AP_4. This is the init load job. It seems that DS still loaded all single records even though there is “where” condition. Where did I do wrong here? Please advise.
Where do you do the filter, in the query transformation or somewhere else? What do you mean it loaded everything and then filtered? So the fitler is not happening in the where tab of the Query tranformation?
So for “0FI_AP_4 --> QRY_FILTER” it will bring n number of records in source and then it applies the filter when it does “QRY_FILTER --> TARGET TABLE” This is what will happen in normal table loads also.
Are you having this in a ABAP Dataflow to enhance it or something?
If you are using query, I assuem you are using the “where” tab to filter? Could you share what’s in you where tab? Are you loading this as init full load?
I am only using extractor, no abap dataflow. Is this is how you did?
Haha. First it reads all data and applies the filter. If you would have a simple job, like the one I had posted, you would see 3 entries in the monitor…2 would show a number of all records and 1 will show the filtered records.
Keep in mind, a filter in a query can be pushed down into the Extractor if
The Extractor was imported as in “Query” mode, not CDC mode
The Extractor has the capability to filter on the given column
In all other cases it reads what it is supposed to read and the query filter condition is executed in the engine. Still, just the rows matching the condition should arrive in the target.
Now I do see how it was filtered. It first extracted everything and then filtered in the Data Service query transform. I was expecting the filtering should be done at the extractor level so ultimately reduced the size of the data to be extracted. I guess it is not the same as BW on how data source firter condition works, right?
In BW you are limited, that makes things less flexible but easier.
If you want to achieve what you are trying, then import the Extractor into your datastore and select the Query mode. Then the Extractor is treated like a select statement on a table and the query filter condition is merged if possible. In case of a delta you cannot restrict the data to one document and expect all delta records to be received. In BW you would get an error then.
Thank you. This seems to be a better option if one nees to limit # of row to come across.
Just to clarify, neither fitering on the query transform where tab nor using the select statement in the extractor itself will restirct the delta to be loaded. This means if we have filter only loads one quarter worth of data, the delta will still load the changes on the other quarter. Am I right?
Not sure I understand your question but let me put it this way:
CDC Mode:
Provides you with delta
filter conditions can be specified in the extractor properties/same dialog as when you do the import of the extractor
filter conditions apply to initial and delta, e.g. when you use the filter SALES_CHANNEL=1 that’s what you get, at initial load all orders of SALES_CHANNEL=1 and in delta all changes with SALES_CHANNEL=1
where clauses in the query are executed after reading, but keep in mind, the rows you have thrown away you will not get again (except you recover last delta run)
Query Mode:
no delta
no filter condition at the extractor itself
where clause in the query is tried to be pushed down into the Extractor if it supports that
Also remember, you can import the same Extractor multiple times with different project names. So you could have instance one you loaded the current quarter of data plus all changes - and these happen on current data only not years back. And the second instance is a query-mode instance, one where you read the past quarters one after the other to load the historical data step by step.