07-05-2006 3:17 AM
Hi,
Iam working on a search help for select-option,
is there a way to incorporate select-all or multiple
selection on this?
Thanks!
07-05-2006 4:21 AM
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
07-05-2006 4:22 AM
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
07-05-2006 4:50 AM
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?
07-05-2006 5:49 AM
have you noticed the <b>MULTIPLE_CHOICE = C_X " (for muliple selection)</b> option KLL is using?
07-07-2006 1:40 AM
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.
07-07-2006 2:07 AM
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
07-07-2006 2:28 AM
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.
07-07-2006 2:33 AM
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
07-07-2006 2:49 AM
07-07-2006 6:52 AM
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.