Search Helps in SAP ABAP — Elementary and Collective Search Help (SE11)
Table of Contents
- • What is a Search Help?
- • Part 1: Creating an Elementary Search Help in SE11
- ↳ Step 1: Open Transaction SE11
- ↳ Step 2: Define Selection Method and Text
- ↳ Step 3: Define Parameters
- • Part 2: Creating a Collective Search Help in SE11
- ↳ Step 1: Create the Collective Search Help Shell
- ↳ Step 2: Add Elementary Search Helps
- ↳ Step 3: Parameter Assignment
- • Part 3: Assigning Search Helps to Screen Fields and Tables
- ↳ Attachment Method 1: On a Selection Screen Field (MATCHCODE OBJECT)
- ↳ Attachment Method 2: At Database Table Level (SE11)
- ↳ Attachment Method 3: At Data Element Level (SE11)
- ↳ Attachment Method 4: Programmatic F4 Help using Process On Value-Request (POV)
- • Part 4: Advanced — Search Help Exits
- ↳ Search Help Exit Interface
- ↳ The STEP Parameter
- • Comparison Table: Search Help Attachment Options
- • Quick Checkpoint — Test your understanding
- • Common mistakes to avoid
- • Summary
![]()
Every SAP user relies on F4 help. You click an input field on a screen, press the F4 key (or click the small magnifying glass icon), and a search dialog pops up showing a list of valid values. You double-click a row, and the selected value fills your input field automatically.
In SAP ABAP, this feature is called Input Help or Search Help.
As an ABAP developer, creating search helps is a routine requirement. When business users enter data into custom Z-tables or selection screen fields, they expect F4 help. Without it, users have to memorize cryptic material numbers, customer codes, and plant keys.
This guide explains how Search Helps work in the ABAP Dictionary (transaction SE11). We will cover Elementary Search Helps, Collective Search Helps, assigning search helps to table fields, and using Search Help Exits for custom filtering logic.
What is a Search Help?
A Search Help is an ABAP Dictionary object created in transaction SE11 that defines the data source, search criteria, and layout for an F4 input help popup window.
There are two main types of Search Helps in SAP:
- Elementary Search Help: Defines a single search path. It reads data from a single table or database view, defines selection criteria fields, and displays result columns.
- Collective Search Help: Combines multiple Elementary Search Helps into a single tabbed dialog window. This lets users choose between different search paths (e.g., search customer by Name, search customer by City, or search customer by Country).
┌──────────────────────────────┐
│ Search Help Types (SE11) │
└──────────────┬───────────────┘
│
┌───────────────────┴───────────────────┐
▼ ▼
┌─────────────────────────┐ ┌─────────────────────────┐
│ Elementary Search Help │ │ Collective Search Help │
│ (Single Search Path) │ │ (Combines Multiple │
│ e.g. Search by Name │ │ Elementary Helps) │
└─────────────────────────┘ └─────────────────────────┘
Part 1: Creating an Elementary Search Help in SE11
An Elementary Search Help defines a single search path. Let’s walk through creating one step by step.
Scenario: We want to create an F4 search help for custom Vendor records, allowing users to search by Vendor Name or City.
Step 1: Open Transaction SE11
- Enter transaction code
/nSE11. - Select the Search help radio button.
- Enter a name starting with Z or Y (e.g.,
ZSH_VENDOR_NAME). - Click Create.
- In the pop-up dialog, choose Elementary search help and click OK.
Step 2: Define Selection Method and Text
- In the Short text field, enter a description:
"Search Vendor by Name". - In the Selection method field, enter the database table or view name containing your data (e.g.,
LFA1for standard vendors orZVENDOR_TABLEfor custom data). - Set Dialog type:
Display values immediately: Shows results as soon as the user presses F4 (best for small datasets under 100 rows).Dialog depending on set of values: Asks for search criteria first if dataset is large (recommended for production tables).
Step 3: Define Parameters
In the Parameter table at the bottom of the screen, specify which fields appear as search filters or result columns:
Search Help Parameter │ IMP │ EXP │ LPOS │ SPOS │ Data Element
──────────────────────┼─────┼─────┼──────┼──────┼───────────────
LIFNR (Vendor Code) │ X │ X │ 1 │ 1 │ LIFNR
NAME1 (Vendor Name) │ X │ │ 2 │ 2 │ NAME1_GP
ORT01 (City) │ X │ │ 3 │ 3 │ ORT01
Understanding the parameter settings:
- IMP (Importing): Check this if the field receives an initial value from the screen when F4 is pressed.
- EXP (Exporting): Check this if the selected value from the search help returns back to fill the screen field (typically checked for the key field
LIFNR). - LPOS (List Position): The column position in the result list popup (1 = 1st column, 2 = 2nd column).
- SPOS (Screen Position): The row position in the search filter selection window.
Save and Activate your search help.
Part 2: Creating a Collective Search Help in SE11
When users need multiple ways to find a record (e.g., search vendor by Name OR search vendor by Country OR search vendor by Bank Details), an Elementary Search Help is not enough. You combine them into a Collective Search Help.
A Collective Search Help displays as a dialog with multiple tabs. Each tab corresponds to an Elementary Search Help.
Step 1: Create the Collective Search Help Shell
- Open transaction SE11.
- Enter search help name:
ZSH_VENDOR_COLLECTIVE. - Click Create → select Collective search help.
- Short text:
"Collective Search Help for Vendors".
Step 2: Add Elementary Search Helps
Switch to the Included search helps tab.
List the Elementary Search Helps you want to combine:
Included Search Help │ Short Text
─────────────────────┼───────────────────────────────
ZSH_VENDOR_NAME │ Search Vendor by Name
ZSH_VENDOR_CITY │ Search Vendor by City
ZSH_VENDOR_COUNTRY │ Search Vendor by Country
Step 3: Parameter Assignment
Switch to the Parameter definition tab.
Define the global parameters for the collective search help (e.g., LIFNR, NAME1).
Then highlight each included search help and click Param. assignment. Map the parameters of the collective search help to the parameters of each elementary search help.
Save and Activate.
When a user triggers F4 help, SAP displays a tabbed popup window where each tab represents one search path.
Part 3: Assigning Search Helps to Screen Fields and Tables
Creating a search help in SE11 is only half the job. You must attach it to a database table field, a Data Element, or a report selection screen field.
Here are the 4 ways to attach a search help:
Attachment Method 1: On a Selection Screen Field (MATCHCODE OBJECT)
In an ABAP report program, attach a search help directly to a PARAMETERS or SELECT-OPTIONS statement using MATCHCODE OBJECT:
REPORT z_search_help_demo.
PARAMETERS: p_lifnr TYPE lfa1-lifnr MATCHCODE OBJECT zsh_vendor_name.
When the user positions the cursor on field p_lifnr and presses F4, SAP automatically invokes ZSH_VENDOR_NAME.
Attachment Method 2: At Database Table Level (SE11)
Attach a search help to a database table field in SE11 so every screen across the system using that table field automatically gets F4 help.
- Open transaction SE11 → enter table name (e.g.,
ZPURCHASE_ORD). - Display table fields.
- Select the target field (e.g.,
VENDOR_ID). - Click the Search Help button in the toolbar (or menu: Edit → Search Help → Attach to Field).
- Enter your search help name
ZSH_VENDOR_COLLECTIVE. - Map table fields to search help parameters.
- Save and Activate the table.
Attachment Method 3: At Data Element Level (SE11)
Attach a search help directly to a Data Element. Any database table, structure, or screen field referencing that Data Element automatically inherits the search help.
- Open transaction SE11 → Data Element (e.g.,
ZDE_VENDOR_ID). - Go to the Further Characteristics tab.
- In the Search help section, enter
ZSH_VENDOR_NAME. - Save and Activate.
Attachment Method 4: Programmatic F4 Help using Process On Value-Request (POV)
For classical Dynpro screens (SE80 screens) or custom selection screens where you need complete code control over F4 logic, use the AT SELECTION-SCREEN ON VALUE-REQUEST event and function module F4IF_INT_TABLE_VALUE_REQUEST.
REPORT z_custom_f4_demo.
TYPES: BEGIN OF ty_vendor,
lifnr TYPE lfa1-lifnr,
name1 TYPE lfa1-name1,
ort01 TYPE lfa1-ort01,
END OF ty_vendor.
DATA: lt_vendors TYPE TABLE OF ty_vendor,
lt_return TYPE TABLE OF ddshretval.
PARAMETERS: p_vendor TYPE lfa1-lifnr.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_vendor.
" 1. Read custom data into internal table
SELECT lifnr, name1, ort01
FROM lfa1
INTO TABLE @lt_vendors
UP TO 50 ROWS.
" 2. Call standard F4 popup function module
CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
EXPORTING
retfield = 'LIFNR'
value_org = 'S'
TABLES
value_tab = lt_vendors
return_tab = lt_return
EXCEPTIONS
parameter_error = 1
no_values_found = 2
OTHERS = 3.
" 3. Fill the screen field with selected value
IF sy-subrc = 0.
READ TABLE lt_return INTO DATA(ls_ret) INDEX 1.
IF sy-subrc = 0.
p_vendor = ls_ret-fieldval.
ENDIF.
ENDIF.
Part 4: Advanced — Search Help Exits
Sometimes standard search help configuration is not enough. You might need to:
- Filter search results dynamically based on user authorizations or company code.
- Change the list of displayed fields at runtime.
- Pre-fill search filter parameters dynamically.
SAP provides Search Help Exits. A Search Help Exit is a custom Function Module attached to a Search Help in SE11 that executes at specific steps during the F4 popup lifecycle.
Search Help Exit Interface
A Search Help Exit function module must have a predefined interface. SAP provides a template function module called F4UT_EXAMPLE. Copy F4UT_EXAMPLE to your custom Z-function module (e.g., Z_SHELP_EXIT_VENDOR).
The STEP Parameter
The exit function module executes multiple times during the F4 lifecycle. The CALLCONTROL-STEP parameter tells you which step is currently executing:
FUNCTION z_shelp_exit_vendor.
*"----------------------------------------------------------------------
*" TABLES
*" SHLP_TAB TYPE SHLP_DESCT
*" RECORD_TAB STRUCTURE SEAHLPRES
*" CHANGING
*" REFERENCE(SHLP) TYPE SHLP_DESCT
*" REFERENCE(CALLCONTROL) LIKE DDSHF4CTRL STRUCTURE DDSHF4CTRL
*"----------------------------------------------------------------------
CASE callcontrol-step.
WHEN 'SELONE'.
" Executed before search help dialog opens
" Use this to pre-fill search criteria or hide tabs
WHEN 'PRESEL'.
" Executed before database SELECT
" Use this to modify WHERE clause conditions in SHLP-SELOPT
WHEN 'DISP'.
" Executed after database SELECT, before displaying result list
" Use this to filter out restricted rows from RECORD_TAB
ENDCASE.
ENDFUNCTION.
Attach your function module in SE11 on the Search help exit field of your Elementary Search Help.
Comparison Table: Search Help Attachment Options
| Attachment Option | Scope | Maintenance Effort | Priority |
|---|---|---|---|
| Selection Screen (MATCHCODE OBJECT) | Single report field | Low | Low (overridden by table attachment) |
| Table Field Attachment | All screens using that table field | Medium | High |
| Data Element Attachment | System-wide (all tables/fields using Data Element) | Low | Medium |
| Programmatic POV (F4IF_INT_TABLE_VALUE_REQUEST) | Single screen/report | High (requires ABAP code) | Highest (overrides dictionary settings) |
Quick Checkpoint — Test your understanding
Question 1: What is the main difference between an Elementary Search Help and a Collective Search Help in transaction SE11?
Answer: An Elementary Search Help defines a single search path (single table/view). A Collective Search Help combines multiple Elementary Search Helps into a single tabbed dialog window, allowing users to choose between different search methods.
Question 2: Which parameter flags in an Elementary Search Help determine which field is passed back to fill the screen input field?
Answer: The
EXP(Exporting) parameter flag andLPOS(List Position).
Question 3: Which standard SAP function module allows ABAP developers to build custom F4 help popups directly from an internal table in code?
Answer:
F4IF_INT_TABLE_VALUE_REQUEST.
Common mistakes to avoid
Mistake 1: Forgetting to set LPOS and SPOS. If you add parameters to an Elementary Search Help in SE11 but leave LPOS (List Position) and SPOS (Screen Position) blank, those fields will not appear in the result popup or the selection filter screen.
Mistake 2: Not marking key fields as EXP. If you forget to check the EXP (Exporting) box on the key field parameter, the search help will open and let the user select a row, but double-clicking a row will not return any value back to the screen field.
Mistake 3: Hardcoding large database SELECTs in F4 exits without indexes. If your search help reads a table with 500,000 records without using primary key fields or secondary indexes, pressing F4 will freeze the user’s screen for 30 seconds. Ensure the selection method table has proper database indexes on search fields.
Mistake 4: Overusing custom POV code when SE11 Search Help is enough. Writing 50 lines of custom AT SELECTION-SCREEN ON VALUE-REQUEST code for a basic database lookup is unnecessary. Create an Elementary Search Help in SE11 instead. It is faster, reusable, and requires zero maintenance code.
Summary
Search Helps in transaction SE11 provide a standardized, reusable way to implement F4 input help across SAP systems.
By building Elementary Search Helps for single search paths, combining them into Collective Search Helps for complex data objects, and leveraging Search Help Exits when custom business rules are required, you create user-friendly SAP applications that reduce data entry errors and improve productivity.
Related reads on this site:
- SE11 Transaction Code in SAP ABAP — complete Data Dictionary walkthrough
- SAP ABAP Data Element — defining domain references and field texts
- SAP ABAP Select Options — creating multi-value selection screen controls
Written by Daksh Dedha
SAP Technical ConsultantDaksh is an SAP Technical Consultant specializing in ABAP programming, SAP S/4HANA migrations, Fiori development, and BTP cloud architecture. He authors free, hands-on tutorials to make enterprise SAP education accessible to all developers.
Test Your Knowledge
Loading question...
Quiz Completed
Related Tutorials
Table Maintenance Generator in SAP ABAP: Step-by-Step Guide
Learn how to create a Table Maintenance Generator (TMG) in SAP ABAP using transaction code SE11, maintain data with SM30, and avoid common mistakes.
Data DictionarySE11 Transaction Code in SAP ABAP: Complete ABAP Dictionary Guide
Master the fundamentals of the SE11 transaction code in SAP ABAP. Learn how to navigate the ABAP Dictionary, create tables, domains, views, search
Data DictionaryHow to Create a Structure in SAP ABAP (SE11) – Step-by-Step Guide
Learn what a structure is in SAP ABAP, how it differs from a database table, and the step-by-step process to create and use structures in ABAP programs.
Found this tutorial useful? Share it with your SAP development team.