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: 

Problem on Search Help for select-option

Former Member
0 Kudos

Hi,

Iam working on a search help for select-option,

is there a way to incorporate select-all or multiple

selection on this?

Thanks!

10 REPLIES 10

RichHeilman
Developer Advocate
Developer Advocate
0 Kudos

Hi. You can do any kind of search help on your select-options field. Please see the example program here. Notice that it builds the search help at runtime.



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

Former Member
0 Kudos

Use the function

F4IF_INT_TABLE_VALUE_REQUEST

Insert the function at "at selection-screen on value-request for" event.

You must first fill up the table parameters for the function.

CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'

EXPORTING

RETFIELD = 'POSNR'

WINDOW_TITLE = 'Line Item'

VALUE_ORG = 'S'

MULTIPLE_CHOICE = C_X " (for muliple selection)

TABLES

VALUE_TAB = I_DISPLAY

FIELD_TAB = I_FIELDTAB

RETURN_TAB = I_RETURNVAL

EXCEPTIONS

PARAMETER_ERROR = 1

NO_VALUES_FOUND = 2

OTHERS = 3

0 Kudos

i already add search help with value restrictions using

fm 'F4IF_INT_TABLE_VALUE_REQUEST'

for the select-option (both so-high and so-low), my problem is when i click the multiple selection button

there is no property/button for multiple selection or select-all

unlike those select-options that are referenced to a field with built in search help.

how would I go about this?

0 Kudos

have you noticed the <b>MULTIPLE_CHOICE = C_X " (for muliple selection)</b> option KLL is using?

0 Kudos

yes i already marked the Multiple Choice of f4 function module, but what i actually want is to select multiple

values on the multiple selection button (located at the right most part of the select-option).

please help.

RichHeilman
Developer Advocate
Developer Advocate
0 Kudos

I think I see what you are saying, I have managed to get it working half way. When you do mulitple selection using the icon on the right and F4 help, then select, and hit green check, then don't show in that box, but if you click the execute button to go back to the selection screen, they are then updated in the selection option. Again, this probably isn't good enough for your requirement, but getting closer.



report zrich_0002.

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.

<b>data: return type table of ddshretval with header line.</b>

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
<b>            multiple_choice = 'X'</b>
            value_org       = 'S'
       tables
            value_tab       = it001
      <b>      return_tab      = return.</b>


<b>  clear s_bukrs. refresh s_bukrs.
  s_bukrs-sign = 'I'.
  s_bukrs-option = 'EQ'.

  loop at return.
    s_bukrs-low = return-fieldval.
    append s_bukrs.
  endloop.
  clear s_bukrs.</b>

 


start-of-selection.

Regards,

Rich Heilman

0 Kudos

yes rich you got it, i was doing the same thing and the

selected values do not show up in the box though the values of select-option are updated.

0 Kudos

This is weird. I've look a a couple standard programs that use the multiple selection parameter of this function module, the funny thing is, is that in not any of them, is this tied to a selection screen parameter nor a select-option. Maybe usin this parameter of the function module was not designed for use with a selection screen field. It looks in these standard programs that it is just be used as a pop up and select kind of thing.

Regards,

Rich Heilman

0 Kudos

I see, thanks Rich. 😃

0 Kudos

Hi catherine,

1. Just copy paste this program.

(It will POPULATE the SELECT-OPTION,

based upon

MULTIPLE Selection,

selected by the user,

in the help provided thru F4IF_INT_TABLE_VALUE_REQUEST.)

2. Eg. is for BUKRS (company code)

3.

REPORT ABC.

TABLES : T001.

DATA : ITAB LIKE TABLE OF T001 WITH HEADER LINE.

DATA : RETURN LIKE TABLE OF DDSHRETVAL WITH HEADER LINE.

*----


SELECT-OPTIONS : BUKRS FOR T001-BUKRS.

*----


AT SELECTION-SCREEN ON VALUE-REQUEST FOR BUKRS-LOW.

PERFORM MYPOPULATE.

*----


AT SELECTION-SCREEN ON VALUE-REQUEST FOR BUKRS-HIGH.

PERFORM MYPOPULATE.

*----


*

*----


FORM MYPOPULATE.

REFRESH ITAB.

SELECT * FROM T001 INTO TABLE ITAB.

call function 'F4IF_INT_TABLE_VALUE_REQUEST'

EXPORTING

retfield = 'BUKRS'

dynprofield = 'BUKRS'

dynpprog = sy-REPID

dynpnr = sy-dynnr

multiple_choice = 'X'

value_org = 'S'

TABLES

value_tab = ITAB

return_tab = return.

.

IF RETURN[] IS NOT INITIAL.

REFRESH BUKRS.

CLEAR BUKRS.

LOOP AT RETURN.

BUKRS-SIGN = 'I'.

BUKRS-OPTION = 'EQ'.

BUKRS-LOW = RETURN-FIELDVAL.

BUKRS-HIGH = RETURN-FIELDVAL.

APPEND BUKRS.

ENDLOOP.

ENDIF.

ENDFORM.

regards,

amit m.