Application Development and Automation 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: 
Read only

search help

Former Member
0 Likes
540

hi experts,

can u send me the steps for creating search help .........for 1 field in selcect screen....they are 5 fields......i need only for 1 field.....

1 ACCEPTED SOLUTION
Read only

anversha_s
Active Contributor
0 Likes
512

hi,

there are 2 ways.

1. create a match code object in data base level.

<b><i>how?</i></b>

go to se11 select radio button search help - > tyou can create match code object there.

on the selection screen .you can use it like this :


parameters : p_test match code object "<match code object name>. 

2. crreating an f4 help.

<b><i>how to create?</i></b>

chk this sample code.

REPORT ZXYZ_0002 .
 
 
 
data: dynfields type table of dynpread with header line.
data: return type table of ddshretval with header line.
 
selection-screen begin of block b1 with frame title text-001 .
selection-screen begin of line.
PARAMETERS: P_BUKRS type T001-BUKRS.
selection-screen comment 30(20) BUTXT for field p_bukrs.
selection-screen end of line.
selection-screen end of block b1.
 
at selection-screen output.
 
if butxt is initial.
   select single butxt into butxt
         from t001
        where bukrs = p_bukrs.
endif.
 
 
at selection-screen on value-request for p_bukrs.
 
  call function 'F4IF_FIELD_VALUE_REQUEST'
       exporting
            tabname           = 'T001'
            fieldname         = 'BUKRS'
            dynpprog          = sy-cprog
            dynpnr            = sy-dynnr
            dynprofield       = 'P_BUKRS'
       tables
            return_tab        = return
       exceptions
            field_not_found   = 1
            no_help_for_field = 2
            inconsistent_help = 3
            no_values_found   = 4
            others            = 5.
 
  read table return with key fieldname = 'P_BUKRS'.
 
* Add it back to the dynpro.
  dynfields-fieldname = return-retfield.
  dynfields-fieldvalue =  return-fieldval.
  append dynfields.
 
* Get the company code from db and add to dynpro
  data: xt001 type t001.
 
  clear xt001.
  select single * into xt001
         from t001
        where bukrs = return-fieldval.
 
  dynfields-fieldname = 'BUTXT'.
  dynfields-fieldvalue = xt001-butxt.
  append dynfields.
 
 
* Update the dynpro values.
  call function 'DYNP_VALUES_UPDATE'
       exporting
            dyname     = sy-cprog
            dynumb     = sy-dynnr
       tables
            dynpfields = dynfields
       exceptions
            others     = 8.
 
start-of-selection.

Regards

Anver

5 REPLIES 5
Read only

Former Member
0 Likes
512

with tcode SE11 you can define an new searchhelp with the fields you want.

you implement it like this in you're selection screen

SELECTION-SCREEN BEGIN OF BLOCK miolvsel_1 WITH FRAME TITLE text-f01.

SELECT-OPTIONS:

so_stai1 FOR rihea-i_vstatin MATCHCODE OBJECT zz_gebr_status3.

Read only

anversha_s
Active Contributor
0 Likes
513

hi,

there are 2 ways.

1. create a match code object in data base level.

<b><i>how?</i></b>

go to se11 select radio button search help - > tyou can create match code object there.

on the selection screen .you can use it like this :


parameters : p_test match code object "<match code object name>. 

2. crreating an f4 help.

<b><i>how to create?</i></b>

chk this sample code.

REPORT ZXYZ_0002 .
 
 
 
data: dynfields type table of dynpread with header line.
data: return type table of ddshretval with header line.
 
selection-screen begin of block b1 with frame title text-001 .
selection-screen begin of line.
PARAMETERS: P_BUKRS type T001-BUKRS.
selection-screen comment 30(20) BUTXT for field p_bukrs.
selection-screen end of line.
selection-screen end of block b1.
 
at selection-screen output.
 
if butxt is initial.
   select single butxt into butxt
         from t001
        where bukrs = p_bukrs.
endif.
 
 
at selection-screen on value-request for p_bukrs.
 
  call function 'F4IF_FIELD_VALUE_REQUEST'
       exporting
            tabname           = 'T001'
            fieldname         = 'BUKRS'
            dynpprog          = sy-cprog
            dynpnr            = sy-dynnr
            dynprofield       = 'P_BUKRS'
       tables
            return_tab        = return
       exceptions
            field_not_found   = 1
            no_help_for_field = 2
            inconsistent_help = 3
            no_values_found   = 4
            others            = 5.
 
  read table return with key fieldname = 'P_BUKRS'.
 
* Add it back to the dynpro.
  dynfields-fieldname = return-retfield.
  dynfields-fieldvalue =  return-fieldval.
  append dynfields.
 
* Get the company code from db and add to dynpro
  data: xt001 type t001.
 
  clear xt001.
  select single * into xt001
         from t001
        where bukrs = return-fieldval.
 
  dynfields-fieldname = 'BUTXT'.
  dynfields-fieldvalue = xt001-butxt.
  append dynfields.
 
 
* Update the dynpro values.
  call function 'DYNP_VALUES_UPDATE'
       exporting
            dyname     = sy-cprog
            dynumb     = sy-dynnr
       tables
            dynpfields = dynfields
       exceptions
            others     = 8.
 
start-of-selection.

Regards

Anver

Read only

Former Member
0 Likes
512

chk this

Read only

Former Member
0 Likes
512

Hi Naveen,

You can assign search help for your selection screen by assigning the type of data.

e.g.

parameters p_test type LFA1-LIFNR.

this will create a parameter, and search help is automatically called when you press F4.

To create search you have to go to SE11 and do the nessesary operations.

IF you dont want to create search help using data dictionary table, that is dynamic search helps (which are populated using internal tables). then you can use following function modules

VRM_SET_VALUES

F4IF_INT_TABLE_VALUE_REQUEST

hope this helps..

Assign forum points to helpful answers

Read only

Former Member