sapdev logo background
sapdev logo sapdev logo
Comments

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.




comments powered by Disqus