<?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: Select a range in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-a-range/m-p/1828774#M353397</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&amp;gt; can I add other&lt;/P&gt;&lt;P&gt;&amp;gt; requirements on the select statement like normal?  I&lt;/P&gt;&lt;P&gt;&amp;gt; assume I can.    &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Yes you can &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;gt; doing a select off the table VBRP_VRPMA but that is a&lt;/P&gt;&lt;P&gt;&amp;gt; joined table.  Can I treat this table like any other&lt;/P&gt;&lt;P&gt;&amp;gt; table? &lt;/P&gt;&lt;P&gt;Yes u can.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Aaron, by 5 largest and consecutive shipping days what do you exactly mean? Can you illustrate your requirement with sample data?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 15 Jan 2007 21:14:45 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2007-01-15T21:14:45Z</dc:date>
    <item>
      <title>Select a range</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-a-range/m-p/1828768#M353391</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;How do I select a range of values?  For instance, I need to write a select statement that, among others, selects documents based on a date range.  What I am doing is trying to pick billing documents that have a billing date within the last 365 days.  Also I need to figure out a way (an easy way) to determine if a particular day is a weekend.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Aaron&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 15 Jan 2007 21:01:20 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-a-range/m-p/1828768#M353391</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-01-15T21:01:20Z</dc:date>
    </item>
    <item>
      <title>Re: Select a range</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-a-range/m-p/1828769#M353392</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Aaron,  for you first requirement,  you can simply use a RANGE.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;Ranges:  r_datum for sy-datum.

r_datum-sign = 'I'.
r_datum-optin = 'BT'.
r_datum-low = sy-datum - 365.
r_datum-high = sy-datum.
append r_datum.


