Filter on current datetime in Duet Enterprise::Query operation upon SharePoint Search Crawling
Duet Enterprise, SharePoint Business Connectivity Services plus SharePoint Enterprise Search and/or SharePoint FAST is a powerful combination. With them you can unlock selective SAP data to realize search-driven SharePoint applications. The external SAP data is retrieved at Search Crawl time, and administrated in the search index file.
The SharePoint Indexing Engine uses the information in the BDC Metadata Model that is generated via BDC Publisher for the Duet Enterprise Business Scenario. The Indexing Engine first invokes the Finder method of the external content type(s) that is tagged as ‘RootFinder’ in the BDC Model. And second per returned SAP entity the SpecificFinder to retrieve more details. If all required SAP entity details are already returned by the Finder method, the latter can be skipped for better crawl performance and throughput.
Via the Finder method thus the set of relevant entities of external content type is retrieved. The decision what is relevant is made from perspective of the SAP repository upon the moment of invoking the Duet Enterprise Query operation. A typical filter here is that of current datetime: only return active external entities.
Current datetime is a dynamic value to be determined at BCS::Finder invocation time. A consequence is that this filter value cannot be a priori included in the BDC model. This leaves 3 options: derive and specify the dynamic value from either the context of the BCS::Finder consumer, from within the BCS::Finder provider as integration layer, or from the data access operation within the SAP repository.
BCS::Finder consumer context
In content crawling context the SharePoint Indexing Engine is the consumer. It is not possible the augment its the standard behaviour of invoking the Finder method.
BCS::Finder provider context
This option requires that the Finder execution invoke the associated dataaccess operation of the SAP repository with DateTime.Now as filter parameter. This option is not supported for BCS no-code solutions, but requires the utilization of a custom BCS .Net Assembly Connector to connect to the Duet Enterprise / Gateway webservice. If already a custom .Net Connector is used for retrieving data from the SAP repository, it is probably a minor change to extend it with this dynamic derived filter value. But if not, introducing the usage of a dedicated BCS .Net connector merely to filter on the current DateTime is an overweighted solution approach.
DataAccess operation within external repository context
So that leaves as only option to apply the datetime filter value within the Duet Enterprise Query operation. SAP NetWeaver supports this via the concept of default value for input parameters.
Sadly it is not possible to specify this at the level of the Gateway Data Model, so it must be specified in the invoked ABAP Function Module (RFC).
Note: avoid specifying application-specific default value in the RFC. Systemtime satisfies this guideline, but a concrete default value for DateTime input parameter typically does not.