Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

How to create search help at runtime??

former_member194669
Active Contributor
0 Kudos

Hi,

I have a custom table with 2 fields

STATUS

DESC

My requirement is i will pass this table entries to function module that need to create search help for me.

Is there any function module for functionality available in SAP?

I don't want to create a search for this table use SE11.

Thanks

aRs

3 REPLIES 3

Former Member
0 Kudos

Hi,

Yes..You can FM F4IF_INT_TABLE_VALUE_REQUEST

Thanks,

Naren

Former Member
0 Kudos

SELECT from ur custom table INTO table VALUE_ITAB.

FIELD_TAB-FIELDNAME = 'UR CUSTOM TABLE'.

FIELD_TAB-TABNAME = 'STATUS'.

APPEND FIELD_TAB.

FIELD_TAB-FIELDNAME = 'UR CUSTOM TABLE'.

FIELD_TAB-TABNAME = 'DESC'.

APPEND FIELD_TAB.

CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'

EXPORTING

  • DDIC_STRUCTURE = ' '

RETFIELD = FIELD_TAB-FIELDNAME

TABLES

VALUE_TAB = VALUE_ITAB

FIELD_TAB = FIELD_TAB

RETURN_TAB = RETURN_TAB

  • DYNPFLD_MAPPING =

  • EXCEPTIONS

  • PARAMETER_ERROR = 1

  • NO_VALUES_FOUND = 2

  • OTHERS = 3

.

  • IF SY-SUBRC <> 0.

    • MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

    • WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

  • ENDIF.

read table return_tab with fieldname = 'STATUS'

IF SY-SUBRC = 0.

fieldvalue = RETURN_TAB-FIELDVAL.

ENDIF.

RichHeilman
Developer Advocate
Developer Advocate
0 Kudos

HEre is an example program of how to build search help on the fly.



report zrich_0001 .

tables: t001.

data: begin of it001 occurs 0,
      bukrs type t001-bukrs,
      butxt type t001-butxt,
      ort01 type t001-ort01,
      land1 type t001-land1,
      end of it001.

select-options s_bukrs for t001-bukrs.

initialization.

  select bukrs butxt ort01 land1 into table it001 from t001.

  sort it001 ascending by bukrs.
  delete adjacent duplicates from it001 comparing bukrs.

at selection-screen on value-request for s_bukrs-low.

  call function 'F4IF_INT_TABLE_VALUE_REQUEST'
       exporting
            retfield    = 'BUKRS'
            dynprofield = 'S_BUKRS'
            dynpprog    = sy-cprog
            dynpnr      = sy-dynnr
            value_org   = 'S'
       tables
            value_tab   = it001.

start-of-selection.

Regards,

Rich Heilman