‎2006 Mar 28 5:41 AM
Hi,
I have a dropdown list in the selection screen. Sometimes user can also input a value which is not possible in the dropdown list..So in that case Is there any other option where the user can select a value or do an entry.
Pls help
‎2006 Mar 28 6:01 AM
Hi,
You can enter the values other than those appear in List box.It's better if you use F4 help for this purpose.
Try this code and kindly reward points if it helps.
tables kna1.
data:
begin of t_values occurs 2,
value like kna1-begru,
end of t_values,
t_return like ddshretval occurs 0 with header line.
select-options s_begru for kna1-begru.
at selection-screen on value-request for s_begru-low.
refresh t_values.
t_values = 'PAR*'.
append t_values.
t_values = 'UGG'.
append t_values.
call function 'F4IF_INT_TABLE_VALUE_REQUEST'
exporting
retfield = 'BEGRU'
value_org = 'S'
tables
value_tab = t_values
return_tab = t_return
exceptions
parameter_error = 1
no_values_found = 2
others = 3.
if sy-subrc = 0.
read table t_return index 1.
s_begru-low = t_return-fieldval.
endif.
‎2006 Mar 28 5:47 AM
HI suganya,
if that is the case ..
you can just use a
PARAMETERS : p_list ..
in this case he has an option to enter ..
also you can provide a good seach help
because <b>a list box allows user to enter those values in the List</b>..
it can be like this..
PARAMETERS : p_list(10).
at selection-screen on value-request for p_list.
regards
satesh
‎2006 Mar 28 5:50 AM
Hi suganya,
1. if u are looking for list box,
then we can do like this .
2.
REPORT abc.
TYPE-POOLS : vrm.
DATA : v TYPE vrm_values.
DATA : vw LIKE LINE OF v.
PARAMETERS : a(10) TYPE c AS LISTBOX VISIBLE LENGTH 10.
INITIALIZATION.
vw-key = '1'.
vw-text = 'Jan'.
APPEND vw TO v.
vw-key = '2'.
vw-text = 'Feb'.
APPEND vw TO v.
vw-key = '3'.
vw-text = 'Mar'.
APPEND vw TO v.
CALL FUNCTION 'VRM_SET_VALUES'
EXPORTING
id = 'A'
values = v
EXCEPTIONS
id_illegal_name = 1
OTHERS = 2.
regards,
amit m.
‎2006 Mar 28 5:51 AM
Hi Suganya,
In dropdown box, you can only select a value. If you want to do both selection and entry , then you have to go with Combobox.
If you want the code for combobox , I can send you a sample program to you.
Regards,
Sylendra.
‎2006 Mar 28 6:01 AM
Hi,
You can enter the values other than those appear in List box.It's better if you use F4 help for this purpose.
Try this code and kindly reward points if it helps.
tables kna1.
data:
begin of t_values occurs 2,
value like kna1-begru,
end of t_values,
t_return like ddshretval occurs 0 with header line.
select-options s_begru for kna1-begru.
at selection-screen on value-request for s_begru-low.
refresh t_values.
t_values = 'PAR*'.
append t_values.
t_values = 'UGG'.
append t_values.
call function 'F4IF_INT_TABLE_VALUE_REQUEST'
exporting
retfield = 'BEGRU'
value_org = 'S'
tables
value_tab = t_values
return_tab = t_return
exceptions
parameter_error = 1
no_values_found = 2
others = 3.
if sy-subrc = 0.
read table t_return index 1.
s_begru-low = t_return-fieldval.
endif.