09-04-2008 4:48 PM
In the selection screen of an ABAP Program, I need to use a field where I have to restrict the users from entering a range of values, but still need to enter a list of values. I tried using 'no intervals' in the select-options, but still it lets me enter range. How can I accomplish this?
Thanks
09-04-2008 4:58 PM
Ok Lets do one thing validate the selection-screen that iof user inputs this and press execute then Trrigger Error message!!
Regards
Sas
09-04-2008 4:54 PM
09-04-2008 4:56 PM
SELECT-OPTIONS s_carrid FOR spfli_wa-carrid NO INTERVALS.
It will not allow you to give range of values this is for sure.
If you want to give more values your code shouls NOT contain
NO-EXTENSION .
Pls check .
If you still have the problem why dont you paste your code.
09-04-2008 4:57 PM
You need to use the function module SELECT_OPTIONS_RESTRICT additionally to the simpler NO INTERVALS addition for this.
That way, besides of restricting the "TO" input field from appearing, you also restrict the tabs in the extension screen (yellow arrow button).
Check this code and adapt to yours:
DATA:
wa_restrict TYPE sscr_restrict,
wa_opt_list TYPE sscr_opt_list,
wa_ass TYPE sscr_ass.
wa_opt_list-name = 'OBJECTKEY1'.
wa_opt_list-options-eq = 'X'. "Enabling only single inclusion lists
APPEND wa_opt_list TO wa_restrict-opt_list_tab.
wa_ass-kind = 'S'.
wa_ass-name = 'S_CONOCI'. "Replace with your select option name
wa_ass-sg_main = 'I'.
wa_ass-sg_addy = space.
wa_ass-op_main = 'OBJECTKEY1'.
APPEND wa_ass TO wa_restrict-ass_tab.
CALL FUNCTION 'SELECT_OPTIONS_RESTRICT'
EXPORTING
restriction = wa_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 e013.
ENDIF.
Hope this helps.
Regards
Edited by: Alejandro Bindi on Sep 4, 2008 12:57 PM
09-04-2008 4:58 PM
Ok Lets do one thing validate the selection-screen that iof user inputs this and press execute then Trrigger Error message!!
Regards
Sas