One of our clients experienced poor performance when searching for materials in SAP ECC. This was due to the fact that the customer had approx. 275 mill. material classification data records. To make it possible for non-SAP users to search the database, the client had a company-wide web-based front-end, which the employees were keen to keep.
As the client was introducing UNSPSC material classification, the issue with the poor performance were becoming critical: Searching and sourcing was becoming obstructively difficult.
Limitations of SAP standard search tools
SAP provides three out-of-the-box solutions for searching for materials:
- SAP GUI Classification Search
- SAP Gui Advanced Material Search
- Netweaver Business Client (NWBC)
However, each has its limitations:
SAP GUI Classification search is traditionally database-based and performs poorly with huge datasets. Furthermore, this tool is limited to a simple classification search on materials and cannot be combined with any other search criteria.
SAP Gui Advanced Search is available as a standard F4 search in SAP ECC if the Enterprise Search is activated on the system. This tool can search by using specific global material master fields in combination with a free text search. It is not possible to search on any specific class or characteristic value.
NetWeaver Business Client includes a material search capability using the Enterprise Search. This tool is capable of searching material master fields in combination with classification. However, it is not able to search in classification class independents, and it is impossible to utilise any further sorting attributes. The returned search results only contain the standard global material master data and not any classification data.
BoostPLM developed an optimised search solution addressing all the limitations in the standard search tools. In addition, the client can now search for materials using the Class Group applied to all UNSPSC classes.
A test in production environments showed that as the data set grows, so does the search time when using standard transactions – for 25.000 results, the response time was around 135 seconds.
For the newly-developed, optimised search, the response time is independent of the data set size! On average, the response time of the optimised search is 0.29 seconds – this is fast enough that the user won’t recognise any waiting time.
How did we do it?
Due to above limitations, we built a solution that could be used with the client’s existing webbased user-interface and made sure it was enabled for native SAP users as well as for other potential users, e.g. Windchill.
It was built as an RFC enabled functionality to support the legacy web-based search tool, but was also enabled to be used with oData based Gateway service in SAP for future integrations with e.g. Windchill.
The search functionality was based on the SAP standard recommended APIs towards the Enterprise Search Engine (TRex). This will also be capable of ‘surviving’ a migration to Hana S/4, where the search engine might be changed from TRex index based to CDS view based.
The main building blocks were the following ABAP classes:
- CL_ESH_IF_SEARCH_REQUEST-SET_SEARCH_MODE for setting the search mode (Exact, Fuzzy, etc.)
- CL_ESH_IF_SEARCH_REQUEST-ADD_SEARCH_ATTRIBUTE for feeding the search engine with the ‘simple’ standard material search field criteria.
- CL_SDQ_USMD_SEARCH_DATA_IMPL-ADD_COMPLEX_CRITERIA for feeding the search engine with the classification search criteria.
- CL_ESH_IF_SEARCH_REQUEST-SET_SORT_ATTRIBUTES for feeding the sort attributes into the search engine,
- CL_ESH_IF_SEARCH_REQUEST-SEARCH for the actual search to be performed.
- CL_ESH_IF_SEARCH_RESPONSES- GET_CONNECTOR_STATISTICS to get search statistics returned such as the total number of hits and search time.
- CL_ESH_IF_SEARCH_RESP_CONNECT- GET_RESULTS_DATA_RAW to have the search result returned.