Ranges in Selection Screens

Hi
Can any body give the info regarding ranges in selection screens instead of selection-options.
I want to use multiple selections
Thanks & Regrads
venkat

Hi,
Here both SELECT-OPTIONS & RANGES works for the same purpose.  They both are used for the range selection from selection screen.  The main diff. between them is, while we use SELECT-OPTIONS system implicitly creates the select options internal table which contains the fields of SIGN,OPTION,LOW & HIGH.  But in case of RANGES, this internal table should be defined explicitly.
Eg. to SELECT-OPTIONS :
REPORT YARSELECT.
TABLES YTXLFA1.
SELECT-OPTIONS : VENDOR FOR YTXLFA1-LIFNR.
INITIALIZATION.
VENDOR-LOW    =   1000.               " It specifies the range starting value.
VENDOR-HIGH    =   2000.               " It specifies the range ending value.
VENDOR-OPTION  =  'BT'.                " specifies ranges value is in between.
VENDOR-SIGN      = 'I'.                     "specifies both inclussive.
APPEND VENDOR.
SELECT LIFNR LAND1 NAME1 FROM LFA1 INTO TABLE ITAB 
WHERE LIFNR IN VENDOR.
Eg. to RANGES:
REPORT YARRANGE.
TABLES YTXLFA1.
RANGES: VENDOR FOR YTXFLA1-LIFNR.
SELECT LIFNR LAND1 NAME1 FROM LFA1 INTO TABLE ITAB 
WHERE LIFNR IN VENDOR.
Here with RANGES  user has to design an internal table with fields - 
SIGN,OPTION,LOW and HIGH EXPLICITLY.
>
Example:
select-options: bukrs for zstock-bukrs.
Should the user fill in 'ABFI' in BUKRS on the selection screen, BUKRS will look like this:
IEQABFI
This is because BUKRS is set as a table as follows:
begin of bukrs occurs 0,
  SIGN(1)    type c,
  OPTION(2) type c,
  LOW         like bukrs,
  HIGH         like bukrs,
end of bukrs.
Now, when you create the following range, it will have the exact same fields set inside its table:
Ranges: bukrs for zstock-bukrs.
The difference is, because ranges doesn't show on the selection screen, you will have to fill it yourself, meaning you will have to fill bukrs-sign, bukrs-option, bukrs-low & bukrs-high all manually.
Some tips:
Sign is always I (for Include) or E (for Exclude)
Option can be a whole range, which includes:
EQ        (Equal) 
BT        (Between)) 
CP        (Contain Pattern)
So let's say you want to have the range check for all company codes not starting with AB, you will set your code as follow:
ranges: bukrs for zstock-bukrs.
bukrs-sign = 'E'.             "Exclude
bukrs-option = 'CP'.        "Pattern
bukrs-low = 'AB*'.            "Low Value
bukrs-high = ''.                "High Value
append bukrs.
Always remember to APPEND your range when you fill it, as the WHERE clause checks against the lines of the range table, not against the header line.
Hope this explains it well enough.
>
What does SIGN "I" & "E" mean?
The "I" stands for Include, and the "E" for Exclude.
The easiest way to learn how the range selections work is, create the following dummy program:
report dummy.
tables: mara.
select-options: matnr for mara-matnr.
start-of-selection.
loop at matnr.
write: / matnr-sign,
           matnr-option,
           matnr-low,
           matnr-high.
endloop.
Run this program, and fill in a lot of junk into MATNR. Fill in some includes, some excludes, some ranges, etc., and you will soon realise how the system builds ranges (select-options). Once you know that, you can fill your own ranges quickly and efficiently.
Regards,
Sruthi

