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.

Call transaction security

An ABAP developer can call a different transaction from a custom build program or transaction. This can be very helpful for certain user requirements and can save an end user time when the system is helping him with jumping from one transaction to the next logical transaction.

Example

For authorization this can be a bit messy.
What for example will happen with this coding:

CALL TRANSACTION 'SU01'.

Will the SU01 transaction now be called successfully or not?

SE97 TCDCOUPLES

Suppose the user does not have rights to call SU01. The coding is still trying to go to this transaction.

Depending on the value of system parameter auth/check/calltransaction a couple of things can happen:

  • No check
  • Always check
  • Lookup if check is needed in table TCDCOUPLES

Table TCDCOUPLES links the calling transaction to the jumped to transaction and determines if the transaction authorization for the new transaction is required or not.

But what in case there is no entry or the entry in TCDCOUPLES is vague? Then it again determines on the value of parameter auth/check/calltransaction to be strict or not strict.

Entries in table TCDCOUPLES are maintained via transaction SE97:

Standard SAP example output:

Formal OSS note of SE97: 358122 – Description of functions of transaction SE97.

Updating TCDCOUPLES is a lot of work and no longer SAP best practice. See this SAP blog.

Correct way of coding

The correct way of coding is more simple: always indicate that the authority check is mandatory:

CALL TRANSACTION 'SU01' WITH AUTHORITY-CHECK.

In this way the coding forces the check independent of the system parameter and entries in TCDCOUPLES.

Finding incorrectly coded CALL TRANSACTIONS

The fastest way of finding incorrectly coded call transactions is by running the SAP CVA (code vulnerability analysis) tool. This tool scans for CALL TRANSACTIONS with missing authority checks. It also scans for other variations like dynamic use of CALL TRANSCATION.

Alternatively you can use CODE_SCANNER (see blog on usage) with this special input:

Basically you tell the program to look for any program with CALL TRANSACTION and not having WITH AUTHORITY-CHECK in it. Do realize it can potentially miss programs in case there are 2 calls (1 correct and 1 incorrect). The CVA tool will not miss this case.

LEAVE TO TRANSACTION

You might wonder: what is the situation for the LEAVE TO TRANSACTION statement? That is more simple. LEAVE TO TRANSACTION will always check the user rights for object S_TCODE for the transaction.

Migrate TREX to HANA

If you use SAP TREX for search, you might want to switch it to search on HANA. This can be done with HANA as primary database or as secondary database connection.

If you migrate you main database to HANA, the basic steps are described in OSS note 2054157 – How to migrate Enterprise Search from TREX to SAP HANA. Which are in short: delete current model, delete current connection, set up again (see blog).

In case you want to migrate from TREX to HANA search with a HANA database as secondary connection, there are different steps. First setup the secondary database connection. If that works, delete the current model and connection. You can run STC01 task list SAP_ESH_INITIAL_SETUP_WRK_CLIENT. Before executing the task list, tick the box for Set TREX Destination to SAP HANA DB:

Now fill out your details:


Now run the task list. After task list is done, rerun with ESH_COCKPIT the loading of the model and data again.

Bug fix notes

GTS Edition for Hana readiness check

If your company is running a GTS (global trade system) it might consider a conversion to GTS Edition for HANA. The GTS version for HANA has a different functional scope than a regular GTS system. It might be some functions are no longer supported on GTS Edition for HANA, some might be different, but also new functions might be available.

SAP GTS, edition for SAP HANA: Conversion readiness check

To get the right input for your business, you can run the conversion readiness check. Load OSS note 3033398 – SAP GTS, edition for SAP HANA: Conversion readiness check into your development system and transport it to your productive GTS system. The tool you can already run on development to get an impression, but must finally be run in production to make sure the data checks are done properly.

The note delivers program /SAPSLL/READINESS_CHK_V8000. This program you run in the system. The output is directly a list of items that might require your attention:

OSS note 2973223 – SAP Global Trade Services, edition for SAP HANA: Conversion readiness check – conflict clarification contains extra explanation on the checks.

Unlike most of the other readiness checks, no upload to SAP is required. You just run the check locally.

Bug fix and clarification OSS notes