‎2007 May 31 2:15 PM
I have a selection screen for various inputs, including Fiscal Year.
I want to restrict the ability of users to input this field as follows:
Include single values only and not be able to specify exclusions.
I have made use of the No Intervals option, but the user still has
the ability to include a range of values and to exclude values.
So I want to use this function to further restrict the values that
can be inputted: select_options_restrict. But I have been unable
to configure the parameters in a way that the user can only include
values and also not be able to specify a range.
‎2007 May 31 2:27 PM
CHeck this sample.
report zrich_0001 .
tables: bkpf.
* Type pools
type-pools: slis, sscr.
* Selection Screen
select-options: s_GJAHR for bkpf-GJAHR no intervals.
initialization.
perform initilization.
************************************************************************
* INITILIZATION
************************************************************************
form initilization.
* Restrict the select options for S_DATE
* to just a date range
data: selopt type sscr_ass,
opt_list type sscr_opt_list,
restrict type sscr_restrict.
clear opt_list.
opt_list-name = 'EQ'.
opt_list-options-eq = 'X'.
append opt_list to restrict-opt_list_tab.
clear selopt.
selopt-kind = 'S'.
selopt-name = 'S_GJAHR'.
selopt-sg_main = 'I'.
selopt-sg_addy = ' '.
selopt-op_main = 'EQ'.
selopt-op_addy = 'EQ'.
append selopt to restrict-ass_tab.
call function 'SELECT_OPTIONS_RESTRICT'
exporting
restriction = restrict
exceptions
too_late = 1
repeated = 2
selopt_without_options = 5
selopt_without_signs = 6
invalid_sign = 7
empty_option_list = 9
invalid_kind = 10
repeated_kind_a = 11
others = 12.
endform.
Regards,
RIch Heilman
‎2007 May 31 2:18 PM
Hi,
if u want to restrict to only one value.
then use this:
Select-options: mat type mara-matnr no-interval no extension.
Reward if helpful.
Regards,
Naveen
‎2007 May 31 2:25 PM
Hi...
Please follow the option no extension of Slect-options :
Select-options: werks type werks no-interval no extension .
This will remove the extension box on the screen and this way values will be restricted.
Praveen
‎2007 May 31 2:26 PM
hi
<b>this works fine:</b>
REPORT zselopt_eq.
TYPE-POOLS : sscr.
DATA tr TYPE sscr_restrict.
DATA w1 TYPE sscr_opt_list.
DATA w2 TYPE sscr_ass.
TABLES bkpf.
SELECT-OPTIONS gjahr FOR bkpf-gjahr.
INITIALIZATION.
MOVE 'JUST_EQ' TO w1-name.
MOVE 'X' TO w1-options-eq.
MOVE 'X' TO w1-options-ne.
APPEND w1 TO tr-opt_list_tab.
MOVE: 'S' TO w2-kind,
'GJAHR' TO w2-name,
'I' TO w2-sg_main.
MOVE 'N' TO w2-sg_addy.
MOVE 'JUST_EQ' TO w2-op_main.
APPEND w2 TO tr-ass_tab.
*
CALL FUNCTION 'SELECT_OPTIONS_RESTRICT'
EXPORTING
restriction = tr.
START-OF-SELECTION.
regards
ravish
<b>plz dont forget to reward points if helpful</b>
Message was edited by:
ravish goyal
‎2007 May 31 2:27 PM
CHeck this sample.
report zrich_0001 .
tables: bkpf.
* Type pools
type-pools: slis, sscr.
* Selection Screen
select-options: s_GJAHR for bkpf-GJAHR no intervals.
initialization.
perform initilization.
************************************************************************
* INITILIZATION
************************************************************************
form initilization.
* Restrict the select options for S_DATE
* to just a date range
data: selopt type sscr_ass,
opt_list type sscr_opt_list,
restrict type sscr_restrict.
clear opt_list.
opt_list-name = 'EQ'.
opt_list-options-eq = 'X'.
append opt_list to restrict-opt_list_tab.
clear selopt.
selopt-kind = 'S'.
selopt-name = 'S_GJAHR'.
selopt-sg_main = 'I'.
selopt-sg_addy = ' '.
selopt-op_main = 'EQ'.
selopt-op_addy = 'EQ'.
append selopt to restrict-ass_tab.
call function 'SELECT_OPTIONS_RESTRICT'
exporting
restriction = restrict
exceptions
too_late = 1
repeated = 2
selopt_without_options = 5
selopt_without_signs = 6
invalid_sign = 7
empty_option_list = 9
invalid_kind = 10
repeated_kind_a = 11
others = 12.
endform.
Regards,
RIch Heilman
‎2007 May 31 2:32 PM
Hi Gregory ,
please see the documentation of the FM , it contains a sample program also for the same.
Regards
Arun