09-06-2006 5:55 PM
HI FRIENDS,
in my selection screen i need to diplay some 6 material numbers as drop down list
for that i am defining
select-options:s_matnr for mara like mara-matnr.
so plz help me how to write code for that
regards,
divya
09-06-2006 5:58 PM
i think you need to use a matchcode to do this. you have to go to the se11 and doit in the search help and create a new one.
09-06-2006 5:58 PM
i think you need to use a matchcode to do this. you have to go to the se11 and doit in the search help and create a new one.
09-06-2006 6:00 PM
hi jose
there are some fixed materials ( four materials) those only i need to display as drop down list for select option low and high
regards,
divya
09-06-2006 6:04 PM
For example, you can fill manully.
report zrich_0001.
data: begin of ima occurs 0,
matnr type makt-matnr,
maktx type makt-maktx,
end of ima.
select-options s_matnr for ima-matnr..
initialization.
<b>ima-matnr = 'ABC'.
ima-maktx = 'Material ABC'.
append ima.
ima-matnr = 'DEF'.
ima-maktx = 'Material DEF'.
append ima.
ima-matnr = 'GHI'.
ima-maktx = 'Material GHI'.
append ima.
ima-matnr = 'JKL'.
ima-maktx = 'Material JKL'.
append ima.</b>
at selection-screen on value-request for s_matnr-low.
call function 'F4IF_INT_TABLE_VALUE_REQUEST'
exporting
retfield = 'MATNR'
dynprofield = 'S_MATNR'
dynpprog = sy-cprog
dynpnr = sy-dynnr
value_org = 'S'
tables
value_tab = ima.
at selection-screen on value-request for s_matnr-high.
call function 'F4IF_INT_TABLE_VALUE_REQUEST'
exporting
retfield = 'MATNR'
dynprofield = 'S_MATNR'
dynpprog = sy-cprog
dynpnr = sy-dynnr
value_org = 'S'
tables
value_tab = ima.
start-of-selection.
Regards,
Rich Heilman
09-06-2006 6:12 PM
hi rich
Thanks a lot
But in low and high
i need to display drop down list for values
1)control
2)noncontrol
3)control cage
coming from maex-alnum
but i dont want f4 help for this
plz help me
regards
divya
09-06-2006 6:16 PM
You can't do listbox for select-options. Select-options was designed with multiple complex selection in mind, and listbox does not really fit in well with this. You must use a parameter for listboxes.
Try to explain to me how using a list box in your situation would be helpful?
Or use F4 help as I have described above.
Regards,
Rich Heilman
09-06-2006 6:19 PM
Hi
See my previous answer, there you can find the link to SAP Help to build a listbox.
But, just as I said, I don't believe you can do it in a select-options, because it doesn't make sense to use a listbox with a select-option.
Max
09-06-2006 6:24 PM
hi rich
thanks a lot
my requirement as follows
Control Class(maex-alnum) select option Range, with drop down list values Ctrl Vault, 'Ctrl Cage, 'Non Ctrl.
regards,
divya
09-06-2006 6:27 PM
If you want do mimic the range functionality of the select-options you can do something like this. Have two parameter fields(listboxes) and build a range after the selection screen. See the following example program.
report zrich_0001.
tables: mara.
type-pools: vrm.
ranges: r_matnr for mara-matnr.
selection-screen begin of line.
selection-screen comment (10) ff_text.
parameters: p_fld1 type mara-matnr as listbox visible length 20.
selection-screen position 50.
selection-screen comment (10) tf_text.
parameters: p_fld2 type mara-matnr as listbox visible length 20.
selection-screen end of line.
initialization.
ff_text = 'From Field'.
tf_text = 'To Field'.
perform build_user_drop_down_list.
start-of-selection.
r_matnr-sign = 'I'.
r_matnr-option = 'BT'.
r_matnr-low = p_fld1.
r_matnr-high = p_fld2.
append r_matnr.
* Now you can use the R_MATNR in a select statement.
************************************************************************
* build user_drop_down_list
************************************************************************
form build_user_drop_down_list.
data: name type vrm_id,
list type vrm_values,
value like line of list.
clear list. refresh list.
clear value.
value-key = 'MATA'.
value-text = 'Material A'.
append value to list.
clear value.
value-key = 'MATB'.
value-text = 'Material B'.
append value to list.
clear value.
value-key = 'MATC'.
value-text = 'Material C'.
append value to list.
clear value.
value-key = 'MATD'.
value-text = 'Material D'.
append value to list.
clear value.
value-key = 'MATE'.
value-text = 'Material E'.
append value to list.
* Set the values for P_FLD1
name = 'P_FLD1'.
call function 'VRM_SET_VALUES'
exporting
id = name
values = list.
* Set values for P_FLD2
name = 'P_FLD2'.
call function 'VRM_SET_VALUES'
exporting
id = name
values = list.
endform.
Regards,
Rich Heilman
09-06-2006 6:45 PM
09-06-2006 6:02 PM
Here is an examle, of course you can fill the IMA internal table manually.
report zrich_0001.
data: begin of ima occurs 0,
matnr type makt-matnr,
maktx type makt-maktx,
end of ima.
select-options s_matnr for ima-matnr..
initialization.
select matnr maktx from makt into table ima
up to 6 rows
where spras = sy-langu.
at selection-screen on value-request for s_matnr-low.
call function 'F4IF_INT_TABLE_VALUE_REQUEST'
exporting
retfield = 'MATNR'
dynprofield = 'S_MATNR'
dynpprog = sy-cprog
dynpnr = sy-dynnr
value_org = 'S'
tables
value_tab = ima.
at selection-screen on value-request for s_matnr-high.
call function 'F4IF_INT_TABLE_VALUE_REQUEST'
exporting
retfield = 'MATNR'
dynprofield = 'S_MATNR'
dynpprog = sy-cprog
dynpnr = sy-dynnr
value_org = 'S'
tables
value_tab = ima.
start-of-selection.
Regards
Rich Heilman
09-06-2006 6:03 PM
Hi
I don't if it's possible to do it for a select-options, anyway see here:
http://help.sap.com/saphelp_46c/helpdata/en/9f/dbabe435c111d1829f0000e829fbfe/frameset.htm
Max