Skip to Content
avatar image
Former Member

ranges

what is exact purpose of selection-screen 'ranges' and what are various advantages of using 'ranges' .its urgent please

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

5 Answers

  • Best Answer
    Aug 21, 2007 at 06:54 AM

    Ranges is very usefull when you would like to make a SELECT with a list of values.

    instead of

    select ... into table ... from ... for all entries in ... where ...

    you remove the "for all entries in".

    It's just a problem of performance. Because for all entries make a lot of database access.

    The danger with the ranges is the size, greater than 3000 entries, you will have a dump.

    Fred

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Aug 21, 2007 at 06:55 AM

    Hi,

    Ranges can be described as programatic version of select-option. They are used to filter data from database or internal table. They work similar to select-options.

    Definition

    RANGES : r_werks FOR mard-werks,

    r_lgort FOR mard-lgort.

    Filling it with data

    r_werks-sign = 'I'.

    r_werks-option = 'EQ'.

    r_werks-low = p_werks1.

    APPEND r_werks.

    CLEAR r_werks.

    Usage

    SELECT * from marc where werks in r_werks.

    Regards,

    Sankar

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Aug 21, 2007 at 06:56 AM

    SELECT-OPTIONS: Declare an internal table that is also linked to input fields on a selection screen

    RANGES: 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

    Difference Between Select-Options & Ranges

    Statical Declaration

    Selection tables

    <b>

    Regards,

    Azhar</b>

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member

      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

  • avatar image
    Former Member
    Aug 21, 2007 at 06:56 AM

    HI Sandeep,

    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.

    Hope this helps.

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Aug 21, 2007 at 06:58 AM

    HI,

    Select-Options : They provides user with an option to enter value in the selection screen...... and it can be used in programs only.

    Ranges : This provides a way to populate the range of values programatially and for further use.. e.g. if you want to pass a range of values to a select query to some function module then select options will not work.....then you have to go with ranges.

    Thanks,CSR.

    Please Reward if helpful.

    Add comment
    10|10000 characters needed characters exceeded