‎2007 Aug 07 9:00 PM
Hello.
I am using a select option, which i need to exclude the ranges and mulit-values option..
Ideally it should behave like a parameter.. but i can not change it to parameter
is there any FM for doin that ?
Regards,
Dhruv.
‎2007 Aug 07 9:03 PM
HI,
Use
Select-options : s_vbeln for vbak-vbeln no-extension no intervals.
Thanks
Mahesh
‎2007 Aug 07 9:04 PM
Hi,
Please try FM SELECT_OPTIONS_RESTRICT.
Check this link for sample codes.
http://www.saptechnical.com/Tips/ABAP/restrict.htm
Regards,
Ferry Lianto
‎2007 Aug 07 9:05 PM
‎2007 Aug 07 9:09 PM
I am building select options dynamically so cant use no extension no intervals statement,.
Ferry I will try to use your FM.. thanks
‎2007 Aug 07 9:37 PM
See the example below.
TABLES: t001.
SELECT-OPTIONS s_bukrs FOR t001-bukrs.
INITIALIZATION.
PERFORM remove_ranges_for_sel_options.
*&---------------------------------------------------------------------*
*& Form remove_ranges_for_sel_options
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
FORM remove_ranges_for_sel_options.
TYPE-POOLS sscr.
DATA: optlist TYPE sscr_opt_list,
restrict TYPE sscr_restrict,
ass TYPE sscr_ass.
*-- Allow EQ only
CLEAR optlist.
optlist-name = 'EQ_ONLY'.
optlist-options-eq = 'X'.
APPEND optlist TO restrict-opt_list_tab.
CLEAR ass.
ass-kind = 'S'.
ass-sg_main = 'I'.
ass-sg_addy = 'N'.
*-- Make S_BUKRS range to have only EQ
ass-name = 'S_BUKRS'.
ass-op_main = 'EQ_ONLY'.
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.
ENDFORM. " rem_ranges