ABAP training: Data Dictionary: Search Help

A search help can be created to speed up input data field for the end user. It can be used to quickly narrow down possible entries based on input criteria. Search helps can be assigned to data elements or database table fields.

Creation of search help

Start transaction SE11 and selection the option Search help and press Create:

In the selection screen choose Elementary search help:

The main search help screen opens:

Enter a description. And assign in the Selection method field your table. If you split the main table from the text table, you can assign the text table in the Text table field. In the dialog behavior the most common is to Display values immediately.

Always set a hotkey by assigning it a letter. When you create a Collective search help the search helps are sorted by this letter assignment.

In the parameters set your fields. IMP means it is input. EXP is there on the output. The LPos field determines the seqeuence on the output.

Now check and activate your search help.

Test the search help with the test button:

Assigning search help to table

The search help is not automatically used. You can assign it to the data element in SE11:

Or you can assign is specifically in SE11 in a table defintion:

Select the row, press the Srch Help button and assign the search help.

Most common is to assign it to a data element.

Using type-ahead and fuzzy search in F4 help

You can use type-ahead and fuzzy search in F4 help in custom ABAP code. Type-ahead will work with any database. Fuzzy search only with a HANA database.

Test table

First we create a simple test table and fill it with some dummy entries:

Set up Search Help

In SE11 now create elementary search help:

Fill the search help reference to the table and mark the Autosuggest (type-ahead) and mark the full text search:

The fuzzy value of 0,8 allows a similar keyword with a typo to popup. 0,9 be more strict, 0,7 will be less strict. You have to play around. 0,8 is a decent value.

Test program

Now you can test with this test program:

REPORT ZTEST_FUZZY.

PARAMETERS P_TEST type ZTEST-TEXT MATCHCODE OBJECT Z_TEST_FUZZY.

The parameter defined is referring to the search help (matchcode is the old term) we just defined.

Result: if the user starts to key, it will already suggest values:

System wide setup

If it is not working, check with transaction SDSH_CONFIG if the system wide setup is activated or not:

See OSS note 1971775 – Functional or Performance Issues Related to the Type-Ahead Search Functionality.