<?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 Re: Doubt about RANGES in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/doubt-about-ranges/m-p/1827242#M352817</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;         DATA: spfli_wa TYPE spfli, &lt;/P&gt;&lt;P&gt;      r_carrid TYPE RANGE OF spfli-carrid, &lt;/P&gt;&lt;P&gt;      r_carrid_line LIKE LINE OF r_carrid. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECT-OPTIONS: sel_opt for  spfli-carrid.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;loop at sel_opt into r_carrid_line.&lt;/P&gt;&lt;P&gt;append r_carrid_line to r_carrid.&lt;/P&gt;&lt;P&gt;endloop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now if you want to send the data to any function module then this r_carrid is useful since you cannot send SELECT-OPTIONS directly.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Sesh&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 31 Jan 2007 10:57:06 GMT</pubDate>
    <dc:creator>seshatalpasai_madala</dc:creator>
    <dc:date>2007-01-31T10:57:06Z</dc:date>
    <item>
      <title>Doubt about RANGES</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/doubt-about-ranges/m-p/1827237#M352812</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi all.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1) I need list out which records already exits in database table (ALV report) depending upon user input(screen has 5 input field like Empno,Brance,job,joining date,Dob) by one single select statement.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2) please give some idea abt  RANGES &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;&lt;P&gt;Jay.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 31 Jan 2007 10:05:33 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/doubt-about-ranges/m-p/1827237#M352812</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-01-31T10:05:33Z</dc:date>
    </item>
    <item>
      <title>Re: Doubt about RANGES</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/doubt-about-ranges/m-p/1827238#M352813</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;ranges are like select-option only you have to define it programmitacly&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ranges : r_matnr for mara-matnr.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;r-matnr-sign = 'I'.&lt;/P&gt;&lt;P&gt;R_MATNR-OPTION = 'EQ'.&lt;/P&gt;&lt;P&gt;R_MATNR-LOW = '004500'.&lt;/P&gt;&lt;P&gt;APPEND R_MATNR.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LIKE THIS YOU HAVE TO USE SAME WAY IN SELECT QUERY ALSO.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;BUT THE DIFFERENCE IT WILL NOT APPEAR AT THE SELECTION SCREEN. SO USER CANNOT GIVE THE INPUT BUT YOU HAVE TO SPECIFY VALUE IN YOUR PROGRAM ITSELF.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 31 Jan 2007 10:10:34 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/doubt-about-ranges/m-p/1827238#M352813</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-01-31T10:10:34Z</dc:date>
    </item>
    <item>
      <title>Re: Doubt about RANGES</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/doubt-about-ranges/m-p/1827239#M352814</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;well it wont work.&lt;/P&gt;&lt;P&gt;if you need to list out all the records matching your selection criteria which already are in DB, you cant use a SELECT SINGLE since it only will give you ecactly one record, or even zero.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Ranges are internal tables with a special definition.&lt;/P&gt;&lt;P&gt;the have 4 fields, Sign, Option, Low, High.&lt;/P&gt;&lt;P&gt;Sign stores the operator you want to use to compare records, while option stores the compare method like "&amp;lt;" or "NE" or "CS".&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 31 Jan 2007 10:11:58 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/doubt-about-ranges/m-p/1827239#M352814</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-01-31T10:11:58Z</dc:date>
    </item>
    <item>
      <title>Re: Doubt about RANGES</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/doubt-about-ranges/m-p/1827240#M352815</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;1) I think what you need to check is execute the select statement and then use sy-dbcnt to find out the number of records returned. Then you can check aginst the number of records you are expecting may be size of the select options.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2) RANGES is used to create a data structure similar to the one created by SELECT-OPTIONS. Only difference is you will not have any screen fields.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can also use TYPE RANGE OF instead of RANGES.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Sesh&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 31 Jan 2007 10:19:39 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/doubt-about-ranges/m-p/1827240#M352815</guid>
      <dc:creator>seshatalpasai_madala</dc:creator>
      <dc:date>2007-01-31T10:19:39Z</dc:date>
    </item>
    <item>
      <title>Re: Doubt about RANGES</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/doubt-about-ranges/m-p/1827241#M352816</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Sesh,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Could you send me the sample code for RANGES  with SELECT-OPTIONS.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Rajesh&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 31 Jan 2007 10:44:39 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/doubt-about-ranges/m-p/1827241#M352816</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-01-31T10:44:39Z</dc:date>
    </item>
    <item>
      <title>Re: Doubt about RANGES</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/doubt-about-ranges/m-p/1827242#M352817</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;         DATA: spfli_wa TYPE spfli, &lt;/P&gt;&lt;P&gt;      r_carrid TYPE RANGE OF spfli-carrid, &lt;/P&gt;&lt;P&gt;      r_carrid_line LIKE LINE OF r_carrid. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECT-OPTIONS: sel_opt for  spfli-carrid.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;loop at sel_opt into r_carrid_line.&lt;/P&gt;&lt;P&gt;append r_carrid_line to r_carrid.&lt;/P&gt;&lt;P&gt;endloop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now if you want to send the data to any function module then this r_carrid is useful since you cannot send SELECT-OPTIONS directly.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Sesh&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 31 Jan 2007 10:57:06 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/doubt-about-ranges/m-p/1827242#M352817</guid>
      <dc:creator>seshatalpasai_madala</dc:creator>
      <dc:date>2007-01-31T10:57:06Z</dc:date>
    </item>
    <item>
      <title>Re: Doubt about RANGES</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/doubt-about-ranges/m-p/1827243#M352818</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi&lt;/P&gt;&lt;P&gt;good&lt;/P&gt;&lt;P&gt;&lt;/P&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 : &lt;/P&gt;&lt;P&gt;-&lt;/P&gt;&lt;HR originaltext="----------------------------------------" /&gt;&lt;P&gt; &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.               " It specifies the range starting value. &lt;/P&gt;&lt;P&gt;VENDOR-HIGH    =   2000.               " It specifies the range ending value. &lt;/P&gt;&lt;P&gt;VENDOR-OPTION  =  'BT'.                " specifies ranges value is in between. &lt;/P&gt;&lt;P&gt;VENDOR-SIGN      = 'I'.                     "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;- - - - &lt;/P&gt;&lt;P&gt;- - - - &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;&lt;/P&gt;&lt;P&gt;Eg. to RANGES: &lt;/P&gt;&lt;P&gt;-&lt;/P&gt;&lt;HR originaltext="------------------------" /&gt;&lt;P&gt; &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;- - - -  &lt;/P&gt;&lt;P&gt;- - - -- &lt;/P&gt;&lt;P&gt;- - - -  &lt;/P&gt;&lt;P&gt;&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;&lt;/P&gt;&lt;P&gt;Here with RANGES  user has to design an internal table with fields -  &lt;/P&gt;&lt;P&gt;SIGN,OPTION,LOW and HIGH EXPLICITLY. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-&lt;/P&gt;&lt;HR originaltext="--------------------------------------------------------------------------------------------------------" /&gt;&lt;P&gt;&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 'ABFI' 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;  SIGN(1)    type c, &lt;/P&gt;&lt;P&gt;  OPTION(2) type c, &lt;/P&gt;&lt;P&gt;  LOW         like bukrs, &lt;/P&gt;&lt;P&gt;  HIGH         like bukrs, &lt;/P&gt;&lt;P&gt;end of bukrs. &lt;/P&gt;&lt;P&gt;  &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'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'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 = 'E'.             "Exclude &lt;/P&gt;&lt;P&gt;bukrs-option = 'CP'.        "Pattern &lt;/P&gt;&lt;P&gt;bukrs-low = 'AB*'.            "Low Value &lt;/P&gt;&lt;P&gt;bukrs-high = ''.                "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;&lt;/P&gt;&lt;P&gt;-&lt;/P&gt;&lt;HR originaltext="--------------------------------------------------------------------------------------------------------" /&gt;&lt;P&gt;&amp;gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What does SIGN "I" &amp;amp; "E" mean? &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The "I" stands for Include, and the "E" 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;           matnr-option, &lt;/P&gt;&lt;P&gt;           matnr-low, &lt;/P&gt;&lt;P&gt;           matnr-high. &lt;/P&gt;&lt;P&gt;endloop. &lt;/P&gt;&lt;P&gt;  &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;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanks&lt;/P&gt;&lt;P&gt;mrutyun^&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 31 Jan 2007 11:51:45 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/doubt-about-ranges/m-p/1827243#M352818</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-01-31T11:51:45Z</dc:date>
    </item>
  </channel>
</rss>

