Restrict select options

I am using a logical database in HR.I use the selection screen of the logical database but i want to restrict a select options for only permit introduce one value.
I restrict in abap to only use values ,nor intervals by example and other conditions.Now i have to restrict to only one value.
it must be work like a parameter

Hi,
U can use No-extension to restrict multiple selcet option button.
See this link
http://www.sapdevelopment.co.uk/reporting/selscr/selscr_restrictso.htm
*: Report:  ZRESTRICT_SELOPT                                           :
*: Author:  www.SAPdev.co.uk                                           :
*: Date  :  2004                                                       :
*: Description: Demonstrates how to restrict select options to only    :
*:              allow specific restriction options:                    :
*:                                     i.e.. EQ, NE, BT etc..          :
REPORT ZRESTRICT_SELOPT.
* Include type pool SSCR
TYPE-POOLS sscr.
TABLES: EKPO.
* Selection-screen
select-options : so_ebeln for ekpo-ebeln,
                 so_ebelp for ekpo-ebelp.
* Variables for populating restriction data
DATA: gd_restrict TYPE sscr_restrict.   "structure containing 2 tables
DATA: gd_optlist  TYPE sscr_opt_list,   "header line for table 1
      gd_***      TYPE sscr_***.        "header line for table 2
*INITIALIZATION.
INITIALIZATION.
* Restrict SO_EBELN to only except EQ, BT and NE.
  gd_optlist-name = 'KEY1'.      "Can be anything
  gd_optlist-options-eq = 'X'.
  gd_optlist-options-bt = 'X'.
  gd_optlist-options-ne = 'X'.
  APPEND gd_optlist TO gd_restrict-opt_list_tab.
  clear: gd_optlist.
  gd_***-kind = 'S'.
  gd_***-name = 'SO_EBELN'.
  gd_***-sg_main = 'I'.
  gd_***-sg_addy = SPACE.
  gd_***-op_main = 'KEY1'.       "Must be same as above
  APPEND gd_*** TO gd_restrict-***_tab.
  clear: gd_***.
* Restrict SO_EBELP to only except CP, GE, LT.
  gd_optlist-name = 'KEY2'.      "Can be anything
  gd_optlist-options-cp = 'X'.
  gd_optlist-options-ge = 'X'.
  gd_optlist-options-lt = 'X'.
  APPEND gd_optlist TO gd_restrict-opt_list_tab.
  clear: gd_optlist.
  gd_***-kind = 'S'.
  gd_***-name = 'SO_EBELP'.
  gd_***-sg_main = 'I'.
  gd_***-sg_addy = SPACE.
  gd_***-op_main = 'KEY2'.       "Must be same as above
  APPEND gd_*** TO gd_restrict-***_tab.
  clear: gd_***.
  CALL FUNCTION 'SELECT_OPTIONS_RESTRICT'
   EXPORTING
*    PROGRAM                      =
    restriction                  = gd_restrict
*    DB                           = ' '
   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.
Kindly reward points for the answer which helped u and close the thread if ur problem got solved.
Message was edited by: Judith Jessie Selvi

