Technically it is possible to create your own search scenario, filter class and search tool, and put your custom search logic there. Then write another report to trigger search implemented by your own search scenario:
(1) Create your filter class with interface IF_COM_PRSEARCHFILTER.
Put your own filter logic in method FILTER. It will be called by your own search tool. Define which search criteria will be relevant for your filter. In my example since I need to re-implement search by object description, so I make short text set type as relevant criteria.
(2) Create your own search tool with interface IF_COM_PRSEARCHTOOL.
Implement method RELEVANT_CRITERIA which has the same logic as your own filter class.
Implement method GETLIST_ACTIVE. Put your optimized solution in this method.
(3) Create your search scenario class with super class CL_COM_PRSEARCHSCENARIO_BASE. Redefine DETERMINE_STANDARD_TOOL. Just specify your own search tool and filter class in this method.
(4) [Optional] integrate your own search in PREPARE_DB_RANGE_SEARCH ( standard code change necessary )
(5) Since currently we do not need to integrate the new search via end-to-end way, we simply write a report to trigger search which will use our own search: This FM will not be used by UI search, so when you are comparing your search performance with standard search, please also trigger standard search via this report, too.
来自 “ ITPUB博客 ” ，链接：http://blog.itpub.net/24475491/viewspace-2704039/，如需转载，请注明出处，否则将追究法律责任。