Similar Messages

  • Define ranges in selection screen

    hi all
    does anybody know how to declare ranges on selection screen
    i have to declare it for matnr
    thanks for your help

    Moderator message - Please do not ask or answer basic questions - thread locked
    This is your third warning. There won't be a fourth.
    Rob
    Edited by: Rob Burbank on Sep 22, 2010 10:04 AM

  • Validation for the select option value range of selection screen

    Hi All.
    if i wish to validate the selection screen parameter for a value range(select options),is it possible?
    what should i write in code.Also,m using FM DD_DOMVALUES_GET to get the values for a specific domain name.
    Please reply.

    Hiii,
         Yes it is possible.... Can you give me the piece of code ... about the select option
    and also the value range against which you want to validate the select option.
    So that i can help you with the coding tips...
    Thanks in advance..

  • Setting default date range in selection screen when executing as batch job.

    Hi Guys,
    I have one report to be scheduled as weekly batch job and one of the selection screen field is date range. If i set this report to run today then the date range will be from one week back date(Lower value) to today date(Higher value). When it runs for next week(Already scheduled as weekly batch job) the date range should be like this
    Lower value = today date
    higher value= next week run date.
    How can i achieve this functionality. Is it possible through Dynamic variant concept?. Rest of the selection screen fields have some default values and should not change.
    <REMOVED BY MODERATOR>
    Thanks in advance,
    Vinod.
    Edited by: Alvaro Tejada Galindo on Feb 22, 2008 3:52 PM

    Hi Vinod,
    Would suggest you to this.
    Create two parameters : p_start_date and p_end_date of type sy-datum on your selection screen , instead of a range.
    Now goto create a variant from SE38 for the report.
    While creating the variant, mark the "Selection Variable" checkbox for the two parameters and click on "Selection Variables".
    Select the option "D: Dynamic date calculation" for both the date fields.
    For p_start_date - select the option "Current Date"
    For p_end_date  - select the option "Current date +/- ??? days" and put 7 in the pop up.
    Hence what you have done now is, set up a dynamic variant, where p_start_date will have sy-datum and p_end_date will have sy-datum + 7, everytime the job runs.
    Now, in the program, first step after START-OF-SELECTION code the following:
    RANGES: r_date FOR sy-datum.
    start-of-selection.
    refresh r_date.
    r_date-sign = 'I'. r_date-option = 'BT'.
    r_date-low = p_start_date. r_date-high = p_end_date.
    append r_date.
    Hence this way, you would have built your range and use it as needed.
    Cheers,
    Aditya

  • How to add ranges of selection screen

    hi experts.
    I have selection screen :
    eg. SELECT-OPTIONS :SPLGL FOR BSID-UMSKZ,
    ie. Special GL indicators. now if person enters A to Z in this  and 9 in single range on screen.
    I want to store A,B,C...Z  and 9 in an internal table. , what would be the  the easiest way for doing it ?
    Thanks in advance.
    PD

    Hello
    Try this code:
    select-options: splgl for bsid-umskz.
    data: abcde like sy-abcde,
    beg type i,
    end type i,
    div type i,
    counter type i.
    data: begin of itab occurs 0,
          splgl like bsid-umskz,
          end of itab.
    abcde = sy-abcde.
    loop at splgl.
      case splgl-option.
        when 'BT'.
          search abcde for splgl-low.
          if sy-subrc = 0.
            beg = sy-fdpos.
          endif.
          search abcde for splgl-high.
          if sy-subrc = 0.
            end = sy-fdpos.
          endif.
          div = end - beg + 1.
          counter = beg.
          do div times.
            itab-splgl = abcde+counter(1).
            append itab.
            counter = counter + 1.
          enddo.
        when 'EQ'.
          itab-splgl = splgl-low.
          append itab.
      endcase.
    endloop.
    In itab you will have all values from selection screen.

  • Define Ranges on Selection screen

    Hi All,
    I have a requirement to define company code as ranges on the selection screen, and then I have loop thru those company codes to get the plants. Any idea how I can define ranges and then use it in the program?
    Sample code will be really helpful.
    Thanks,
    David.

    Hi,
    selection-screen begin of block 1 with frame title text-100.
    select-options : s_ccode for t001-bukrs.
    selection-screen end of block 1.
    aRs

  • Date Range on Selection Screen not working

    Hi All,
    I have a selection screen with 3 selection options on there to run a report.
    1) Today
    2) Yesterday
    3) This week
    Now the first two are working fine but number 3 This Week isn't.  Any reason why? This week basically means Monday to Friday of this week. E.g. If I have This week Clicked on Monday it would just show Mondays result, if I run this report on Wednesday with This week clicked it should show Monday, Tuesday & Wednesday.
    Regards
    Adeel
    FORM posting_date .
      CLEAR : rg_finl.
      IF rb_1 = 'X'.
        rg_finl-sign      = 'I'.
        rg_finl-option    = 'EQ'.
        rg_finl-low       = sy-datum.
        APPEND rg_finl.
        CLEAR  rg_finl.
      ELSEIF rb_2 = 'X'.
        rg_finl-sign      = 'I'.
        rg_finl-option    = 'EQ'.
        rg_finl-low       = sy-datum - 1.
        APPEND rg_finl.
        CLEAR  rg_finl.
      ELSEIF rb_3 = 'X'.   
        rg_finl-sign      = 'I'.
        rg_finl-option    = 'BT'.
        rg_finl-low       = sy-datum.
        rg_finl-high      = sy-datum - 7.
        APPEND rg_finl.
        CLEAR  rg_finl.
      ELSEIF rb_4 = 'X'.
        rg_finl[] = s_budat[].
      ENDIF.
    ENDFORM.

    Hello
    You a wrong:
    Instead
    rg_finl-low = sy-datum.
    rg_finl-high = sy-datum - 7.
    you need:
    rg_finl-low = sy-datum - 7.
    rg_finl-high = sy-datum.

  • Error message for ranges in selection screen

    Hi
    i have this select option statement
    SELECT-OPTIONS: s_fevor FOR afko-fevor.
    i have written this code for error message display...
    AT SELECTION-SCREEN ON S_FEVOR.
    I_FEVOR-SIGN = 'I'.
    I_FEVOR-OPTION = 'EQ'.
    I_FEVOR-LOW = S_FEVOR.
    I_FEVOR-HIGH = S_FEVOR.
    IF not I_FEVOR-LOW EQ s_FEVOR .
    SELECT  FEVOR
         FROM AFKO
           INTO S_FEVOR
             WHERE FEVOR = S_FEVOR.
                UP TO 1 ROWS.
    ENDSELECT.
    IF SY-SUBRC NE 0.
    MESSAGE E000.
    ENDIF.
    ENDIF.
    if i enter the correct data then also it is giving error message
    how to solve this?
    Regards
    Smitha

    Hi,
    Refer this code:-
    SELECT-OPTIONS: s_fevor FOR afko-fevor.
    DATA : BEGIN OF t_fevor OCCURS 0,
             fevor TYPE afko-fevor,
           END OF t_fevor.
    AT SELECTION-SCREEN FOR s_fevor.
      s_fevor-sign = 'I'.
      s_fevor-option = 'EQ'.
      s_fevor-low = S_FEVOR.
      s_fevor-high = S_FEVOR.
      APPEND s_fevor.
      CLEAR s_fevor.
      IF NOT s_fevor-low IN s_fevor.
        SELECT fevor
              FROM afko
              INTO TABLE t_fevor
              WHERE fevor IN s_fevor.
        IF sy-subrc NE 0.
          MESSAGE e000.
        ENDIF.
      ENDIF
    Hope this helps you.
    Regards,
    Tarun

  • How to restrict field range in selection screen in adhoc report

    Hi Experts,
    I have created one adhoc report in which i have to restrict region values range when i searched for particular company code.is it possible to restrict in adhoc report.
    For example when i searched for particular company code US the values in region gets restricted automatically to US country itself.
    Thanks&Regards,
    narasimha.

    Hi,
    how to restrict  region list to particular company code in Adhoc report.Could you please explain it in brief .
    Regards,
    narasimha.

  • How to get default values on selection screen(multiple ranges)?

    i want to know how to maintain default ranges in selection screen...like 2000 to 3000 and 7000 to 8000 and 11000 to 15000
    all the above ranges must get by default how to provide those to selection screen by default...please give me idea...with example...

    Hi Suresh,
    You can either use select-options or Ranges. If you want the selection screen to be displayed with allwoing user to enter values apart for the default ones use select options else use ranges. With ranges what ever values use hard code would be set and the end user will not be able to add any more values (or range of values).
    Simply write the following code
    tables : <name of the table from which the field belongs>
    select-options <fieldname> for <tablename>-<fieldname>.
    <fieldname>-sign = 'I'.
    <fieldname>-option = 'BT'.
    <fieldname>-low = '7000'.
    <fieldname>-high = '8000'.
    append <fieldname>..
    similiarly add all the ranges that you need to include as default and in your select statement use the IN operator inthe where clause to include the range.
    If using range replacethe select-option with the range statement.
    Thanks.

  • HELP WITH SELECTION SCREENS

    Dear All,
        I am new to SAP(ABAP) have been given this assignment sort of ....plz help
    1.     Write a program to fetch all the sales orders and line items with in a data range.
      Selection screen fields: Sales Order Number
                                           Document type
                                           Sales order date.
      To display in the output report should contain following fields:
    1.     Sales Order number
    2.     item number
    3.     net price
    4.     net value
    5.     document type
    Use Tables :vbak and vbap.

    Hi,
    Try this out.
    REPORT yjjtest MESSAGE-ID zm.
    TABLES: vbap, vbak.
    DATA: BEGIN OF i_output OCCURS 0,
                 vbeln LIKE vbap-vbeln,
                 posnr LIKE vbap-posnr,
                 netwr LIKE vbap-netwr,
                 netpr LIKE vbap-netpr,
                 auart LIKE vbak-auart,
               END OF i_output.
    SELECTION-SCREEN BEGIN OF BLOCK blk1 WITH FRAME TITLE text-001.
    " text-001 as Selection
    SELECT-OPTIONS: s_vbeln  FOR vbap-vbeln,
                    s_auart  FOR vbak-auart ,
                    s_audat  FOR vbak-audat.
    SELECTION-SCREEN END OF BLOCK blk1.
    START-OF-SELECTION.
      SELECT a~vbeln
                    a~posnr
                    a~netwr
                    a~netpr
                    b~auart
                    INTO TABLE i_output
                    FROM vbap AS a
                    INNER JOIN vbak AS b
                    ON a~vbeln = b~vbeln
                    WHERE    a~vbeln IN s_vbeln
                    AND      b~auart IN s_auart
                    AND      b~audat IN s_audat.
      IF sy-subrc NE 0.
      MESSAGE e000 WITH text-002. " No data found for the selection criteria
      ENDIF.
      WRITE:/  'Program to fetch all the sales orders and line items'.
      ULINE.
      WRITE:/001 'Sales Order number',
             012 'Item Number',
             025 'Net Price',
             050 'Net Value',
             070 'Document Type'.
      ULINE.
      LOOP AT i_output.
        WRITE:/001 i_output-vbeln,
               012 i_output-posnr,
               025 i_output-netwr,
               050 i_output-netpr,
               070 i_output-auart.
        CLEAR i_output.
      ENDLOOP.
    Hope this solves ur query.
    Sample output
    TEST Program                                                                               
    Program to fetch all the sales orders and line items                                                                               
    Sales OrderItem Number  Net Price                Net Value           Document Type                                                                               
    10000000   000010                       0.00                0.00     ZNOR                  
    10000000   000020                       0.00                0.00     ZNOR                  
    10000006   000010                       0.00                0.00     ZNOR                  
    10000007   000060                       0.00                0.00     ZERO                  
    10000007   000020                       0.00                0.00     ZERO                  
    10000007   000050                       0.00                0.00     ZERO                  
    10000007   000040                       0.00                0.00     ZERO                  
    10000007   000030                       0.00                0.00     ZERO                  
    10000007   000010                       0.00                0.00     ZERO                  
    10000008   000010                  13,825.35            3,675.00     ZERO                  
    10000009   000010                       0.00                0.00     ZERO                  
    10000010   000010                  47,002.06            2,637.60     ZERO                  
    10000011   000010                       0.00                0.00     ZERO                  
    10000012   000010                  36,193.40            1,522.01     ZERO                  
    10000014   000010                       0.00                0.00     ZERO                  
    10000015   000050                       0.00                0.00     ZERO                  
    10000015   000010                       0.00                0.00     ZERO                  
    10000015   000020                       0.00                0.00     ZERO
    Please reward points and clos ethe thread.

  • How to restrict more than one 1 range in select option on selection screen.

    Hi all,
    I have a requirement where I need to restrict user from giving more than 1 range for a date selct option ..other all features of multiple selection will be as usual...
    for eg we can do this if we disable / hide other cells if the user clicks on multiple ranges tab.. If only 1 cell is available to give the range user will not be able to give more than 1 range....
    I was thinking if I could use select_options_restrict but how do i fill its parameters...
    Can anyone send me the sample code or the same to achieve this functionality...I have used select_options_restrict to hide multiple ranges itself  ... But here user will be able to give range but only 1....
    Thanks and Regards
    Sweta

    HI,
    Please try the below logic.
    SELECT-OPTIONS: so_addr   FOR    ADR6-SMTP_ADDR NO INTERVALS.
    ***********remove_range_for_select_option******************* .
      DATA: ls_restrict  TYPE  SSCR_RESTRICT,    "The type for SELECT_OPTIONS_RESTRICT
            ls_opt_list  TYPE  SSCR_OPT_LIST,    "One list of options
            ls_asn       TYPE  SSCR_***.         "One line of table associating selection screen
                                                                      "object with opt. list
      CLEAR: ls_restrict,
             ls_opt_list,
             ls_asn.
    *Only EQ valid, discrete values, Include & Exclude
      ls_opt_list-name       = 'EQ'.
      ls_opt_list-options-eq = 'X'.
      APPEND ls_opt_list TO ls_RESTRICT-OPT_LIST_TAB.
      LS_ASN-KIND            = 'S'.
      LS_ASN-NAME            = 'SO_ADDR'.            "Select Option
      LS_ASN-SG_MAIN         = 'I'.
      LS_ASN-SG_ADDY         = '*'.
      LS_ASN-OP_MAIN         = 'EQ'.
      LS_ASN-OP_ADDY         = ' '.
      APPEND LS_ASN TO LS_RESTRICT-***_TAB.
    *Make use of SELECT-OPTIONS easier on the selection screen
      CALL FUNCTION 'SELECT_OPTIONS_RESTRICT'
        EXPORTING
          RESTRICTION            = LS_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.
    Edited by: Rajasekhar Reddy P on Mar 16, 2009 2:03 PM

  • Hide the Range Option in Multiple Selection screen

    Hai,
    I Give the values In single Values In Selection Option Screen.
    I want to need Hide the Range Option Include or Exclude In Multiple selection screen.
    Regards,
    Geetha

    just check this it may help you
    <a href="https://www.sdn.sap.comhttp://www.sdn.sap.comhttp://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/840ad679-0601-0010-cd8e-9989fd650822">https://www.sdn.sap.comhttp://www.sdn.sap.comhttp://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/840ad679-0601-0010-cd8e-9989fd650822</a>
    here restricting the selection screen
    regards
    shiba dutta

  • How to disable the SELECT-OPTINS multiple selection screen's Ranges options

    Hi this is sekhar,
                      I have used the Select-options: statement with 'No-Interval' option. Now I need to restrict the user not to enter the values in the Ranges column of multiple selection screen. How can I do it....

    You can also refer this code as below : CHECK OUT SELECT OPTION sel_1_0.
    *& Report  ZTESTREP
    REPORT  ztestrep.
    Include type pool SSCR
    TYPE-POOLS sscr.
    Define the object to be passed to the RESTRICTION parameter
    DATA restrict TYPE sscr_restrict.
    Auxiliary objects for filling RESTRICT
    DATA opt_list TYPE sscr_opt_list.
    DATA ***      TYPE sscr_***.
    Define the selection screen objects
    First block: 3 SELECT-OPTIONS
    SELECTION-SCREEN BEGIN OF BLOCK block_0 WITH FRAME TITLE text-bl0.
    SELECT-OPTIONS sel_0_0 FOR sy-tvar0.
    SELECT-OPTIONS sel_0_1 FOR sy-tvar1.
    SELECT-OPTIONS sel_0_2 FOR sy-tvar2.
    SELECT-OPTIONS sel_0_3 FOR sy-tvar3.
    SELECTION-SCREEN END   OF BLOCK block_0.
    Second block: 2 SELECT-OPTIONS
    SELECTION-SCREEN BEGIN OF BLOCK block_1 WITH FRAME TITLE text-bl1.
    SELECT-OPTIONS sel_1_0 FOR sy-subrc.
    SELECT-OPTIONS sel_1_1 FOR sy-repid.
    SELECTION-SCREEN END   OF BLOCK block_1.
    INITIALIZATION.
    Define the option list
    ALL: All options allowed
      MOVE 'ALL'        TO opt_list-name.
      MOVE 'X' TO: opt_list-options-bt,
                   opt_list-options-cp,
                   opt_list-options-eq,
                   opt_list-options-ge,
                   opt_list-options-gt,
                   opt_list-options-le,
                   opt_list-options-lt,
                   opt_list-options-nb,
                   opt_list-options-ne,
                   opt_list-options-np.
      APPEND opt_list TO restrict-opt_list_tab.
    NOPATTERN: CP and NP not allowed
      CLEAR opt_list.
      MOVE 'NOPATTERN'  TO opt_list-name.
      MOVE 'X' TO: opt_list-options-bt,
                   opt_list-options-eq,
                   opt_list-options-ge,
                   opt_list-options-gt,
                   opt_list-options-le,
                   opt_list-options-lt,
                   opt_list-options-nb,
                   opt_list-options-ne.
      APPEND opt_list TO restrict-opt_list_tab.
    NOINTERVLS: BT and NB not allowed
      CLEAR opt_list.
      MOVE 'NOINTERVLS' TO opt_list-name.
      MOVE 'X' TO: opt_list-options-cp,
                   opt_list-options-eq,
                   opt_list-options-ge,
                   opt_list-options-gt,
                   opt_list-options-le,
                   opt_list-options-lt,
                   opt_list-options-ne,
                   opt_list-options-np.
      APPEND opt_list TO restrict-opt_list_tab.
    EQ_AND_CP: only EQ and CP allowed
      CLEAR opt_list.
      MOVE 'EQ_AND_CP'  TO opt_list-name.
      MOVE 'X' TO: opt_list-options-cp,
                   opt_list-options-eq.
      APPEND opt_list TO restrict-opt_list_tab.
    JUST_EQ: Only EQ allowed
      CLEAR opt_list.
      MOVE 'JUST_EQ' TO opt_list-name.
      MOVE 'X' TO opt_list-options-eq.
      APPEND opt_list TO restrict-opt_list_tab.
    Assign selection screen objects to option list and sign
    KIND = 'A': applies to all SELECT-OPTIONS
      MOVE: 'A'          TO ***-kind,
            '*'          TO ***-sg_main,
            'NOPATTERN'  TO ***-op_main,
            'NOINTERVLS' TO ***-op_addy.
      APPEND *** TO restrict-***_tab.
    KIND = 'B': applies to all SELECT-OPTIONS in block BLOCK_0,
                that is, SEL_0_0, SEL_0_1, SEL_0_2
      CLEAR ***.
      MOVE: 'B'          TO ***-kind,
            'BLOCK_0'    TO ***-name,
            'I'          TO ***-sg_main,
            '*'          TO ***-sg_addy,
            'NOINTERVLS' TO ***-op_main.
      APPEND *** TO restrict-***_tab.
    KIND = 'S': applies to SELECT-OPTION SEL-0-2
      CLEAR ***.
      MOVE: 'S'          TO ***-kind,
            'SEL_0_2'    TO ***-name,
            'I'          TO ***-sg_main,
            '*'          TO ***-sg_addy,
            'EQ_AND_CP'  TO ***-op_main,
            'ALL'        TO ***-op_addy.
      APPEND *** TO restrict-***_tab.
    KIND = 'S': Applies to SELECT-OPTION SEL_0_3
      CLEAR ***.
      MOVE: 'S'        TO ***-kind,
            'SEL_0_3'  TO ***-name,
            'I'        TO ***-sg_main,
            'N'        TO ***-sg_addy,
            'JUST_EQ'  TO ***-op_main.
      APPEND *** TO restrict-***_tab.
    Call function module
      CALL FUNCTION 'SELECT_OPTIONS_RESTRICT'
           EXPORTING
                 restriction                = restrict
              DB                          = ' '
           EXCEPTIONS
                 too_late                   = 1
                 repeated                   = 2
                 not_during_submit          = 3
                db_call_after_report_call  = 4
                selopt_without_options     = 5
                 selopt_without_signs       = 6
                 invalid_sign               = 7
                report_call_after_db_error = 8
                  empty_option_list          = 9
                 invalid_kind               = 10
                 repeated_kind_a            = 11
                 OTHERS                     = 12.

  • Hide the high value in selection screen range

    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

    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_***      TYPE sscr_***.
        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_***-kind = 'S'.
        wa_***-name = 'S_CONOCI'. "Replace with your select option name
        wa_***-sg_main = 'I'.
        wa_***-sg_addy = space.
        wa_***-op_main = 'OBJECTKEY1'.
        APPEND wa_*** TO wa_restrict-***_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

Maybe you are looking for