Search Help exit to add entries to output selection table

The search help exit allows you to modify functionality of search help. If you are creating you own search help exit first copy function module F4IF_SHLP_EXIT_EXAMPLE into your own function group and modify it appropriately.

This example shows you how to populate the output table with new entries using a select etc. It selects data from table M_PREMN and stores it in the search help output table 'record_tab' within the 'string' field using the correct offset values fort each field access via the shlp-fielddescr table.

data: it_records type standard table of M_PREMN,
      wa_records type M_PREMN.
data: ld_fname type string.
FIELD-SYMBOLS: <offset>, <lenght>, <fname>.
  refresh record_tab.
  SELECT *
   UP TO 10 rows
    from M_PREMN
    into table it_records
   where ENDDA_0001 ge sy-datum.
  loop at it_records into wa_records.
    sort shlp-fielddescr by offset ASCENDING.
    loop at shlp-fielddescr into wa_fielddesc .
      ASSIGN wa_fielddesc-offset TO <offset>.
      ASSIGN wa_fielddesc-leng TO <lenght>.
      CONCATENATE 'WA_RECORDS-' wa_fielddesc-fieldname into ld_fname.
      ASSIGN (ld_fname) TO <fname>.
      record_tab-string+<offset>(<lenght>) = <fname>.
    endloop.
    append record_tab
  endloop.


Related Articles

SAP Search helps - F4 selection entry helps available on input fields
Standard SAP Search Help's not working after upgrading SAP
Basic SAP Search Help creation to be used within your ABAP program, database, field or domain
Basic Search Help
SAP Elementary search help - Can be used on its own or added to a collective search help
Search Help exit- Used to enhance search helps by adding new fields or functionality
Search Help exit to allow search results to be return even if text case does not match
Search Help exit to allow search results to be return even if text case does not match
Implementing search Helps