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.

Similar Messages

  • SELECT-OPTIONS - How to get the output other than of the mentioned range

    Hi Friends,
    I need the output in my ABAP Query to display entries out of the date range that I enter in the selection screen.
    Supose I enter Date: 1st Jan 09 to 15th Apr 09, I should get an output out of this range.
    How do I do that with select options ? what do I give in the date-option and date-sign, etc., ?
    Please help.
    Thanks,
    Dikshitha

    Hi,
    USe the following piece of code
    TYPE-POOLS : SCCR.
    DATA : g_optlist TYPE sscr_opt_list,
           g_*** TYPE sscr_***.
    INITIALIZATION.
      CLEAR g_***.
      g_***-kind    = 'S'.
      g_***-name    = 'S_USER'. "select-option field
      g_***-sg_main = 'I'. " this u can change to exclude ur values accordingly
      g_***-op_main = 'TEXT'.
      APPEND g_*** TO g_t_restrict-***_tab.
      g_optlist-name = 'TEXT'.
      g_optlist-options-ne = 'X'.
      g_optlist-options-eq = 'X'.
      APPEND g_optlist TO g_t_restrict-opt_list_tab.
      CALL FUNCTION 'SELECT_OPTIONS_RESTRICT'
        EXPORTING
          restriction            = g_t_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.

  • Using Select options how to validate

    Hi Experts,
    I am using webdynpro abap component select options.In select options i am using vbeln field i want to validate the entered value.How to validate it.Can give me for this solution is there any example provide me.

    Hi Chandra sekhar ,
    Can you give me the clear idea for validation.I have done initially in wddoinit
    method WDDOINIT .
    * Reference variable used instantiate the select-options component
    DATA
    lr_cmp_usage TYPE REF TO if_wd_component_usage.
    * Variables used to create the select-options fields and
    * define its initial values
    DATA:
    lr_field TYPE REF TO data.
    FIELD-SYMBOLS:
    <fs_field> TYPE ANY,
    <fs_range> TYPE INDEX TABLE.
    * Instantiate the select-options component
    lr_cmp_usage = wd_this->wd_cpuse_cmp_sel_opt( ).
    IF lr_cmp_usage->has_active_component( ) IS INITIAL.
    lr_cmp_usage->create_component( ).
    ENDIF.
    * Sets the helper reference
    wd_this->m_sel_opt = wd_this->wd_cpifc_cmp_sel_opt( ).
    wd_this->m_helper = wd_this->m_sel_opt->init_selection_screen( ).
    * Hide the standard select-options components.
    wd_this->m_helper->set_global_options(
    i_display_btn_cancel = abap_false
    i_display_btn_check = abap_false
    i_display_btn_reset = abap_false ).
    * Adding a block (type Tray) to the select-options
    wd_this->m_helper->add_block(
    i_id = `BL01`
    i_block_type = if_wd_select_options=>mc_block_type_tray
    i_title = `Flight Booking` ).
    * Adding a parameter field to the created block
    * Create a reference to the type of airline code
    CREATE DATA lr_field TYPE s_carr_id.
    * Sets the airline code initial value
    ASSIGN lr_field->* TO <fs_field>.
    <fs_field> = 'AA '.
    * Add the parameter to the group
    wd_this->m_helper->add_parameter_field(
    i_id = `CARRID`
    i_within_block = `BL01`
    i_value = lr_field ).
    FREE lr_field.
    UNASSIGN <fs_field>.
    * Adding a select-options field to the created block
    * Create a reference to the connection number range table
    lr_field = wd_this->m_helper->create_range_table( `S_CONN_ID` ).
    * Add the select-option to the group
    wd_this->m_helper->add_selection_field(
    i_id = `CONNID`
    i_within_block = `BL01`
    it_result = lr_field ).
    FREE lr_field.
    endmethod.
    and in button i have done as
    method ONACTIONON_EXECUTE .
      TYPES:
    lty_r_connid TYPE RANGE OF s_conn_id.
    DATA
    lr_sbook TYPE REF TO if_wd_context_node.
    * Variables used to retrieve the values of select-options fields
    DATA
    lt_sel_item TYPE if_wd_select_options=>tt_selection_screen_item.
    FIELD-SYMBOLS:
    <fs_sel_item> LIKE LINE OF lt_sel_item,
    <fs_carrid> TYPE s_carr_id,
    <fs_connid> TYPE lty_r_connid.
    * Get the selection-screen items
    wd_this->m_helper->get_selection_screen_items(
    IMPORTING et_selection_screen_items = lt_sel_item ).
    * Retrieve the values from the select-options items
    LOOP AT lt_sel_item ASSIGNING <fs_sel_item>.
    CASE <fs_sel_item>-m_id.
    WHEN `CARRID`.
    ASSIGN <fs_sel_item>-m_value->* TO <fs_carrid>.
    WHEN `CONNID`.
    ASSIGN <fs_sel_item>-mt_range_table->* TO <fs_connid>.
    ENDCASE.
    ENDLOOP.
    * Retrieve the data from the database, for simplicity, the
    * SELECT statement has been implemented here.
    SELECT * FROM sbook
    INTO TABLE wd_this->t_sbook
    WHERE carrid = <fs_carrid>
    AND connid IN <fs_connid>.
    * Bind the data to the context
    lr_sbook = wd_context->get_child_node( name = `T_SBOOK`).
    lr_sbook->bind_table( wd_this->t_sbook ).
    endmethod.
    now can you provide me the code for carrid and connid validation how has to be done.Please give me this solution

  • Select Options: How to preallocate the select options values?

    Hi All,
    I have been trying to preallocate my select options. I want to read all values a user is authorized for and set them in the range of the select options fields (before the are actually shown to the user). However, I wasn't able to..
    Does anybody know how to do that and can provide codong examples?
    Thanks, Johannes

    Hi Johannes,
    Refer to the below link which has an article on the same topic with code snippets-
    http://www.divulgesap.com/blog.php?p=NjY=
    Regards,
    Ravikiran

  • Select option how to pass in Function Module

    Hi  Friends
    how to pass direct select-option values in a Function Module and  later how to retrive the values from FM as well ?
    Regards
    Meeta

    Hello Meeta
    You may use a generic table type like RSELOPTION or RSDSSELOPT_T. However, this requires that you shuffle the data from twice from your specific select-options to this generic select-option and vice versa.
    A much simpler way is to import the name of the report from which you want to retrieve its select-options into the function module and within the fm just call fm RS_REFRESH_FROM_SELECTOPTIONS.
    Regards
      Uwe

  • Select-Options, how can I transfer datau00B4s ??

    I have in my Upper class ( Report TestRun ) my select-options and I want send this selected order_no (with select-options) in my subclass ( INCLUDE : Class Test_RUNNING ).
    Have anyone an idea, how does it work?

    Hi ,
    SELECT-OPTIONS data wil be stored in a range of values like one internal table.
    So if you have to transfer the select options data
    then please declare an internal table(I_PERNR) of structure(Z_PERNR_STRC) with fields as below.
    1.Create a structure in se11 with the below mentioned fields.
    SIGN       CHAR1
    OPTION       CHAR2
    LOW         PERNR_D
    HIGH       PERNR_D
    2.Declare an internal table with type as above structure in the class.
    I_PERNR TYPE Z_PERNR_STRC.
    3.Then pass the select option i.e s_pernr into that internal table.
    I_PERNR = S_PERNR.
    Now the internal table in the class consists of range of values which are present in the select options s_pernr.
    And you can use the internal table as such in the class.
    Hope it is useful for you.
    Reward me points if useful.
    Edited by: Deepthi navel on Jun 24, 2008 11:27 AM

  • Select-options How to assign  Default value as "Not equal to something"

    My req. is to asssign default value for a select-option as <> "DS1" . I am able to give default value as DS1 But dont know how to give "<> DS1" . Please help me
    Thanking u in advance ..

    INITIALIZATION.
    s_lifnr-low = '0001'.
    s_lifnr-high = '0002'.
    s_LIFNR-sign = 'I'.
    s_lifnr-option = 'NE'.
    append s_lifnr.
    Regards,
    Subramanian V.
    P.S. - Raja, still mode = BSP ??? :-P
    Message was edited by: Subramanian Venkateswaran

  • Any limitations on select-option field size

    I am trying to define a select options (NO INTERVALS) for a field which is 80 characters in length.
    Program cuts it off to 45 characters in execution mode.
    Could you please let me know if there is any other way to achieve this.
    Regards
    Kasi

    Hi Kasi,
    It looks like you've hit a hard limit of the system, the generated selection screen has the selection option field defined as 45 chars, even though the field defined in the program is longer.
    I think the only way around this is to create your own selection screen and assign this to your report.
    Regards,
    Nick

  • HOW TO DESIGN RANGE SELECTION IN MODULE PULL LIKE SELECT-OPTION.

    HOW TO DESIGN RANGE SELECTION IN MODULE PULL LIKE SELECT-OPTION.
    how can we add range selection in screen painter.
    regards.

    Hi,
       create two input fields and a push button like select option in the screeen.
    Try checking this logic
    <b>Program:</b>
    <b>ranges</b> ra_matnr for mara-matnr.
    <b>Layout field name declaration:</b>
    Give the low field name as ra_range-low
      and high field name as ra_range-high.
    extension for pushbutton.--exten(function code)
    next -- function code for the enter key.
    PBO
    module status_3000.
    PAI
    module user_command_3000.
    <b>module user_command_3000.</b>
    if sy-ucomm = exten.
      call screen 400. (screen which shows extension values can be kept).
    elseif sy-ucomm = Next.
    if ra_matnr-low is not initial.
        ra_matnr-SIGN = 'I'.
        ra_matnr-OPTION = 'EQ'.
        APPEND ra_matnr.
        clear ra_matnr.
    endif.
    if ra_matnr-high is not initial.
        ra_matnr-SIGN = 'I'.
        ra_matnr-OPTION = 'EQ'.
        APPEND ra_matnr.
        clear ra_matnr.
    endif.
    endif.
    endmodule.
    module status_3000.
    read table ra_matnr  index 1 into ra_matnr .
    set pf-status '3000'.
    set title '3000'.
    endmodule
    Br,
    Laxmi.

  • How to create the select option in the screen

    HI,
    I am developing one module pool program and I have below requirement,
    currently plant is acting like PARAMETER and the now it should be changed to select option.
    how to create the select option in the screen
    Thanks and regarding,
    Malla
    Moderator message - Please search before asking - post locked
    Edited by: Rob Burbank on Dec 16, 2009 1:41 PM

    Try RANGES.
    The RANGES has same structure as that of select-options.

  • How to create the select option for the Plant in screen (Module pool)

    HI,
    I am developing one module pool program and I have below requirement,
    currently plant is acting like PARAMETER and the now it should be changed to select option.
    how to create the select option in the screen
    Thanks and regarding,
    Malla
    Moderator message - Cross post locked
    Edited by: Rob Burbank on Dec 16, 2009 1:41 PM

    Steps to get SELECT-OPTIONS in module pool programs.
    1.Start one dialog program with SAPMZ_001.
    Place the below code in the TOP include of the dialog program.
    TABLES marc.
    SELECTION-SCREEN BEGIN OF SCREEN 3200 AS SUBSCREEN.
    SELECT-OPTIONS: werks FOR marc-werks.
    SELECTION-SCREEN END OF SCREEN 3200. 
    2 .Create one screen 3000.
    Go to Layout of the screen and Define subscreen area on the screen and Name it as l_subscreen.
    Place the below code in the Flow logic of the screen.
    PROCESS BEFORE OUTPUT.
      CALL SUBSCREEN l_subscreen INCLUDING 'SAPMZ_001' '3200'.
    PROCESS AFTER INPUT.
      CALL SUBSCREEN l_subscreen.
    Activate all.
    Create Transaction code for the dialog program .
    Execute the transaction code. You will see the select-option for werks how we see on Selection-screen.

  • How to delete selection criteria for select-option in program

    Hi all,
    I have a selection screen with few select-options. the question is if i inserted some value at the select option, how can i delete the selection criteria in the program ? example if i have 3 radio button A,B,C. if I click rb A, select option A1 will be active and other 2 select oprtion B1 and C1 will dim, when I click rb B, the value at select option A1 will be deleted and dim and at the same time, B1 will be active, C1 will dim. when i click rb C, the value at A1 and B1 will be cleared if there is any value in it and then A1 and B1 will dim but C1 will be active. I've found a way to make the select option active n inactive when depending on which rb i click, thanks to a forummer here but to clear the value when the select-otpion is inactive?
    Thanks for any help.

    Hi
    See the sample code and do accordingly
    SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-001.
    PARAMETERS: pa_file TYPE rlgrap-filename MODIF ID abc,
    pa_lifnr TYPE lfa1-lifnr MODIF ID abc,
    pa_vkorg TYPE vbak-vkorg MODIF ID abc.
    SELECTION-SCREEN END OF BLOCK b1.
    SELECTION-SCREEN BEGIN OF BLOCK b2 WITH FRAME TITLE text-002.
    PARAMETERS: pa_kunnr TYPE vbak-kunnr MODIF ID def.
    SELECT-OPTIONS: s_lifnr FOR gs_lfa1-lifnr MODIF ID def,
    s_date FOR gs_lfa1-erdat MODIF ID def,
    s_augru FOR gs_vbak-augru MODIF ID def,
    s_vbeln FOR gs_vbak-vbeln MODIF ID def.
    SELECTION-SCREEN END OF BLOCK b2.
    SELECTION-SCREEN BEGIN OF BLOCK b3 WITH FRAME TITLE text-003.
    SELECTION-SCREEN BEGIN OF LINE.
    PARAMETERS: pa_upd RADIOBUTTON GROUP g1 USER-COMMAND uc01 DEFAULT 'X'."#EC *
    SELECTION-SCREEN COMMENT 3(60) text-004 FOR FIELD pa_upd.
    SELECTION-SCREEN END OF LINE.
    SELECTION-SCREEN BEGIN OF LINE.
    PARAMETERS: pa_rep RADIOBUTTON GROUP g1 ."#EC *
    SELECTION-SCREEN COMMENT 3(60) text-005 FOR FIELD pa_rep.
    SELECTION-SCREEN END OF LINE.
    SELECTION-SCREEN END OF BLOCK b3.
    IF pa_rep EQ gc_x.
    LOOP AT SCREEN.
    IF screen-group1 = gc_abc.
    screen-input = gc_zero_num.
    ELSEIF screen-group1 = gc_def.
    screen-active = gc_one_num.
    ENDIF.
    MODIFY SCREEN.
    ENDLOOP.
    ELSEIF pa_upd EQ gc_x.
    *For Reprocessing
    LOOP AT SCREEN.
    IF screen-group1 = gc_def.
    screen-input = gc_zero_num.
    ELSEIF screen-group1 = gc_abc.
    screen-active = gc_one_num.
    ENDIF.
    MODIFY SCREEN.
    CLEAR pa_upd.
    ENDLOOP.
    ENDIF.
    REPORT zrich_001.
    PARAMETERS: p_rad1 RADIOBUTTON GROUP grp1 DEFAULT 'X'
                            user-command chk,
                p_rad2 RADIOBUTTON GROUP grp1.
    SELECT-OPTIONS: s_datum1 FOR sy-datum MODIF ID d1,
                    s_datum2 FOR sy-datum MODIF ID d2.
    AT SELECTION-SCREEN OUTPUT.
      LOOP AT SCREEN.
        IF p_rad1 = 'X'
          AND screen-group1 = 'D2'.
          screen-active = '0'.
        ENDIF.
        IF p_rad2 = 'X'
         AND screen-group1 = 'D1'.
          screen-active = '0'.
        ENDIF.
        MODIFY SCREEN.
      ENDLOOP.
    <b>Reward points for useful Answers</b>
    Regards
    Anji

  • Select-option variable length

    hi experts,
    i am using select-options in my report prg.
    i want to make its display length more than 8 characters since select-option variable can be upto 8 characters long.
    how can i achieve this?
    thanx in advance...
    Thanx & Regards,
    Viral Patel

    For technical limits on SELECT-OPTIONS read SAP documentation ([SELECT-OPTIONS|http://help.sap.com/abapdocu_70/en/ABAPSELECT-OPTIONS.htm])
    The name of the selection criterion selcrit is limited to a maximum of 8 characters. This statement is allowed in the global declaration part of executable programs, function groups, and module-pools. In function groups and module-pools it is only allowed within the definition of an independent selection screen. In executable programs it is otherwise automatically assigned to the standard selection screen.
    and
    Two input fields with the name selcrit-low and selcrit-high are created on the current selection screen using a matching external data type in a new line at positions 35 and 60. The length of the input fields bases upon the length of the data type which is defined after FOR. The maximum length of the input fields is 45. The maximum visible length of the input fields is, depending on the nesting depth, in blocks with frames between 10 and 18. If the length is larger than the maximum visible length, then the content is scrollable.
    So if your field (the field after the FOR option) is less than 8 character the visible length will be less than 8, you may use another field with 8 character, but you will have to map it to the correct field length (in AT SELECTION-SCREEN ON so, fill a TYPE RANGE internal table that you will use in following statements) you may also need to manage the search-help in your code (may work without problem if no conversion exit and character type field, else manage the AT SELECTION-SCREEN ON VALUE-REQUEST)
    Regards,
    Raymond

  • Single select option in launch variables

    Hi,
    I am using hyperion 9.3.0 , i have written a HBR , but the problem is that the launch varaibles are giving multiple select option , how can i restrict the launch variable to have a single select option only.the launch varaibles are global varaibles. do i need to do some changes in the global varaible or the HBR and what changes would be required.thanks in advance.

    Maybe you have set the variable to be members instead of type member.
    Cheers
    John
    http://john-goodwin.blogspot.com/

  • Regarding Select-options

    select-options :s_kunnr for kna1-kunnr.
    s_kunnr-low = 1000.
    the select options low value is 1000 and freeze the low value.mean's output mode onely.next high value is modified giving variable value.in select options how to freeze the only low value?

    REPORT demo_sel_screen_select_options.
    DATA wa_carrid TYPE spfli-carrid.
    SELECT-OPTIONS airline FOR wa_carrid.
    LOOP AT airline.
      WRITE: / 'SIGN:',   airline-sign,
               'OPTION:', airline-option,
               'LOW:',    airline-low,
               'HIGH:',   airline-high.
    ENDLOOP.
    Structure of select options:
    LOW Low value
    HIGH High value
    SIGN E = Excluding, I = Including
    OPTION BT = Between EQ = Equal
    data: l_sign(2) type c,
    l_option(3) type c.
    WRITE AT 3 ‘Printdoc:’ INTENSIFIED ON. loop at s_prtdoc. if s_prtdoc-sign = ‘E’. l_sign = ‘<>‘. else. l_sign = ‘=’. endif. if s_prtdoc-option = ‘EQ’. clear l_option. else. l_option = ‘to’. endif. write at 35 l_sign. write at 39 s_prtdoc-low. write at 55 l_option. write at 59 s_prtdoc-high. new-line. endloop.
    REPORT:
    Printdoc: = 800000000501 to 800000000501 <> 800000000502 = 800000000503

Maybe you are looking for

  • For users of Central Station or Big Knob....or passive speakers

    I've got a bit of a conundrum and would appreciate your expert input to try and solve it. I have two sets of passive monitors, and an alesis ra-100 amp. I'm looking at the central station by presonus, but something on their website left me a little c

  • How to implement row level security using external tables

    Hi All Gurus/ Masters, I want to implement row level security using external tables, as I'm not sure how to implement that. and I'm aware of using it by RPD level authentication. I can use a filter condition in my user level so that he can access his

  • Companion CD for 10g file corrupt after download

    I have for 2 days tried to download Oracle Database 10g Companion CD release 2 (10.2.0.1.0) for AIX5L. But the file is corrupt and when I try to gunzip it I get the error message "Invalid archive directory".

  • S_AC0_52000888 - Payables: Profit Center

    Dear All Can someone tell me how to add due date or other fields in report S_AC0_52000888 - Payables: Profit Center . Further, how to create vendor or customer aging reports based on document splitting. Thanks and Best Regards Farhan Qaiser

  • Currency to be defaulted from Fixed Vendor to PR

    In my case, currency comes into purchase requisition based on company code, and the request is to have it come in from the fixed vendor field. Example,  the vendoru2019s currency is EUR, but USD defaults into the field. . It is possible to change it