select * into table itab
                  from ztab
                           where datum in r_datum.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Rich Heilman&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 15 Jan 2007 21:04:29 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-a-range/m-p/1828769#M353392</guid>
      <dc:creator>RichHeilman</dc:creator>
      <dc:date>2007-01-15T21:04:29Z</dc:date>
    </item>
    <item>
      <title>Re: Select a range</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-a-range/m-p/1828770#M353393</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Aaron&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data: YearAgo like sy-datum.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;YearAgo = sy-datum - 365.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select * from SomeTable into i_table&lt;/P&gt;&lt;P&gt;   where BillDate &amp;gt;= YearAgo&lt;/P&gt;&lt;P&gt;   and BillDate &amp;lt;= sy-datum.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 15 Jan 2007 21:04:40 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-a-range/m-p/1828770#M353393</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-01-15T21:04:40Z</dc:date>
    </item>
    <item>
      <title>Re: Select a range</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-a-range/m-p/1828771#M353394</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;For your second requirement, you can use the function module DATE_TO_DAY to convert each date to the week day.  Then you can check the return value for  'Sat.'  or 'Sunday'.  &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;REgards,&lt;/P&gt;&lt;P&gt;Rich Heilman&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 15 Jan 2007 21:07:14 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-a-range/m-p/1828771#M353394</guid>
      <dc:creator>RichHeilman</dc:creator>
      <dc:date>2007-01-15T21:07:14Z</dc:date>
    </item>
    <item>
      <title>Re: Select a range</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-a-range/m-p/1828772#M353395</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;RANGES: s_date FOR ekko-aedat.&lt;/P&gt;&lt;P&gt;DATA: lv_day TYPE scal-indicator.&lt;/P&gt;&lt;P&gt;s_date-high = sy-datum.&lt;/P&gt;&lt;P&gt;s_date-low = sy-datum - 365.&lt;/P&gt;&lt;P&gt;s_date-option = 'BT'.&lt;/P&gt;&lt;P&gt;s_date-sign = 'I'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;APPEND s_date.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA: t_ekko TYPE STANDARD TABLE OF ekko.&lt;/P&gt;&lt;P&gt;SELECT * FROM ekko&lt;/P&gt;&lt;P&gt;       INTO TABLE t_ekko&lt;/P&gt;&lt;P&gt;       WHERE aedat IN s_date.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CALL FUNCTION 'DATE_COMPUTE_DAY'&lt;/P&gt;&lt;P&gt;  EXPORTING&lt;/P&gt;&lt;P&gt;    date = sy-datum&lt;/P&gt;&lt;P&gt;  IMPORTING&lt;/P&gt;&lt;P&gt;    day  = lv_day.&lt;/P&gt;&lt;P&gt;IF sy-subrc = 0.&lt;/P&gt;&lt;P&gt;ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LV_DAY = '6' for saturday and '7' for sunday.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 15 Jan 2007 21:09:08 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-a-range/m-p/1828772#M353395</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-01-15T21:09:08Z</dc:date>
    </item>
    <item>
      <title>Re: Select a range</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-a-range/m-p/1828773#M353396</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Rich,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;First off, thanks for the quick reply.  After I set up the range, as you outlined, can I add other requirements on the select statement like normal?  I assume I can.    One more thing (it&amp;#146;s related).  I am doing a select off the table VBRP_VRPMA but that is a joined table.  Can I treat this table like any other table?  I am attempting to determine the 5 largest, consecutive, shipping days per Mat#.  Do you know of a better way to do this besides going through every billing document one at a time?  Sorry for all of the questions.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 15 Jan 2007 21:10:32 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-a-range/m-p/1828773#M353396</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-01-15T21:10:32Z</dc:date>
    </item>
    <item>
      <title>Re: Select a range</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-a-range/m-p/1828774#M353397</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&amp;gt; can I add other&lt;/P&gt;&lt;P&gt;&amp;gt; requirements on the select statement like normal?  I&lt;/P&gt;&lt;P&gt;&amp;gt; assume I can.    &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Yes you can &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;gt; doing a select off the table VBRP_VRPMA but that is a&lt;/P&gt;&lt;P&gt;&amp;gt; joined table.  Can I treat this table like any other&lt;/P&gt;&lt;P&gt;&amp;gt; table? &lt;/P&gt;&lt;P&gt;Yes u can.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Aaron, by 5 largest and consecutive shipping days what do you exactly mean? Can you illustrate your requirement with sample data?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 15 Jan 2007 21:14:45 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-a-range/m-p/1828774#M353397</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-01-15T21:14:45Z</dc:date>
    </item>
    <item>
      <title>Re: Select a range</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-a-range/m-p/1828775#M353398</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Ok, thanks to all for the wonderful help!  I have one quick addition to this question before I mark it answered.  Right now, as it stands, I have (theoretically) a list of document numbers (with their data) that is in a date range (the last 365).  I then want to restrict the material numbers to certain material groups.  Each time this report is run the material groups will change and it could be one to all material groups.  How would I do a "range" in this instance?  &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Aaron&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 15 Jan 2007 21:25:10 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-a-range/m-p/1828775#M353398</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-01-15T21:25:10Z</dc:date>
    </item>
    <item>
      <title>Re: Select a range</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-a-range/m-p/1828776#M353399</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am not sure i follow your question. You can provide material range as part of the selection screen and then include it in your selection statement..&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 15 Jan 2007 21:27:28 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-a-range/m-p/1828776#M353399</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-01-15T21:27:28Z</dc:date>
    </item>
    <item>
      <title>Re: Select a range</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-a-range/m-p/1828777#M353400</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If the material groups are going to change, I would suggest using a SELECT-OPTION in the selection screen instead of the RANGE.  There is no difference between the two other than the SO, will produce fields on the selection-screen.  So you can put the values in the selection screen as single entries and save this as a screen variant.  Then when the material groups change, you can simply change the variant without having to change the program coding.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Rich HEilman&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 15 Jan 2007 21:30:58 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-a-range/m-p/1828777#M353400</guid>
      <dc:creator>RichHeilman</dc:creator>
      <dc:date>2007-01-15T21:30:58Z</dc:date>
    </item>
    <item>
      <title>Re: Select a range</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-a-range/m-p/1828778#M353401</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Rich.  When I use the SO is each field on the Selection Screen a different variable?  What I'm getting at is how would I put them in a select statement?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 15 Jan 2007 21:33:33 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-a-range/m-p/1828778#M353401</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-01-15T21:33:33Z</dc:date>
    </item>
    <item>
      <title>Re: Select a range</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-a-range/m-p/1828779#M353402</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Say that you want to select data based on one or more material groups.  You would set up the SELECT-OPTION, then on the screen, add the material groups that you want.  Then you just use the IN operator like you did for the RANGE.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;tables: mara.

Select-options: s_matkl for mara-matkl.


select * into table it023
                from t023
                         where matkl in s_matkl.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Rich Heilman&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 15 Jan 2007 21:37:48 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-a-range/m-p/1828779#M353402</guid>
      <dc:creator>RichHeilman</dc:creator>
      <dc:date>2007-01-15T21:37:48Z</dc:date>
    </item>
    <item>
      <title>Re: Select a range</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-a-range/m-p/1828780#M353403</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;you would define a select option (assuming u are selecting from material master)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select-optionS s_matkl for mara-matkl. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECT * from MARA&lt;/P&gt;&lt;P&gt;             where matkl in S_MATKL.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When u define a select option, you can enter multiple values by clicking on the button at the end of your input box.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 15 Jan 2007 21:39:05 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-a-range/m-p/1828780#M353403</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-01-15T21:39:05Z</dc:date>
    </item>
    <item>
      <title>Re: Select a range</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-a-range/m-p/1828781#M353404</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Rich, thank you SO MUCH for your help!  I appreciate the help everybody gave me!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks again,&lt;/P&gt;&lt;P&gt;Aaron&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 15 Jan 2007 21:41:38 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-a-range/m-p/1828781#M353404</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-01-15T21:41:38Z</dc:date>
    </item>
  </channel>
</rss>

