<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Difference between Select-options and ranges in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/difference-between-select-options-and-ranges/m-p/2839984#M665114</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Can anyone explain me what is the difference between select-option and ranges.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Phyrose.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 03 Oct 2007 08:39:20 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2007-10-03T08:39:20Z</dc:date>
    <item>
      <title>Difference between Select-options and ranges</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/difference-between-select-options-and-ranges/m-p/2839984#M665114</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Can anyone explain me what is the difference between select-option and ranges.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Phyrose.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 03 Oct 2007 08:39:20 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/difference-between-select-options-and-ranges/m-p/2839984#M665114</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-10-03T08:39:20Z</dc:date>
    </item>
    <item>
      <title>Re: Difference between Select-options and ranges</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/difference-between-select-options-and-ranges/m-p/2839985#M665115</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Here both SELECT-OPTIONS &amp;amp; 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 &amp;amp; HIGH. But in case of RANGES, this internal table should be defined explicitly.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Eg. to SELECT-OPTIONS :&amp;#151;&amp;#151;&amp;#151;&amp;#151;&amp;#151;&amp;#151;&amp;#151;&amp;#151;&amp;#151;&amp;#151;&amp;#151;&amp;#151;&amp;#151;&amp;#151;&amp;#151;&amp;#151;&amp;#151;&amp;#151;&amp;#151;&amp;#151;-&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;REPORT YARSELECT.&lt;/P&gt;&lt;P&gt;TABLES YTXLFA1.&lt;/P&gt;&lt;P&gt;SELECT-OPTIONS : VENDOR FOR YTXLFA1-LIFNR.&lt;/P&gt;&lt;P&gt;INITIALIZATION.&lt;/P&gt;&lt;P&gt;VENDOR-LOW = 1000. &amp;#148; It specifies the range starting value&lt;/P&gt;&lt;P&gt;VENDOR-HIGH = 2000. &amp;#148; It specifies the range ending value.&lt;/P&gt;&lt;P&gt;VENDOR-OPTION = &amp;#145;BT&amp;#146;. &amp;#148; specifies ranges value is in between.&lt;/P&gt;&lt;P&gt;VENDOR-SIGN = &amp;#145;I&amp;#146;. &amp;#147;specifies both inclussive.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;APPEND VENDOR.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;#150; - &amp;#150; - &amp;#150; - &amp;#150; -&lt;/P&gt;&lt;P&gt;SELECT LIFNR LAND1 NAME1 FROM LFA1 INTO TABLE ITAB&lt;/P&gt;&lt;P&gt;WHERE LIFNR IN VENDOR. &lt;/P&gt;&lt;P&gt;Eg. to RANGES:&amp;#151;&amp;#151;&amp;#151;&amp;#151;&amp;#151;&amp;#151;&amp;#151;&amp;#151;&amp;#151;&amp;#151;&amp;#151;&amp;#151;-&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;REPORT YARRANGE.&lt;/P&gt;&lt;P&gt;TABLES YTXLFA1.&lt;/P&gt;&lt;P&gt;RANGES: VENDOR FOR YTXFLA1-LIFNR.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;#150; - &amp;#150; - &amp;#150; - -&amp;#151;- &amp;#150; - &amp;#150;&lt;/P&gt;&lt;P&gt;SELECT LIFNR LAND1 NAME1 FROM LFA1 INTO TABLE ITAB&lt;/P&gt;&lt;P&gt;WHERE LIFNR IN VENDOR. &lt;/P&gt;&lt;P&gt;Here with RANGES user has to design an internal table with fields &amp;#150; SIGN,OPTION,LOW and HIGH EXPLICITLY.&lt;/P&gt;&lt;P&gt;&amp;#151;&amp;#151;&amp;#151;&amp;#151;&amp;#151;&amp;#151;&amp;#151;&amp;#151;&amp;#151;&amp;#151;&amp;#151;&amp;#151;&amp;#151;&amp;#151;&amp;#151;&amp;#151;&amp;#151;&amp;#151;&amp;#151;&amp;#151;&amp;#151;&amp;#151;&amp;#151;&amp;#151;&amp;#151;&amp;#151;&amp;#151;&amp;#151;&amp;#151;&amp;#151;&amp;#151;&amp;#151;&amp;#151;&amp;#151;&amp;#151;&amp;#151;&amp;#151;&amp;#151;&amp;#151;&amp;#151;&amp;#151;&amp;#151;&amp;#151;&amp;#151;&amp;#151;&amp;#151;&amp;#151;&amp;#151;&amp;#151;&amp;#151;&amp;#151;&amp;#151;-&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Example:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select-options: bukrs for zstock-bukrs.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Should the user fill in &amp;#145;ABFI&amp;#146; in BUKRS on the selection screen, BUKRS will look like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;IEQABFI&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This is because BUKRS is set as a table as follows:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;begin of bukrs occurs 0,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SIGN type c, OPTION type c, LOW like bukrs, HIGH like bukrs,&lt;/P&gt;&lt;P&gt;end of bukrs. &lt;/P&gt;&lt;P&gt;Now, when you create the following range, it will have the exact same fields set inside its table:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Ranges: bukrs for zstock-bukrs.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The difference is, because ranges doesn&amp;#146;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 &amp;amp; bukrs-high all manually.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Some tips:&lt;/P&gt;&lt;P&gt;Sign is always I (for Include) or E (for Exclude)&lt;/P&gt;&lt;P&gt;Option can be a whole range, which includes:&lt;/P&gt;&lt;P&gt;EQ (Equal)&lt;/P&gt;&lt;P&gt;BT (Between))&lt;/P&gt;&lt;P&gt;CP (Contain Pattern)&lt;/P&gt;&lt;P&gt;So let&amp;#146;s say you want to have the range check for all company codes not starting with AB, you will set your code as follow:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ranges: bukrs for zstock-bukrs.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;bukrs-sign = &amp;#145;E&amp;#146;. &amp;#147;Exclude&lt;/P&gt;&lt;P&gt;bukrs-option = &amp;#145;CP&amp;#146;. &amp;#147;Pattern&lt;/P&gt;&lt;P&gt;bukrs-low = &amp;#145;AB*&amp;#146;. &amp;#147;Low Value&lt;/P&gt;&lt;P&gt;bukrs-high = &amp;#145;&amp;#146;. &amp;#147;High Value&lt;/P&gt;&lt;P&gt;append bukrs.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;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.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this explains it well enough.&lt;/P&gt;&lt;P&gt;&amp;#151;&amp;#151;&amp;#151;&amp;#151;&amp;#151;&amp;#151;&amp;#151;&amp;#151;&amp;#151;&amp;#151;&amp;#151;&amp;#151;&amp;#151;&amp;#151;&amp;#151;&amp;#151;&amp;#151;&amp;#151;&amp;#151;&amp;#151;&amp;#151;&amp;#151;&amp;#151;&amp;#151;&amp;#151;&amp;#151;&amp;#151;&amp;#151;&amp;#151;&amp;#151;&amp;#151;&amp;#151;&amp;#151;&amp;#151;&amp;#151;&amp;#151;&amp;#151;&amp;#151;&amp;#151;&amp;#151;&amp;#151;&amp;#151;&amp;#151;&amp;#151;&amp;#151;&amp;#151;&amp;#151;&amp;#151;&amp;#151;&amp;#151;&amp;#151;&amp;#151;-&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What does SIGN &amp;#147;I&amp;#148; &amp;amp; &amp;#147;E&amp;#148; mean? &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The &amp;#147;I&amp;#148; stands for Include, and the &amp;#147;E&amp;#148; for Exclude.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The easiest way to learn how the range selections work is, create the following dummy program:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;report dummy.&lt;/P&gt;&lt;P&gt;tables: mara.&lt;/P&gt;&lt;P&gt;select-options: matnr for mara-matnr.&lt;/P&gt;&lt;P&gt;start-of-selection.&lt;/P&gt;&lt;P&gt;loop at matnr.&lt;/P&gt;&lt;P&gt;write: / matnr-sign,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;matnr-option, matnr-low, matnr-high.&lt;/P&gt;&lt;P&gt;endloop. &lt;/P&gt;&lt;P&gt;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.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 03 Oct 2007 08:41:29 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/difference-between-select-options-and-ranges/m-p/2839985#M665115</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-10-03T08:41:29Z</dc:date>
    </item>
    <item>
      <title>Re: Difference between Select-options and ranges</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/difference-between-select-options-and-ranges/m-p/2839986#M665116</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;·        SELECT-OPTIONS: To declare an internal table that is also linked to input fields on a selection screen&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;·        RANGES: To declare an internal table with the same structure as in SELECT-OPTIONS, but without linking it to a selection screen.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 03 Oct 2007 08:42:53 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/difference-between-select-options-and-ranges/m-p/2839986#M665116</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-10-03T08:42:53Z</dc:date>
    </item>
    <item>
      <title>Re: Difference between Select-options and ranges</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/difference-between-select-options-and-ranges/m-p/2839987#M665117</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;SELECT-OPTIONS: Declare an internal table that is also linked to input fields on a selection screen &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;RANGES: Declare an internal table with the same structure as in select-options, but without linking it to a selection screen.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FOR FURTHER DOCUMENTATION PLEASE GO THROUGH THE LINK&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://72.14.203.104/search?q=cache:btyoj86smhEJ:www.sap-img.com/abap/difference-between-select-options-ranges.htm" target="test_blank"&gt;http://72.14.203.104/search?q=cache:btyoj86smhEJ:www.sap-img.com/abap/difference-between-select-options-ranges.htm&lt;/A&gt;&lt;EM&gt;Select-options&lt;/EM&gt;and&lt;EM&gt;ranges&lt;/EM&gt;IN+ABAP&amp;amp;hl=en&amp;amp;gl=in&amp;amp;ct=clnk&amp;amp;cd=1&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Vasu&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 03 Oct 2007 08:43:34 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/difference-between-select-options-and-ranges/m-p/2839987#M665117</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-10-03T08:43:34Z</dc:date>
    </item>
    <item>
      <title>Re: Difference between Select-options and ranges</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/difference-between-select-options-and-ranges/m-p/2839988#M665118</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;IF you declare a variable with select-options it will be displayed in the selection screen..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;A small difference between the two is that select-options can be used with the CHECK statement, while ranges cannot. This is documented for logical databases, but I have seen it used with select statements as well.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Otherwise both are same..&lt;/P&gt;&lt;P&gt;check out this link&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.sap-img.com/abap/difference-between-select-options-ranges.htm" target="test_blank"&gt;http://www.sap-img.com/abap/difference-between-select-options-ranges.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A class="jive_macro jive_macro_message" href="https://community.sap.com/" __jive_macro_name="message" modifiedtitle="true" __default_attr="2258165"&gt;&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Select-options are the normal select options that you define on Selection screen.&lt;/P&gt;&lt;P&gt;While Ranges are similar to Select options in the way it creates a internal table of the same form as that of Select-options. The internal table that is created has the fields&lt;/P&gt;&lt;P&gt;HIGH&lt;/P&gt;&lt;P&gt;LOW&lt;/P&gt;&lt;P&gt;SIGN&lt;/P&gt;&lt;P&gt;OPTION.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But the difference between Select-options and ranges are that we don't need to define the ranges in Selection screen. It is created by explicitly coding in the Program. (see Example below). And we can fill the internal table for ranges in the program code itself and then can use it in the same manner as we use Select-option of screen&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Example: Here r_belnr is range while s_bukrs and s_gsber is Select-options.&lt;/P&gt;&lt;P&gt;Here i have defined a range and then filling it internally in the program coding and then using it in select query.&lt;/P&gt;&lt;P&gt;TYPES: ty_belnr TYPE RANGE OF bkpf-belnr.&lt;/P&gt;&lt;P&gt;DATA: r_belnr TYPE ty_belnr WITH HEADER LINE.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LOOP AT i_bkpf INTO wa_bkpf.&lt;/P&gt;&lt;P&gt;r_belnr-sign = 'I'.&lt;/P&gt;&lt;P&gt;r_belnr-option = 'EQ'.&lt;/P&gt;&lt;P&gt;r_belnr-low = wa_bkpf-belnr.&lt;/P&gt;&lt;P&gt;APPEND r_belnr.&lt;/P&gt;&lt;P&gt;ENDLOOP.&lt;/P&gt;&lt;P&gt;CLEAR r_belnr.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECT belnr&lt;/P&gt;&lt;P&gt;aufnr&lt;/P&gt;&lt;P&gt;FROM bseg&lt;/P&gt;&lt;P&gt;INTO TABLE i_bseg&lt;/P&gt;&lt;P&gt;FOR ALL ENTRIES IN i_aufk&lt;/P&gt;&lt;P&gt;WHERE bukrs IN s_bukrs&lt;/P&gt;&lt;P&gt;AND belnr IN r_belnr&lt;/P&gt;&lt;P&gt;AND gjahr EQ p_gjahr&lt;/P&gt;&lt;P&gt;AND gsber IN s_gsber&lt;/P&gt;&lt;P&gt;AND aufnr EQ i_aufk-aufnr.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope now u have got the difference between Select-options and ranges. Get back to me if u still ahve doubts.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please give me reward points.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Murali Poli&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 03 Oct 2007 08:43:38 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/difference-between-select-options-and-ranges/m-p/2839988#M665118</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-10-03T08:43:38Z</dc:date>
    </item>
    <item>
      <title>Re: Difference between Select-options and ranges</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/difference-between-select-options-and-ranges/m-p/2839989#M665119</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;Select-options is used mostly for the continuous range of values for a field on the selection screen.&lt;/P&gt;&lt;P&gt;Ranges is not used on selection screen, but is used to cumulate the values which are not in order and to club the values for that field and to use in where condition of select.&lt;/P&gt;&lt;P&gt;In both cases a Selection table with sign,option,low and High fields is created and stores the values&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Anji&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 03 Oct 2007 08:44:42 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/difference-between-select-options-and-ranges/m-p/2839989#M665119</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-10-03T08:44:42Z</dc:date>
    </item>
    <item>
      <title>Re: Difference between Select-options and ranges</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/difference-between-select-options-and-ranges/m-p/2839990#M665120</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;A select-option is a table of selection values which permits both individual values and ranges as well as negative (i.e. not-equal-to) values of the same. This table can be defined with a RANGES statement. However, if the table is a parameter to a program a SELECT-OPTIONS statement must be used. SELECT-OPTIONS declares the parameter and defines the table automatically. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you do need this option for a program parameter and only need a single-value parameter, a PARAMETERS statement is used. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thus, program parameters are specified by either SELECT-OPTIONS or PARAMETERS. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Select options which are not parameters are defined by the RANGES statement. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Another way of explaining it would be to say simply that a select option is a range used as a parameter.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 03 Oct 2007 08:45:17 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/difference-between-select-options-and-ranges/m-p/2839990#M665120</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-10-03T08:45:17Z</dc:date>
    </item>
    <item>
      <title>Re: Difference between Select-options and ranges</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/difference-between-select-options-and-ranges/m-p/2839991#M665121</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;May be as per my knw,&lt;/P&gt;&lt;P&gt;In select-option you can provide minimun and max value.and fetch the data in between them.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;range is generally used in loop it means upto what range we want to fetch the data if means that&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hera is one exp of range.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;TYPES: BEGIN OF sub_struc, &lt;/P&gt;&lt;P&gt;          col1(10) TYPE c, &lt;/P&gt;&lt;P&gt;          col2(10) TYPE c, &lt;/P&gt;&lt;P&gt;       END OF sub_struc. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA BEGIN OF struc. &lt;/P&gt;&lt;P&gt;INCLUDE TYPE: sub_struc AS comp1 RENAMING WITH SUFFIX _1, &lt;/P&gt;&lt;P&gt;              sub_struc AS comp2 RENAMING WITH SUFFIX _2, &lt;/P&gt;&lt;P&gt;              sub_struc AS comp3 RENAMING WITH SUFFIX _3, &lt;/P&gt;&lt;P&gt;              sub_struc AS comp4 RENAMING WITH SUFFIX _4, &lt;/P&gt;&lt;P&gt;              sub_struc AS comp5 RENAMING WITH SUFFIX _5. &lt;/P&gt;&lt;P&gt;DATA END OF struc. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FIELD-SYMBOLS &amp;lt;sub&amp;gt; TYPE sub_struc. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA inc TYPE i. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;WHILE sy-subrc = 0. &lt;/P&gt;&lt;P&gt;  inc = sy-index - 1. &lt;/P&gt;&lt;P&gt;  ASSIGN struc-comp1 INCREMENT inc TO &amp;lt;sub&amp;gt; CASTING &lt;/P&gt;&lt;P&gt;                                            RANGE struc. &lt;/P&gt;&lt;P&gt;  IF sy-subrc = 0. &lt;/P&gt;&lt;P&gt;    WRITE: &amp;lt;sub&amp;gt;-col1, &amp;lt;sub&amp;gt;-col2 ... &lt;/P&gt;&lt;P&gt;  ENDIF. &lt;/P&gt;&lt;P&gt;ENDWHILE.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 03 Oct 2007 08:48:34 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/difference-between-select-options-and-ranges/m-p/2839991#M665121</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-10-03T08:48:34Z</dc:date>
    </item>
    <item>
      <title>Re: Difference between Select-options and ranges</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/difference-between-select-options-and-ranges/m-p/2839992#M665122</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Select-options are the normal select options that you define on Selection screen.&lt;/P&gt;&lt;P&gt;While Ranges are similar to Select options in the way it creates a internal table of the same form as that of Select-options. The internal table that is created has the fields&lt;/P&gt;&lt;P&gt;HIGH&lt;/P&gt;&lt;P&gt;LOW&lt;/P&gt;&lt;P&gt;SIGN&lt;/P&gt;&lt;P&gt;OPTION.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But the difference between Select-options and ranges are that we don't need to define the ranges in Selection screen. It is created by explicitly coding in the Program. (see Example below). And we can fill the internal table for ranges in the program code itself and then can use it in the same manner as we use Select-option of screen&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Example: Here r_belnr is range while s_bukrs and s_gsber is Select-options.&lt;/P&gt;&lt;P&gt;Here i have defined a range and then filling it internally in the program coding and then using it in select query.&lt;/P&gt;&lt;P&gt;TYPES: ty_belnr TYPE RANGE OF bkpf-belnr.&lt;/P&gt;&lt;P&gt;DATA: r_belnr TYPE ty_belnr WITH HEADER LINE.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LOOP AT i_bkpf INTO wa_bkpf.&lt;/P&gt;&lt;P&gt;r_belnr-sign = 'I'.&lt;/P&gt;&lt;P&gt;r_belnr-option = 'EQ'.&lt;/P&gt;&lt;P&gt;r_belnr-low = wa_bkpf-belnr.&lt;/P&gt;&lt;P&gt;APPEND r_belnr.&lt;/P&gt;&lt;P&gt;ENDLOOP.&lt;/P&gt;&lt;P&gt;CLEAR r_belnr.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECT belnr&lt;/P&gt;&lt;P&gt;aufnr&lt;/P&gt;&lt;P&gt;FROM bseg&lt;/P&gt;&lt;P&gt;INTO TABLE i_bseg&lt;/P&gt;&lt;P&gt;FOR ALL ENTRIES IN i_aufk&lt;/P&gt;&lt;P&gt;WHERE bukrs IN s_bukrs&lt;/P&gt;&lt;P&gt;AND belnr IN r_belnr&lt;/P&gt;&lt;P&gt;AND gjahr EQ p_gjahr&lt;/P&gt;&lt;P&gt;AND gsber IN s_gsber&lt;/P&gt;&lt;P&gt;AND aufnr EQ i_aufk-aufnr.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope now u have got the difference between Select-options and ranges. Get back to me if u still ahve doubts.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;Reward if useful&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 03 Oct 2007 08:59:44 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/difference-between-select-options-and-ranges/m-p/2839992#M665122</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-10-03T08:59:44Z</dc:date>
    </item>
  </channel>
</rss>

