Skip to Content
ABAP Development

Business Partner Fuzzy Search on SAP HANA – an SAP Global IT Success Story

A marketing team was looking for a real-time solution that could identify contact people within their CRM business partner master
data. The goal was to analyze various external sources to determine comparable contacts and their organizations.
In addition, the team wanted to include additional external address data and generate a “best record – which could not be done by existing tools. So the team decided to evaluate the “fuzzy search” on SAP HANA in a side-by-side scenario.
What is fuzzy search?
Fuzzy search is a fast and error-tolerant search that is supported in SAP HANA. Error-tolerant means that data records with
similar content are also found. Parameterization of the SQL search request determines the degree of possible deviations – in
other words the error tolerance.
From a technology point of view, the fuzzy search available in SAP HANA is based on the “FUZZY! Double” product, which
was developed by an outside organization to enable a fast, error-free search.
Many functions available now
Many of the basic functions of a “fuzzy” solution are currently reflected in SAP HANA. The more specific functions are to be enhanced in future releases.
In some SAP solutions, such as master data governance (MDG), planned enhancements will use the SAP HANA database
fuzzy search and make them available in a user-friendly format.
Customizing search requests
The fuzzy search was evaluated before being released with SPS 04. This made it necessary to offer customizing of the search requests at a very native level and to use fuzzy SQL syntax enhancements without adapting the actual search methods.
In the planned SAP standard developments, this customizing will be set up in a more user-friendly manner.
Key functions:
Among the key functions of fuzzy search are:
  • Search: For the search, the CRM business partner dataset was extracted into two separate database tables for
    contact persons and organizations. These tables are updated by implementing the PARTNER_UPDATE and ADDRESS_UPDATE BAdIs. Initialization is done by a batch program
  • Address data storage: The system uses two new tables to store the address data (BUT000, BUT052,
         BUT020, ADRC, and ADR6) in a more simplified fashion, and to use the full potential of the fuzzy search.
  • Data transfer: Data is transferred to SAP HANA by means of SLT replication.  Since the corresponding HANA tables
    must contain specific indexing, it is imperative that the SLT does not overwrite the table format generated. Here it is
    necessary to set the “No drop” parameter in table IUUC_REPL_TABSTG in SLT Customizing.
The following are screen shots showing fuzzy search in action. For more information on how the fuzzy search works in SAP
HANA, see the SAP Help documentation.

Due to the system landscape (development, correction, test, and production), the two new search tables are generated by
an ABAP program and not manually in the SAP HANA studio.
The native SQL statements for creating and searching are carried out through methods from ADBC –ABAP Database Connectivity.
You can find a description of the ADBC in the SAP Workbench online help (ADBC + F1 in ABAP Editor). The program ADBC_DEMO shows how this works.
An auxiliary program is used to measure, test, and optimize the fuzzy search. You branch to the fuzzy search parameter maintenance from this program.
Our fuzzy search parameters are stored in two tables:
    1. The “Search parameter” table contains the final productive settings. This is a customizing table linked to transports
    2. The “Search simulation” table is used for specifying various test settings that can also be changed in the productive system

Overview of Fuzzy Parameters

NAME_FIRST Parameter

Placeholder„&1“ is replaced by the first name at run time.

SELECT Parameter

The SQLstatement is started using the SELECT parameter. Additional search parameters such as “NAME_FIRST“ and “EMAIL“  are added concatenated and the character “+” is replaced by a SPACE.
If required, the generated statement can be displayed to enable cut and paste should errors occur – and then to run it in the
SAP HANA Studio SQL editor.

Before it is run, the SQL  statement is checked for possible commands which could lead to data being changed, such as
SQL Command Generated

Search Contact Persons Test Program

Search Results – Screenshot Contains a 1/100 Second Runtime

The use of fuzzy search is, of course, not limited to identifying duplicates in the business partner area. It can be used in
various ways to search for generic master data and transaction data.
In addition to an online check for duplicates, it is also possible to imagine a batch job that prepares debugging of a complete dataset. For example, this may be used to help reduce mailing costs for an upcoming direct mail campaign.

Former Member

No comments