‎2006 Dec 26 10:41 AM
hi,
if i want to restric selection screen with select-option and i should not use < or > options ,what is the technique plz explian me?
‎2006 Dec 26 10:43 AM
SELECT-OPTIONS : s_enterp FOR v_enterpr NO INTERVALS ,
1)If you want your SELECT -OPTIONS to behave like parameters. USe the option.
SELECT-OPTIONS ..... NO INTERVALS NO-EXTENSION
‎2006 Dec 26 4:55 PM
or you can use FM 'SELECT_OPTIONS_RESTRICT' to restrict select-options in your "initialization" event... it may be useful if you need to have different restricitons for different users for example.
‎2006 Dec 26 5:10 PM
Hi,
Check this example..for material..IT will allow only EQ option.
TYPE-POOLS: sscr.
TABLES: mara.
SELECT-OPTIONS: so_matnr FOR mara-matnr.
INITIALIZATION.
DATA: gt_restrict TYPE sscr_restrict.
DATA: lwa_optlist TYPE sscr_opt_list,
lwa_ass TYPE sscr_ass.
Restricting the selection to only EQ.
lwa_optlist-name = 'OBJECTKEY1'.
lwa_optlist-options-eq = 'X'.
APPEND lwa_optlist TO gt_restrict-opt_list_tab.
Assign the kind and the name.
lwa_ass-kind = 'S'.
lwa_ass-name = 'SO_MATNR'.
lwa_ass-sg_main = 'I'.
lwa_ass-sg_addy = space.
lwa_ass-op_main = 'OBJECTKEY1'.
APPEND lwa_ass TO gt_restrict-ass_tab.
Call the function module to restrict the select-options
CALL FUNCTION 'SELECT_OPTIONS_RESTRICT'
EXPORTING
restriction = gt_restrict
EXCEPTIONS
too_late = 1
repeated = 2
selopt_without_options = 3
selopt_without_signs = 4
invalid_sign = 5
empty_option_list = 6
invalid_kind = 7
repeated_kind_a = 8
OTHERS = 9.
Thanks,
Naren
‎2006 Dec 26 5:22 PM
Hi,
Have a look at this code
REPORT selectoptionsrestrict.
* Author : Lakshmi Sunitha
* Date : February 19, 2003
* Include type pool SSCR
TYPE-POOLS sscr.
TABLES :
marc.
* defining the selection-screen
select-options :
s_matnr for marc-matnr,
s_werks for marc-werks.
* Define the object to be passed to the RESTRICTION parameter
DATA restrict TYPE sscr_restrict.
* Auxiliary objects for filling RESTRICT
DATA : optlist TYPE sscr_opt_list,
ass type sscr_ass.
INITIALIZATION.
* Restricting the MATNR selection to only EQ and 'BT'.
optlist-name = 'OBJECTKEY1'.
optlist-options-eq = 'X'.
optlist-options-bt = 'X'.
APPEND optlist TO restrict-opt_list_tab.
ass-kind = 'S'.
ass-name = 'S_MATNR'.
ass-sg_main = 'I'.
ass-sg_addy = space.
ass-op_main = 'OBJECTKEY1'.
APPEND ass TO restrict-ass_tab.
* Restricting the WERKS selection to CP, GE, LT, NE.
optlist-name = 'OBJECTKEY2'.
optlist-options-cp = 'X'.
optlist-options-ge = 'X'.
optlist-options-lt = 'X'.
optlist-options-ne = 'X'.
APPEND optlist TO restrict-opt_list_tab.
ass-kind = 'S'.
ass-name = 'S_WERKS'.
ass-sg_main = 'I'.
ass-sg_addy = space.
ass-op_main = 'OBJECTKEY2'.
APPEND ass TO restrict-ass_tab.
CALL FUNCTION 'SELECT_OPTIONS_RESTRICT'
EXPORTING
restriction = restrict
EXCEPTIONS
TOO_LATE = 1
REPEATED = 2
SELOPT_WITHOUT_OPTIONS = 3
SELOPT_WITHOUT_SIGNS = 4
INVALID_SIGN = 5
EMPTY_OPTION_LIST = 6
INVALID_KIND = 7
REPEATED_KIND_A = 8
OTHERS = 9
.
IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.Regards
Sudheer