Select options- (negavtive range)

Hi,
My doubt is ...Is it possible to add a condition in the code to  fetch data if we enter a range of valuesin the RED column of  the selection screen .To be precise I want to restrict dates in my selection screen,if i enter certain dates in the selection screen I dont want the details of that date to be printed.By default itself if i enter it in the Red column ,it will restrict but my requirement is to do some more changes if I have given it in the RED columns,so I want to knw if i can add code in the program ,if so how to do it.Please advice.

Hi,
Please try something like this.
select-options: so_date for sy-datum.
initialization.
*exclude the dates between August 01, 2007 and August 10, 2007
so_date-sign = 'E'.
so_date-option = 'BT'.
so_date-low = '20070801'.
so_date-high = '20070810'.
append so_date.
Regards,
Ferry Lianto

Similar Messages

  • Select-options and ranges

    Hi all,
    Belated Happy Holi.
    Can u  explain me the difference between
    Select-options and ranges?
    When, where and how to use them ?
    I know the basic differences, but i need to know in deep .
    could u give me the informatin with a scenario please ?
    Thanks in advance
    Ravi

    HI
    <u>SELECT-OPTIONS:</u> Declare an internal table that is also linked to input fields on a selection screen
    <u>RANGES:</u> Declare an internal table with the same structure as in select-options, but without linking it to a selection screen.
    FOR FURTHER DOCUMENTATION PLEASE GO THROUGH THE LINK
    <a href="http://72.14.203.104/search?q=cache:btyoj86smhEJ:www.sap-img.com/abap/difference-between-select-options-ranges.htmSelect-optionsandrangesIN+ABAP&hl=en&gl=in&ct=clnk&cd=1">Difference Between Select-Options & Ranges</a>
    <a href="http://72.14.203.104/search?q=cache:EJgiHLpghDEJ:help.sap.com/saphelp_nw04/helpdata/en/fc/eb3034358411d1829f0000e829fbfe/content.htmSelect-optionsandrangesIN+ABAP&hl=en&gl=in&ct=clnk&cd=4">Statical Declaration</a>
    <a href="http://72.14.203.104/search?q=cache:VWS1erlabRIJ:help.sap.com/saphelp_nw04/helpdata/en/9f/dba71f35c111d1829f0000e829fbfe/content.htmSelect-optionsandrangesIN+ABAP&hl=en&gl=in&ct=clnk&cd=5">Selection tables</a>
    REGARDS
    ANOOP
    Message was edited by: ANOOP R.S

  • How to use select options whitout ranges ie like parameter

    how to use select options whitout ranges ie like parameter and pls send me the code on that
    thanks
    raja.

    hi,
    SELECT-OPTIONS : s_kunnr for kna1-kunnr <b>no intervels.</b>
    eg: code
    <b>SELECT-OPTIONS : s_kunnr for kna1-kunnr <b>no intervels.</b></b>
    data: itab type table of kna1 with header line.
    select * from kna1 into table itab where kunnr IN s_kunnr.
    rgds
    Anver

  • Difference between select-option and range

    Hi,
      wat are the difference between  select-option and range
    where u have to use those and give the syntax for the range option.
      if u use range option in report programming there is any advantages ?
      pls reply for this ..
    thanks
    rams

    Hi,
    Not much of a difference,
    A Select-Option could be like,
    SELECT-OPTIONS sel FOR f
    And a Range could be like,
    DATA: BEGIN OF sel OCCURS 10,
             SIGN(1),
             OPTION(2),
             LOW  LIKE f,
             HIGH LIKE f,
          END   OF sel.
    Here they both function the same. But then the Select-Options has numerous options associated with it than the RANGE option.
    Hope it helps,
    Pradip Parmar.

  • How to modify a select option without range and mutiple selection??

    hi all,
    i need to modify a select option by removing the range and option for multiple entry. i other words i need to make select option as parameter.( because i cannot use parameter in my program due to some constraints.)
    is it possible to change the select option as per my requirement if yes please let me know how is it possible.
    Thanks in advance.
    Sreekanth.

    hi,
            Yes u can use code like following way..
    select-options : s_matnr for mara-matnr no-extension no intervals.
    Reward if helpful.
    Regards
    Gagan

  • 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..

  • Limitation of using select-options or ranges

    Hi
    I have the following code to fill the select-option AUFNR with the orders from SEL_TAB table, which I have to submit to another report to get a result set.
    LOOP AT SEL_TAB.
       MOVE: 'I'   TO AUFNR-SIGN,
             'EQ'  TO AUFNR-OPTION,
             SEL_TAB-AUFNR TO AUFNR-LOW.
      APPEND AUFNR.
    ENDLOOP.
    I know that we can use the RANGES option also for the above scenario since I don't display the select-option AUFNR in my selection screen.
    My question is, is there any limitation to how many number of values the RANGES or SELECT-OPTIONS can hold? Is it 200 or 256? I am not sure of this figure, can anyone give the exact number?
    Thanks,
    Bala.

    Hi Bala,
      there's not SAP limitations for range dimension but there is a limitation about native SQL statement size.
    In fact an open SQL statement (in ABAP language) will be translated in native SQL .
    For example:
    select * from mara where matnr in r_mara
    will be translated in
    SELECT ... FROM MARA WHERE MATNR = value1 OR MATNR = value2 etc...
    So if your range is too large, the native SQL will exceed the maximum length (and short dump will occur).
    with the following simple trick you can bypass the problem:
    describe table rng_ebeln_marc lines i.
    if i > 0.
      if i <= max_rng_rows.   "MAX NUMBER OF RANGE LINES
        select *
          from ekbe
          into table tekbe
         where ebeln in rng_ebeln_marc.
      else.
        from_i = 1.
        to_i = max_rng_rows.
        clear new_ebeln_marc.
        do.
          if i < from_i.
            exit.
          endif.
          append lines of rng_matnr_mara from from_i to to_i to new_ebeln_marc.
          select *
            from ekbe
       appending table tekbe
           where ebeln in new_ebeln_marc.
           clear: new_ebeln_marc, new_ebeln_marc[].
           from_i = from_i + max_rng_rows.
          to_i = to_i + max_rng_rows.
        enddo.
      endif.
      sort tekbe by ebeln ebelp zekkn vgabe gjahr belnr buzei.
    endif.
    This will split the sql statement into more (and shorter) statements. The result will be joined.
    Let me know if you need further infos.
    Kind Regards, Manuel

  • Select options higher range value not appearing

    Dear Experts,
    Carrid : AA to AZ
    But at runtime i see that low value is AA and high value is null....
    written code in wdoinit and code in button to search values.
    code of wddoinit:
      DATA: LT_RANGE_TABLE TYPE REF TO DATA.
      DATA: LR_COMPONENTCONTROLLER TYPE REF TO IG_COMPONENTCONTROLLER,
                 L_REF_CMP_USAGE TYPE REF TO IF_WD_COMPONENT_USAGE.
      L_REF_CMP_USAGE = WD_THIS->WD_CPUSE_SELECT_OPTIONS( ).
      IF L_REF_CMP_USAGE->HAS_ACTIVE_COMPONENT( ) IS INITIAL.
                 L_REF_CMP_USAGE->CREATE_COMPONENT( ).
      ENDIF.
      WD_THIS->M_WD_SELECT_OPTIONS = WD_THIS->WD_CPIFC_SELECT_OPTIONS( ).
      WD_THIS->M_HANDLER = WD_THIS->M_WD_SELECT_OPTIONS->INIT_SELECTION_SCREEN( ).
      LT_RANGE_TABLE = WD_THIS->M_HANDLER->CREATE_RANGE_TABLE
                                                         ( I_TYPENAME = 'S_CARR_ID' ).
      WD_THIS->M_HANDLER->ADD_SELECTION_FIELD
                                                         ( I_ID = 'S_CARR_ID'   IT_RESULT = LT_RANGE_TABLE ).
    can anyone pls help me to resolve this.
    Regards......
    Sajid
    Edited by: shaik sajid on May 17, 2009 3:39 PM

    got it."should press enter after entering values"..i am new to webdynpro and learning on my own,hope i will be successful...

  • Entries in Select-Options Range

    Hi Experts,
    I am experiencing short dump if i give more no of entries in select option (in range)
    can any one please suggest a solution to this?
    Points will be awarded.
    Thanks
    Dany

    Maximum number of entries in select options is only around 1630, you cannot give more than that
    i guess it is around 1600 - 1700
    chk this program , if u increase the do loop to 1800 it will give dump
    REPORT ychatest LINE-SIZE 350.
    TABLES : mara.
    SELECT-OPTIONS : s_matnr FOR mara-matnr.
    DATA : BEGIN OF itab OCCURS 0.
            INCLUDE STRUCTURE mara.
    DATA:    END OF itab.
    DO 1600 TIMES.
      s_matnr-sign = 'I'.
      s_matnr-option = 'BT'.
      s_matnr-low = ''.
      s_matnr-high = ''.
      APPEND s_matnr.
      CLEAR s_matnr.
    ENDDO.
    SELECT  * FROM mara INTO TABLE itab WHERE matnr IN s_matnr.
    WRITE : 'hi'.
    Message was edited by:
            Chandrasekhar Jagarlamudi

  • Select-options in ModulePool

    hi experts,
    I am facing one issue regarding the modulepool programming . In Module Pool Programming I am using select-options, I want to upload the selected ranges and also the excluded values as zeros in the database.Please any one help me.

    You can use the Select-Option as Ranges in a select statement....if you want exclude Zeros in DB you can use a simple condition.....WHERE VALUE > 0...
    Regards

  • Fill select-options in Page with flow logic ???

    Hello All,
              I created a BSP Application using Page with Flow Logic.
    In the first page of my Application I'm using 2 input fields as select-options.
    Now I'm populating a Ranges of that Field using the type :-
    selopttab
    I populated the ranges table like :-
    wa_bname_sel-sign   = 'I'.
              wa_bname_sel-option = 'BT'.
              wa_bname_sel-low    = '*'.
              wa_bname_sel-high   = 'Z'.
            ELSE.
              wa_bname_sel-sign   = 'I'.
              wa_bname_sel-option = 'EQ'.
              wa_bname_sel-low    = p_bname.
              wa_bname_sel-high   = p_bname.
            ENDIF.
            APPEND wa_bname_sel TO p_bname_sel.
            CLEAR  wa_bname_sel.
    But the problem is I checked the corresponding DATABASE Table entries by passing thesame value .
    i.e I passed the low and high values to the field as '*' and 'Z'.
    The total number of entries differ when passing '*' and 'Z' to when passing SPACE.
    I tried even with contains Pattern .This time the total number of records fetching has Increased but the sum is not exact when passed SPACE to the Database Table.
    So what should I pass to the Low and High values of my Ranges Table to get all the entries ????
    DOes this type of building the Ranges work in BSP's ?
    How are u people working out for the select-options functionality in Page with flow logic ?
    Message was edited by:
            deepu k

    Hello Jessy,
    To populate select-options or Ranges in Page with flow logic I used the following code :
    ************************ Bulid the Select-Options**************************************
          DATA: p_bname_sel     TYPE STANDARD TABLE OF selopttab,
                p_bsp_name_sel  TYPE STANDARD TABLE OF selopttab,
                p_tcode_sel     TYPE STANDARD TABLE OF selopttab.
          DATA: wa_bname_sel    TYPE selopttab,
                wa_bsp_name_sel TYPE selopttab,
                wa_tcode_sel    TYPE selopttab.
    * Select-Options for Username
          REFRESH p_bname_sel.
          CLEAR   wa_bname_sel.
          IF ( p_bname IS INITIAL  ).
            wa_bname_sel-sign   = 'I'.
            wa_bname_sel-option = 'CP'.
            wa_bname_sel-low    = '*'.
            wa_bname_sel-high   = ''.
          ELSE.
            wa_bname_sel-sign   = 'I'.
            wa_bname_sel-option = 'EQ'.
            wa_bname_sel-low    = p_bname.  " p_bname is the Input field and the value is taken from it
            wa_bname_sel-high   = p_bname.
          ENDIF.
          APPEND wa_bname_sel TO p_bname_sel.
          CLEAR  wa_bname_sel.
    * Select-Options for BSP_Application
          REFRESH p_bsp_name_sel.        
          CLEAR   wa_bsp_name_sel.
          IF ( p_bsp_name IS INITIAL  ).
            wa_bsp_name_sel-sign   = 'I'.
            wa_bsp_name_sel-option = 'CP'.
            wa_bsp_name_sel-low    = '*'.
            wa_bsp_name_sel-high   = ''.
          ELSE.
            wa_bsp_name_sel-sign   = 'I'.
            wa_bsp_name_sel-option = 'EQ'.
            wa_bsp_name_sel-low    = p_bsp_name.       " Input field
            wa_bsp_name_sel-high   = p_bsp_name.
          ENDIF.
          APPEND wa_bsp_name_sel TO p_bsp_name_sel.
          CLEAR  wa_bsp_name_sel.
    * Select-Options for TCODE
          REFRESH p_tcode_sel.
          CLEAR   wa_bsp_name_sel.
          IF ( p_tcode IS INITIAL  ).
            wa_tcode_sel-sign   = 'I'.
            wa_tcode_sel-option = 'CP'.
            wa_tcode_sel-low    = '*'.
            wa_tcode_sel-high   = ''.
          ELSE.
            wa_tcode_sel-sign   = 'I'.
            wa_tcode_sel-option = 'EQ'.
            wa_tcode_sel-low    = p_tcode.       " Input field
            wa_tcode_sel-high   = p_tcode.
          ENDIF.
          APPEND wa_tcode_sel TO p_tcode_sel.
          CLEAR  wa_tcode_sel.
    * Select all the related entries when either BSP or TCode is choosen
          IF ( ( p_bsp_name IS NOT INITIAL ) AND ( p_tcode IS INITIAL ) )
                     OR
             ( ( p_bsp_name IS INITIAL ) AND ( p_tcode IS INITIAL ) ).
            REFRESH gt_final.
            SELECT bname
                   bsp_name
                   description
                   ldate
                   ltime
                   calls
                   FROM <custom_table>
                   INTO TABLE gt_final
                   AND   bsp_name  IN p_bsp_name_sel
                   AND   ldate          IN p_ldate_sel.
    endif.
    Hope that wud help u !!!
    Regards,
    Deepu.K

  • SELECT OPTIONS ISSUE

    Hi Experts,
    I am using a select options for one field on my screen with extension which gives me an Arrow right next to the Field , now the issue is when i click on the Arrow a search help opens up for multiple selection.
    In this search help there are "FROM" and ''TO" columns , i would like to disable or make that "TO" column invisible i know it is possible in ABAP through function modules but how can it be acheived in webdynpro.
    I have gone through the "if_wd_select_options" class but couldnt find a solution for this , please lead me to the
    right approach.
    Thanks In Advance,
    Chaitanya.

    Hello Chaitanya Raju,
    You must be resusing the Select-option component WDR_SELECT_OPTIONS
    Follow below steps to create a select-options without ranges.
    I think this is only possible with dynamic handling.
    1)Acess the method: remove_all_sel_screen_items to Removes All Elements in Selection Screen.
    2)build up new screen by calling the method: ADD_SELECTION_FIELD.
    Before calling the 2nd step --> you will have to populate all the information that is required to build a select-option.
    *add select options field
      CALL METHOD wd_comp_controller->mo_so_handler->add_selection_field
        EXPORTING
          i_id                         = is_sel_op-m_id
          i_within_block               = is_sel_op-m_within_block
          i_description                = is_sel_op-m_description
          it_result                    = is_sel_op-mt_range_table
          i_obligatory                 = is_sel_op-m_obligatory
          i_value_help_id              = is_sel_op-m_value_help_id
          i_no_extension               = is_sel_op-m_no_extension
          i_no_intervals               = is_sel_op-m_no_intervals
          i_no_complex_restrictions    = is_sel_op-m_no_complex_restrictions
          i_as_checkbox                = is_sel_op-m_as_checkbox
          i_as_dropdown                = is_sel_op-m_as_dropdown
          it_value_set                 = is_sel_op-mt_value_set
          i_read_only                  = is_sel_op-m_read_only
          i_tooltip                    = is_sel_op-m_tooltip   .
    You can refer to this link for more info.
    https://www.sdn.sap.com/irj/scn/wiki?path=/display/wdabap/multiple%252bdynamic%252bselection%252bblocks%252bin%252bwebdynpro-abap
    Thanks,
    Bharath.K

  • Select-options and Parameters, when to use what?

    Hi gurus,
    I have been using Parameters for long. Now I want to choose a range of values, which I need to retrieve from database.
    I tried using select-options. Can't I use 2 parameters that is parameter1 and parameter2 and mention query BETWEEN para1 AND
    para2, and when I use NO INTERVALS and NO EXTENSION together, it behaves same like parameter, then why did SAP gave these
    extensions.

    Hi friend,
    Simple differences between Select-options and parameters.
    Select-Options Uses keyword 'for'                         
    Parameters Uses keywords 'like', 'type'     
    Select-Options  Uses operator 'in'                         
    Parameters Uses operator '='
    Select-Options  Provides ranges for selection     
    Parameters  No ranges only single value
    Select-Options Creates selection table                              
    Parameters No selection table
    Select-Options  When i/p blank all records selected          
    Parameters   When i/p blank none is selected
    Note:
    Select options can act as parameters by using 'no-extension' 'no intervals', but all records will be selected when i/p is blank unlike parameters.
    Might be helpful..
    Thanks...
    Edited by: Guest77 on Feb 10, 2009 5:44 AM

  • 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.

  • How to get all values in the range of select option into internal table?

    Hi,
    I need to capture all entries coming in the range of select option into one internal table.
    How to do get that?
    For E.g
    select-options: matnr for mara-matnr.(select option)
    IF I enter G0100013507892 as lower value of matnr and G0100014873947 as higher value
    and if there are 10,000 materials in the above range, then I want to capture all theses 10000 materails in one internal table. How to do that?
    Regards,
    Mrunal

    Hello Mrunal Mhaskar  ,
    What i understand you can do one thing  go in debug mode
    Try this code : -
    LOOP AT s_matnr_ex.
      IF s_matnr_ex-low IS NOT INITIAL.
        i_matnr-matnr = s_matnr_ex-low.
        i_matnr-option = s_matnr_ex-option.
        APPEND i_matnr.
        CLEAR : i_matnr.
      ENDIF.
    ENDLOOP.
    LOOP AT s_matnr_ex.
      IF s_matnr_ex-high IS NOT INITIAL.
        i_matnr-matnr = s_matnr_ex-high.
        i_matnr-option = s_matnr_ex-option.
        APPEND i_matnr.
        CLEAR : i_matnr.
      ENDIF.
    ENDLOOP.
    In the i_matnr table high and low values are there.
    Regards,
    Vandana.

Maybe you are looking for