Similar Messages

  • Restrict Select-Options for Logical Database field

    The way we restrict select options for custom defined select option fields on selection screen.. can we restrict select options for standard Logical Database fields?
    i.e. report uses PNPCE logical database and has field called PERNR. I want to restrict select options for this PERNR field so that it has options for 'Select single values' only.
    Thanks,
    Falguni
    Edited by: Falguni V on Nov 13, 2010 6:42 AM

    You can user AT SELECTION-SCREEN event, and check whether any record is having high value for PNPPERNR.

  • Restricting Select Options to Multiple Single Entries

    Hi All,
           I have a requirement where we have two select options. I need to restrict only One of the select options to only accept multiple single entries. I have tried using the  'SELECT_OPTIONS_RESTRICT'  Function module. But it provided little help to me.
    Please check the below code.
    gv_w_opt_list-name = 'A'.
      gv_w_opt_list-options-eq = 'X'.
      APPEND gv_w_opt_list TO gv_w_res-opt_list_tab.
      gv_w_***-kind = 'A'. 
      gv_w_***-name = 'YTRADE_DESC'.
      gv_w_***-sg_main = '*'.
      gv_w_***-sg_addy = 'N'.
      gv_w_***-op_main = 'A'. 
      APPEND gv_w_*** TO gv_w_res-***_tab.
    It allows to restrict intervals for select-options in selection screen
        CALL FUNCTION 'SELECT_OPTIONS_RESTRICT'
          EXPORTING
            program                = sy-repid
            restriction            = gv_w_res
          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.
    Please help me if you have any information related to this requirement. Relevant anwers will be surely rewarded.
    Regards
    Nagaraj

    I have a code sample I use in a report. Result is only EQ and no intervals and no excludes
    LOAD-OF-PROGRAM.
        Subscreen: Select Options for delivery                                    *
      SELECTION-SCREEN BEGIN OF SCREEN 1100 AS SUBSCREEN
                                          NO INTERVALS.
      SELECT-OPTIONS:
      so_dlvno FOR /scwm/s_aspq_tu-docno
                                     MODIF ID dlv .
      SELECTION-SCREEN END OF SCREEN 1100.
        Subscreen: Select Options Restrictions                                  *
    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 t_opt_list TYPE sscr_opt_list.
      DATA ***      TYPE sscr_***.
      CLEAR ***.
      ***-kind    = 'S'.        "Apply only to the named SELECT-OPTION
      ***-name    = 'SO_DLVNO'.  "This is name of the SELECT-OPTION
      ***-sg_main = 'I'.        "I = ONLY Inclusions; * = Both
      ***-op_main = 'NOINTERVALS'. "This must match opt_list-name
      APPEND *** TO restrict-***_tab.
    Create t_opt_list entry to specify capabilities of S_BUKRS.
      CLEAR t_opt_list.
      t_opt_list-name       = 'NOINTERVALS'."This must match ***_tab-op_main
      t_opt_list-options-bt = space.     "Do not permit BETWEEN
      t_opt_list-options-cp = space.     "Do not permit MATCHES-PATTERN
      t_opt_list-options-eq = 'X'.       "       Permit EQUALS
      t_opt_list-options-ge = space.     "Do not permit GREATER-OR-EQUAL
      t_opt_list-options-gt = space.     "Do not permit GREATER-THAN
      t_opt_list-options-le = space.     "Do not permit LESS-OR-EQUAL
      t_opt_list-options-lt = space.     "Do not permit LESS-THAN
      t_opt_list-options-nb = space.     "Do not permit NOT-BETWEEN
      t_opt_list-options-ne = space.     "Do not permit NOT-EQUAL
      t_opt_list-options-np = space.     "Do not permit NO-PATTERN-MATCH
      APPEND t_opt_list TO restrict-opt_list_tab.
    Call function module
      CALL FUNCTION 'SELECT_OPTIONS_RESTRICT'
        EXPORTING
          restriction                = restrict
        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.
    Exception handling
      IF sy-subrc NE 0.
      ENDIF.
    Edited by: Suhel Awad on Feb 1, 2011 3:06 PM

  • Restricting select-options

    Hi,
    I came across this piece of code in ABAP FAQ. It is supposed to restrict the select-options so that the user can enter only specific options like only intervals or single values or patterns etc. But for some reason its not working for me. I am using SAP 4.7.
    Any pointers will be greatly appreciated.
    Restricting the selection screen
    REPORT ZDANY_RESTRICT_SELECTION.
    Include type pool SSCR
        TYPE-POOLS sscr.
        TABLES : sflight.
    defining the selection-screen
        select-options :
            s_carrid for sflight-carrid,
            s_connid for sflight-connid.
    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,
                        *** type sscr_***.
        INITIALIZATION.
    Restricting the carrid selection to only EQ and 'BT'.
        optlist-name = 'OBJECTKEY1'.
        optlist-options-eq = 'X'.
        optlist-options-bt = 'X'.
        APPEND optlist TO restrict-opt_list_tab.
        ***-kind = 'S'.
        ***-name = 'S_carrid'.
        ***-sg_main = 'I'.
        ***-sg_addy = space.
        ***-op_main = 'OBJECTKEY1'.
        APPEND *** TO restrict-***_tab.
    Restricting the connid 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.
        ***-kind = 'S'.
        ***-name = 'S_connid'.
        ***-sg_main = 'I'.
        ***-sg_addy = space.
        ***-op_main = 'OBJECTKEY2'.
        APPEND *** TO restrict-***_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,
    Sudeep

    Hi
    Olaf's solution should be OK. Always use uppercase for this kind of variable values. I guess you've already seen, but the FM has a documentation if you need more information on it.
    *--Serdar

  • How do I restrict Select-option values to those founn in a Z table?

    Hello friends,
    I would like to display and restrict values for a select-option to those found in a Z table. That is to say, the user is only able to choose those values found in the Z table and not otherwise.
    How to do this please?
    Thank you for your help.

    USE FM : SELECT_OPTIONS_RESTRICT
    report  zs_list_select_option.
    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,
               *** type sscr_***.
    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.
      ***-kind = 'S'.
      ***-name = 'S_MATNR'.
      ***-sg_main = 'I'.
      ***-sg_addy = space.
      ***-op_main = 'OBJECTKEY1'.
      append *** to restrict-***_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.
      ***-kind = 'S'.
      ***-name = 'S_WERKS'.
      ***-sg_main = 'I'.
      ***-sg_addy = space.
      ***-op_main = 'OBJECTKEY2'.
      append *** to restrict-***_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.
    Edited by: Srinivas Gurram Reddy on Mar 18, 2008 3:14 PM

  • Restricting selection-options

    I want to restrict the selection option of a field.
    There will be no intervals to enter.
    Only EQ will be available.
    Will allow multiple values but no intervals.
    when I enter somthing* and than proceed it displays a popup showing which criteria to select and there is only EQ value.
    In other circumstances it works as I  want. But I do not want the popup.
    Please help.
    I write the code below.
    TABLES:
      vbak.
    SELECT-OPTIONS:
      zvbeln FOR vbak-vbeln
        NO INTERVALS
        MATCHCODE OBJECT zpyp_posid
        OBLIGATORY
    INITIALIZATION.
      PERFORM init_1001.
    *&      Form  init_1001
          text
    FORM init_1001 .
      TYPE-POOLS:
         sscr.
      DATA:
        restriction TYPE sscr_restrict,
        wa_opt_list TYPE sscr_opt_list,
        ls_***     TYPE sscr_***.
      MOVE 'EQ'      TO wa_opt_list-name.
      MOVE 'X'       TO wa_opt_list-options-eq.
      APPEND wa_opt_list TO restriction-opt_list_tab.
      MOVE: 'S'          TO ls_***-kind,
            'I'          TO ls_***-sg_main,
            ' '          TO ls_***-sg_addy,
            'EQ'         TO ls_***-op_main,
            'EQ'         TO ls_***-op_addy,
            'ZVBELN'     TO ls_***-name.
      APPEND ls_***      TO restriction-***_tab.
      CALL FUNCTION 'SELECT_OPTIONS_RESTRICT'
        EXPORTING
      PROGRAM                      =
          restriction                  = restriction
      DB                           = ' '
       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.
    ENDFORM.

    Hi Fuat ,
    i don't understand ?!
    in my example report comes <b>no addtitional popup</b>:
    here's the complete test-report:
    REPORT z6.
    TABLES:
    vbak, bkpf.
    SELECT-OPTIONS:
    zvbeln FOR vbak-vbeln OBLIGATORY DEFAULT '5300000000'.
    INITIALIZATION.
      PERFORM init_1001.
    START-OF-SELECTION.
      SELECT belnr FROM  bkpf INTO bkpf-belnr
             WHERE  bukrs  = '0001'
             AND    belnr  IN zvbeln
             AND    gjahr  = sy-datum(4).
        WRITE: / bkpf-belnr.
      ENDSELECT.
      IF sy-subrc <> 0.
        WRITE: / 'no entry found!'.
      ENDIF.
    *& Form init_1001
    FORM init_1001 .
      TYPE-POOLS:
      sscr.
      DATA:
      restriction TYPE sscr_restrict,
      wa_opt_list TYPE sscr_opt_list,
      ls_*** TYPE sscr_***.
      MOVE 'EQ' TO wa_opt_list-name.
      MOVE 'X' TO wa_opt_list-options-eq.
      APPEND wa_opt_list TO restriction-opt_list_tab.
      MOVE: 'S' TO ls_***-kind,
       'I' TO ls_***-sg_main,
      'EQ' TO ls_***-op_main,
      'ZVBELN' TO ls_***-name.
      APPEND ls_*** TO restriction-***_tab.
      CALL FUNCTION 'SELECT_OPTIONS_RESTRICT'
           EXPORTING
                restriction = restriction.
    ENDFORM.
    regards Andreas

  • Restrict select option with few values by default

    I have few values with which i have to restrict in a select option by default.
    I have done in initialisation as below.
      s_ktokd-sign   = 'I'.
      s_ktokd-option = 'NE'.
      s_ktokd-low    = '0012'.
      append s_ktokd to s_ktokd.
      clear s_ktokd.
    Is there any other way?
    Thanks
    Kiran

    yeah you can do that in initalization.
    >   s_ktokd-sign   = 'I'.
    >   s_ktokd-option = 'NE'.
    >   s_ktokd-low    = '0012'.
    >   append s_ktokd to s_ktokd.
    >   clear s_ktokd.
    small correction to your code, corrected code...
    s_ktokd-sign   = 'E'.
       s_ktokd-option = 'EQ'.
       s_ktokd-low    = '0012'.
       append s_ktokd to s_ktokd.
      clear s_ktokd.

  • Restrictions in select-options

    Hi,
    How to remove the diffrent tabs in the extention of a select-option? Foe example I want to remove 'exclude single values' and 'exclude range' from the extention of select-options.
    Thanks in advance
    Jaison Joseph

    Hi
    Please check the following link which has many examples from our friends in the forum.
    Re: Restricting Select-options
    And one small example from me:
    TABLES: VBAK.
    TYPE-POOLS: SSCR.
    *               S E L E C T I O N    S C R E E N                       *
    SELECTION-SCREEN BEGIN OF BLOCK BLK3 WITH FRAME NO INTERVALS.
    SELECTION-SCREEN BEGIN OF BLOCK BLK0 WITH FRAME TITLE TEXT-000 NO
    INTERVALS.
      SELECTION-SCREEN BEGIN OF LINE.
        PARAMETERS: P_ARC RADIOBUTTON GROUP RAD0 DEFAULT 'X'
                          USER-COMMAND ABC.
        SELECTION-SCREEN  COMMENT (20) TEXT-003 FOR FIELD P_ARC.
        SELECTION-SCREEN  POSITION 33.
        PARAMETERS: P_DIS RADIOBUTTON GROUP RAD0.
        SELECTION-SCREEN  COMMENT (20) TEXT-004 FOR FIELD P_DIS.
      SELECTION-SCREEN END OF LINE.
    SELECTION-SCREEN END OF BLOCK BLK0.
    SELECTION-SCREEN BEGIN OF BLOCK BLK1 WITH FRAME TITLE TEXT-001 NO
    INTERVALS.
      PARAMETERS: P_VKORG LIKE VBAK-VKORG OBLIGATORY.
      SELECT-OPTIONS: S_VBELN FOR VBAK-VBELN OBLIGATORY NO INTERVALS.
    SELECTION-SCREEN END OF BLOCK BLK1.
    SELECTION-SCREEN BEGIN OF BLOCK BLK2 WITH FRAME TITLE TEXT-002 NO
    INTERVALS.
      PARAMETERS: P_SO   RADIOBUTTON GROUP RAD1 DEFAULT 'X' MODIF ID ABC,
                  P_PO   RADIOBUTTON GROUP RAD1 MODIF ID ABC,
                  P_SOPO RADIOBUTTON GROUP RAD1 MODIF ID ABC.
    SELECTION-SCREEN END OF BLOCK BLK2.
    SELECTION-SCREEN END OF BLOCK BLK3.
    *         A T     S E L E C T I O N - S C R E E N     OUTPUT           *
    AT SELECTION-SCREEN OUTPUT.
       LOOP AT SCREEN.
          IF SCREEN-GROUP1 = 'ABC' OR SCREEN-NAME = '%B002014_BLOCK_1000'.
             CASE 'X'.
             WHEN P_ARC.
               SCREEN-ACTIVE = 1.
             WHEN P_DIS.
               SCREEN-ACTIVE = 0.
             ENDCASE.
             MODIFY SCREEN.
          ENDIF.
       ENDLOOP.
    *                   I N I T I A L I Z A T I O N                        *
    INITIALIZATION.
    DATA: RES TYPE SSCR_RESTRICT.
    DATA OPT_LIST TYPE SSCR_OPT_LIST.
    DATA ***      TYPE SSCR_***.
    MOVE: 'OPT1' TO OPT_LIST-NAME,
          'X'    TO OPT_LIST-OPTIONS-EQ.
    APPEND OPT_LIST TO RES-OPT_LIST_TAB.
    MOVE: 'S' TO ***-KIND,
          'S_VBELN' TO ***-NAME,
          'I' TO ***-SG_MAIN,
          ' ' TO ***-SG_ADDY,
          'OPT1' TO ***-OP_MAIN.
    APPEND *** TO RES-***_TAB.
       CALL FUNCTION 'RS_INT_SELOPT_RESTRICT'
         EXPORTING
           PROGRAM                      = SY-REPID
           RESTRICTION                  = RES
        EXCEPTIONS
          SELOPT_WITHOUT_OPTIONS       = 1
          SELOPT_WITHOUT_SIGNS         = 2
          INVALID_SIGN                 = 3
          EMPTY_OPTION_LIST            = 4
          INVALID_KIND                 = 5
          REPEATED_KIND_A              = 6
          OTHERS                       = 7.
       IF SY-SUBRC <> 0.
       ENDIF.
    *                S T A R T - O F - S E L E C T I O N                   *
    Regards
    Eswar
    Message was edited by:
            Eswar Rao  Boddeti
    Just checked that the thread is already answered, am slow... NVM, it had resolved your query:)

  • Is exist restriction for select-options.........?

    is exist restriction for select-options?
    for example:
    <b> data: ftxt04(4).
    select-options: txt04 for ftxt04.</b>

    Hi,
    You can restrict select-options.
    SELECT-OPTIONS : S_VKORG FOR TVKO-VKORG MEMORY ID VKO.
    Form F1000_RESTRICT_VKORG.
    INITIALIZATION.
    PERFORM F1000_RESTRICT_VKORG.
    Define the object to be passed to the RESTRICTION parameter
    DATA lw_restrict TYPE SSCR_RESTRICT.
    Auxiliary objects for filling RESTRICT
      DATA lw_opt_list TYPE sscr_opt_list.
      DATA lw_***      TYPE sscr_***.
    Assign selection screen objects to option list and sign
    NOINTERVLS: BT and NB not allowed
      CLEAR lw_opt_list.
      MOVE 'NOINTERVLS' TO lw_opt_list-name.
      MOVE 'X' TO: lw_opt_list-options-cp,
                   lw_opt_list-options-eq,
                   lw_opt_list-options-ge,
                   lw_opt_list-options-gt,
                   lw_opt_list-options-le,
                   lw_opt_list-options-lt,
                   lw_opt_list-options-ne,
                   lw_opt_list-options-np.
      APPEND lw_opt_list TO lw_restrict-opt_list_tab.
    KIND = 'S':
      CLEAR lw_***.
      MOVE:  'S'          TO  lw_***-kind,
             'S_VKORG'    TO  lw_***-name,
             'I'          TO  lw_***-sg_main,
             '*'          TO  lw_***-sg_addy,
             'NOINTERVLS' TO  lw_***-op_main.
      APPEND lw_***  TO  lw_restrict-***_tab.
      CALL FUNCTION 'SELECT_OPTIONS_RESTRICT'
           EXPORTING
                restriction            = lw_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.     "Restriction error encountered for Select
                             "Option
        MESSAGE  I001 WITH 'ERROR IN SELECT OPTION'."ERROR IN SELECT OPTION
      ENDIF.
    endform.                    " F1000_RESTRICT_VKORG

  • How to prevent the use of wild cards in select-option

    Hello experts,
    Is it possible to prevent the use of wild cards in a select-option? If yes, how is it done please?
    I have a
    SELECT-OPTIONS: o_comp  FOR dbtab-field OBLIGATORY DEFAULT 'FI'.
    and, I want to prevent the users for giving in some thing like FI* with the wildcard bc it would lead to dump.
    I want an error message to display and prevent the users for making such entry.
    Please I need your help and I would be very grateful.
    Thanks
    Nadin

    You have to use SELECT_OPTIONS_RESTRICT to restrict input allowed. Call this FM in INITIALIZATION or SELECTION-SCREEN OUPUT sections.
    Sample :
    TYPE-POOLS: sscr.
    INITIALIZATION.
    * Restrict SELECT-OPTIONS
      PERFORM restrict_select.
    FORM restrict_select.
      DATA: restrict TYPE sscr_restrict,
            opt_list TYPE sscr_opt_list,
            *** TYPE sscr_***.
    * Défine select-options modes (aka option list)
    * - ALL standard - all options allowed
      CLEAR opt_list.
      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.
    * - EQU only equality allowed (list of values)
      CLEAR opt_list.
      MOVE 'EQU' TO opt_list-name.
      MOVE 'X' TO opt_list-options-eq.
      APPEND opt_list TO restrict-opt_list_tab.
    * Affect modes to parameters or block of parameters
    * ALL by default
      CLEAR ***.
      MOVE: 'A'          TO ***-kind,
            '*'          TO ***-sg_main,
            'ALL'        TO ***-op_main.
      APPEND *** TO restrict-***_tab.
    * EQU to internal material number
      CLEAR ***.
      MOVE: 'S'          TO ***-kind,
            'S-MATNR'    TO ***-name,
            'I'          TO ***-sg_main, " no exclusion
            'EQU'        TO ***-op_main. " only value list
      APPEND *** TO restrict-***_tab.
    * Call  FM
      CALL FUNCTION 'SELECT_OPTIONS_RESTRICT'
           EXPORTING
                restriction = restrict
           EXCEPTIONS
                OTHERS      = 1.
    ENDFORM.                    " restrict_select
    In the sample, only select-options for matnr is restricted to single value list.
    For your request build a mode with all options except "pattern" ones : CP and NP.
    Regards

  • Regarding selection options

    whan i am using select-options prior to this i what to display check  box on the same line.
              when i am selecting the this check box it should execute automaticall
    could u plz explain the code clearly with example.

    search forums.
    Re: Dynamic Selection Options
    Posted on: Jul 17, 2006 5:50 PM, by user: Praveen -- Relevance: 100% -- Show all results within this thread
    am doing exactly as you had stated. But the user wants to see it something like this: 1. For the selection options, he wants to see three box's. a. Technical Name of the field selection. b. ...
    Re: regarding selection options
    Posted on: Mar 15, 2007 8:46 AM, by user: SHIBA DUTTA -- Relevance: 99% -- Show all results within this thread
    you have to use begin of line and end of line. SELECTION-SCREEN BEGIN OF LINE. SELECTION-SCREEN COMMENT 1(10) TEXT-001 FOR FIELD P1. PARAMETERS: ...
    Re: Restricting selection-options
    Posted on: Jan 18, 2005 8:58 AM, by user: Andreas Mann -- Relevance: 90% -- Show all results within this thread
    FOR vbak-vbeln OBLIGATORY DEFAULT '5300000000'. INITIALIZATION. PERFORM init_1001. START-OF-SELECTION. SELECT belnr FROM bkpf INTO bkpf-belnr WHERE bukrs = '0001' AND ...
    Check that at least on Selection Options are filled
    Posted on: May 25, 2006 4:37 AM, by user: Boater -- Relevance: 90% -- Show all results within this thread
    I have a program that has four selection options. The user needs to enter a selection for at least one of the four selection options. ...
    possible entry for selection-options
    Posted on: Feb 22, 2007 7:32 AM, by user: Tiwa Noitawee -- Relevance: 89% -- Show all results within this thread
    F-1 At last 3 alphabets of Prod.hierarchy is Product line (EX1, PC5) that users have to choose via selection-options like this <b>EX1</b> EXCEL 251 : F-1 <b>PC5</b> POWERTOP W-200 ...
    select-options multiple selection
    Posted on: Mar 5, 2007 3:06 AM, by user: venkateswarao gangavarapu -- Relevance: 87% -- Show all results within this thread
    hi can u send code for getting multiple selections in select-options Thanks in advance venkat ...
    Submitting Report with selection screen options
    Posted on: Apr 27, 2005 5:45 PM, by user: Rajesh Nittala -- Relevance: 85% -- Show all results within this thread
    Hi all, I have a situation, in my report i am using a selection screen which contains input select-options are store(range), date (from ..to)....after that ...
    sample program to remove standard selection-options & replace user defined.
    Posted on: Dec 7, 2005 5:37 AM, by user: Josephine Clara Arokiasamy -- Relevance: 83% -- Show all results within this thread
    The standard selection-options are provided for the logical database. i need to supress the standard selection-options ...
    Adding default value for a select-options in a selection-screen
    Posted on: May 26, 2006 11:51 AM, by user: sid alpay -- Relevance: 77% -- Show all results within this thread
    hello gurus, i have a report program with the following select-options in a selection-screen block:
    select-options: so_site for MyTable-werks.
    i want the so_site ...
    Adding Selection Options Fields in Report(Using Query)
    Posted on: Aug 25, 2004 5:26 AM, by user: lijo joseph -- Relevance: 76% -- Show all results within this thread
    Hi, how can we add Selection Fields Options in Query Reports Which we create using SQ01. I need a default option by which ...
    Getting the selection parameters/options in a diffrent program
    Posted on: May 11, 2006 3:05 AM, by user: Chad Cheng -- Relevance: 75% -- Show all results within this thread
    use Submit to get a report from a diffrent program and I am using variants to get the value of the selection criteria. However, for a less tedious approach, I think it would be better if I get the selection ...
    Read options from selection-screen
    Posted on: Aug 24, 2006 3:30 PM, by user: Silke Eng -- Relevance: 75% -- Show all results within this thread
    Hi Kiran, as all other questions are answered already, remains the one on the select-options. Function module <b>RS_REFRESH_FROM_SELECTOPTIONS</b> returns those. Kind regards, Silke ...
    Selection screen for SAP Query: OR between options
    Posted on: Jun 29, 2006 3:04 PM, by user: Tania Pouli -- Relevance: 74% -- Show all results within this thread
    need a variant where either of two fields should not be 0. Is there some way to add an OR between two selection options? I can't change the actual query because it's used with many other variants. Thanks ...
    Pass internal table of selection-options through method!
    Posted on: Nov 22, 2004 3:49 PM, by user: Frank Roels -- Relevance: 74% -- Show all results within this thread
    I created a selection screen with multiple select-options. Now I want in a method of a class work with the internal ...
    select-options: at selection-screen on value-request
    Posted on: Sep 18, 2006 10:51 PM, by user: Sumit Agarwal -- Relevance: 72% -- Show all results within this thread
    one field is dependent on the values of the other field in the select-options. I am using the "at selection-screen on value-request event on" to populate the select-options field, S_AUFNR, that is dependent ...
    Pages: 16 [ 1 2 3 4 5 6 7 8 9 10 |

  • Limitation in SELECT-OPTIONS - how?

    Hi,
    I need to limit my select-options in a way - do not allow the user to enter any ranges, but to allow him/her to enter multiple single values. 'NO INTERVALS' addition doesn't help me here.
    Further, I need to restrict him/her to use only 'EQ' option in the select-options and do not use wild cards.
    How can I achieve this? Is the only way to loop at select_table and to check all the params, or there is another more elegant way?
    Any hints are wellcome.
    Many thanks in advance.
    Ivaylo Mutafchiev

    Hi,
    Check this program too
    *: Report:  ZRESTRICT_SELOPT                                           :
    *: Author:  www.SAPdev.co.uk                                           :
    *: Date  :  2004                                                       :
    *: Description: Demonstrates how to restrict select options to only    :
    *:              allow specific restriction options:                    :
    *:                                     i.e.. EQ, NE, BT etc..          :
    REPORT ZRESTRICT_SELOPT.
    Include type pool SSCR
    TYPE-POOLS sscr.
    TABLES: EKPO.
    Selection-screen
    select-options : so_ebeln for ekpo-ebeln,
                     so_ebelp for ekpo-ebelp.
    Variables for populating restriction data
    DATA: gd_restrict TYPE sscr_restrict.   "structure containing 2 tables
    DATA: gd_optlist  TYPE sscr_opt_list,   "header line for table 1
          gd_***      TYPE sscr_***.        "header line for table 2
    *INITIALIZATION.
    INITIALIZATION.
    Restrict SO_EBELN to only except EQ, BT and NE.
      gd_optlist-name = 'KEY1'.      "Can be anything
      gd_optlist-options-eq = 'X'.
      gd_optlist-options-bt = 'X'.
      gd_optlist-options-ne = 'X'.
      APPEND gd_optlist TO gd_restrict-opt_list_tab.
      clear: gd_optlist.
      gd_***-kind = 'S'.
      gd_***-name = 'SO_EBELN'.
      gd_***-sg_main = 'I'.
      gd_***-sg_addy = SPACE.
      gd_***-op_main = 'KEY1'.       "Must be same as above
      APPEND gd_*** TO gd_restrict-***_tab.
      clear: gd_***.
    Restrict SO_EBELP to only except CP, GE, LT.
      gd_optlist-name = 'KEY2'.      "Can be anything
      gd_optlist-options-cp = 'X'.
      gd_optlist-options-ge = 'X'.
      gd_optlist-options-lt = 'X'.
      APPEND gd_optlist TO gd_restrict-opt_list_tab.
      clear: gd_optlist.
      gd_***-kind = 'S'.
      gd_***-name = 'SO_EBELP'.
      gd_***-sg_main = 'I'.
      gd_***-sg_addy = SPACE.
      gd_***-op_main = 'KEY2'.       "Must be same as above
      APPEND gd_*** TO gd_restrict-***_tab.
      clear: gd_***.
      CALL FUNCTION 'SELECT_OPTIONS_RESTRICT'
       EXPORTING
       PROGRAM                      =
        restriction                  = gd_restrict
       DB                           = ' '
       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.
    Got it from this link
    http://www.sapdevelopment.co.uk/reporting/selscr/selscr_restrictso.htm
    Thanks & Regards,
    Judith.

  • Splitting Select Options

    Hi All,
    I am facing a problem in splitting the Select options for my screen. What I have to do is I am expecting the User to enter around 5000 records in the Select Options. I have to use 2000 records at a time for processing, which means three set of records of 2000, 2000 and 500.
    Can you please tell me how can this be achieved??

    Are you sure that even reducing the SELECT-OPTION to package of 2000 will be enough, in some database the system will raise an error related to a too large SQL statement.
    Splitting an internal table (as SELECT-OPTIONS are) is very easy. (see bellow)
    But be aware that some records may be exclusions, like :
    - SIGN = 'E' and OPTION is one of the positive operator like EQ, BT or CP
    - SIGN = 'I' and OPTION is one of the negative operator (every operator except the three previous)
    Those records must be in every package of selection
    so loop at select-options
    - put the exclusion in a first internal table
    loop once again at select-options excluding the records of the previous loop
    - append to a temporary internal table
    - when number of record equal maximal number allowed for a SQL SELECT minus the number of record in the first internal table, execute the SELECT, clear the temporary internal table
    To bypass this problem
    - don't use those record to build the partial select-options but delete records after select from database
    - You could(should) consider restricting select-options allowed options ([SELECT_OPTIONS_RESTRICT|http://wiki.sdn.sap.com/wiki/display/Snippets/RestrictSelectOptions]) so you wont have to execute this and only have to split an internal table with statement like [APPEND|http://help.sap.com/abapdocu_70/en/ABAPAPPEND.htm] [LINES OF jtab [FROM idx1] [TO idx2] |http://help.sap.com/abapdocu_70/en/ABAPAPPEND_LINESPEC.htm#&ABAP_ALTERNATIVE_3@3@]
    Regards,
    Raymond

  • 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

  • Is there any restriction on no of entries in Select-option-low ?

    Is there any restriction on no of entries in Select-option-low ? I have a select option which has 22 thousand entries and the select query is thrwoing a dump.
    Any inputs ?
    Regards,
    Ankur Bhandari

    Hi Ankur,
    1. i had faced same problem.
    2. Virtually the limit in SELECT-OPTION low
       is not the problem.
    3. The problem is with SQL query and database limit.
    4. The R/3 system generates final database query
       in the form of (for select option)
       FIELD IN ('ABC','DEF','XYZ',........'')
    5. Now Oracle/SqlServer
       has limit of THESE IN VALUES.
       limit is something in 2500 approx.
    6. So your approach will not work
      using IN.
       It will always give error when
       entries are more.
    7. SOLUTION which i did.
       1. First select all appropriate records from
          master table in your itab
         (without using IN select option clause)
      2. After that use this concept.
         Loop at ITAB.
         If Itab-Field in SelectOption.
         Else.
         DELETE ITAB.
         ENDIF.
    The above will take care for any number of records. 
    I hope it helps.
    regards,
    amit m.
    Message was edited by: Amit Mittal
    Message was edited by: Amit Mittal

Maybe you are looking for