SAP Screen Personas
Create: Tobias Queck
Last Update: Tamas Hoznek
Using Search Helps
SAP SCREEN PERSONAS KNOWLEDGE BASE - by Tobias Queck , Tamas Hoznek , Regina Sheynblat
This article describes the steps required to add a search help (a.k.a. F4 help) to a text field. Personas supports only generic search helps based on database tables, defined in the Data Dictionary.
In SAP Screen Personas 3.0, you can add search helps to existing or new input fields. There are different options to add either simple helps or more sophisticated scripts. In addition, before a search help can be added, the table it can access must be whitelisted.
Adding a search help to a text field implicitly allows the user to search through the database table(s) the screen field is connected to, or any information that the referenced search help can access. Therefore, please consider carefully where to add F4 helps and use authorization checks when necessary, as described below.
Before you start assigning F4 helps, all tables that can be used need to be whitelisted via the SAP Screen Personas Administration (transaction /PERSONAS/ADMIN). To get to the Search Help Whitelist maintenance, navigate to Whitelists → Search Helps. You can also start transaction /PERSONAS/F4_HELP. The following screen will open:
In this view, you can define the tables that are accessible as well as the fields that are allowed to be returned. The F4 Help function will use the search helps of the specified table- or structure fields. Last but not least, you can limit the usage of the search help to users that have specific authorizations. In this example screenshot, all fields for table SUID_ST_BNAME are enabled without any specific authorization requirements. If sensitive data is displayed by the search help results, the appropriate authorization object, field and activity should be specified to prevent unauthorized access.
If you have an existing flavor with an existing input field - this could be one from the original screen or a newly added input field - and you want to assign a script that is triggered if a user focuses the field and presses F4, then follow these steps.
- Click on the script inspector icon
- Click on the input field
- Wait until the list of all available properties and methods is shown underneath the id of the field
This method opens the search help defined by the parameters 'table' and 'field'. These parameters are mandatory. The parameter 'value' specifies the initial value of the F4 help. If it is not provided , then the current value of the text property is taken instead.
In some cases we may find that a particular search help is not tied to any database- or structure field. In other words, a suitable search help does exist but there is no direct link specified via the Data Dictionary which would make it available for the Personas F4 Help whitelist. This can happen if the search help is assigned to the screen field as a property via the Screen Painter.
Another problematic scenario is if there is a search help assignment, but the search help is realized using a check table. In such cases, the resulting possible value list is a rather poor-looking simple display of keys. Such an example would be the production order number (AUFNR) in structure CAUFVD. If we whitelist table CAUFVD and field AUFNR, hitting F4 gives the following list:
This function maintains a standard structure CI_PERSONAS_SHLP and here we have the possibility to enter a new field name and assign the desired search help, thereby providing the necessary table and field name the Search Help Whitelist needs:
The structure CI_PERSONAS_SHLP is actually part of the structure /PERSONAS/SEARCHHELP and allows maintenance of this custom search help structure without having to register the object for modification. Table name /PERSONAS/SEARCHHELP and the field PRODORD can now be whitelisted:
Referencing this entry when creating a new input field will activate search help CO_SH_PRODORD_ALL, just like in transaction CO03. The structure CI_PERSONAS_SHLP can certainly be enhanced with new search help references as necessary.
This article showed two alternatives allowing to add search helps to text fields. Option 1 is the usual standard approach and should be used for simple scenarios when a new field is to be added. Option 2 on the other hand, can be used with existing fields as well as if a custom logic needs to be executed before the F4 help is opened.