<?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 Future dates.... in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/future-dates/m-p/3936294#M942014</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi friends:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;       I am developing one report...which contains a date in the selection screen....&lt;/P&gt;&lt;P&gt; So now we are in may... , second quarter for this year... so if you enter the any date from may or april or june....&lt;/P&gt;&lt;P&gt; we have to get results for next five qurters...&lt;/P&gt;&lt;P&gt; means....&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt; july-sep,&lt;/P&gt;&lt;P&gt; oct-dec..upto fiev qureters.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;any body suggest me logic or if any function modules...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you , &lt;/P&gt;&lt;P&gt;naveen&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 30 May 2008 09:25:01 GMT</pubDate>
    <dc:creator>naveen_inuganti2</dc:creator>
    <dc:date>2008-05-30T09:25:01Z</dc:date>
    <item>
      <title>Future dates....</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/future-dates/m-p/3936294#M942014</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi friends:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;       I am developing one report...which contains a date in the selection screen....&lt;/P&gt;&lt;P&gt; So now we are in may... , second quarter for this year... so if you enter the any date from may or april or june....&lt;/P&gt;&lt;P&gt; we have to get results for next five qurters...&lt;/P&gt;&lt;P&gt; means....&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt; july-sep,&lt;/P&gt;&lt;P&gt; oct-dec..upto fiev qureters.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;any body suggest me logic or if any function modules...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you , &lt;/P&gt;&lt;P&gt;naveen&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 30 May 2008 09:25:01 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/future-dates/m-p/3936294#M942014</guid>
      <dc:creator>naveen_inuganti2</dc:creator>
      <dc:date>2008-05-30T09:25:01Z</dc:date>
    </item>
    <item>
      <title>Re: Future dates....</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/future-dates/m-p/3936295#M942015</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Do the following:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
PARAMETERS p_date TYPE dats.

RANGES: lr_1 FOR p_date,
        lr_2 FOR p_date,
        lr_3 FOR p_date,
        lr_4 FOR p_date,
        lr_5 FOR p_date.

* get the start date of the current quarter
CASE p_date+4(2).
  WHEN '01' OR '02' OR '03'.
*   this is the first quarter
    lr_1-sign      = 'I'.
    lr_1-option    = 'BT'.
    lr_1-low       = p_date.
    lr_1-low+4(4)  = '0101'.
    lr_1-high      = p_date.
    lr_1-high+4(4) = '0331'.
    APPEND lr_1.
  WHEN '04' OR '05' OR '06'.
*   this is the first quarter
    lr_1-sign      = 'I'.
    lr_1-option    = 'BT'.
    lr_1-low       = p_date.
    lr_1-low+4(4)  = '0401'.
    lr_1-high      = p_date.
    lr_1-high+4(4) = '0630'.
    APPEND lr_1.
  WHEN '07' OR '08' OR '09'.
*   this is the first quarter
    lr_1-sign      = 'I'.
    lr_1-option    = 'BT'.
    lr_1-low       = p_date.
    lr_1-low+4(4)  = '0701'.
    lr_1-high      = p_date.
    lr_1-high+4(4) = '0930'.
    APPEND lr_1.
  WHEN '10' OR '11' OR '12'.
*   this is the first quarter
    lr_1-sign      = 'I'.
    lr_1-option    = 'BT'.
    lr_1-low       = p_date.
    lr_1-low+4(4)  = '1001'.
    lr_1-high      = p_date.
    lr_1-high+4(4) = '1231'.
    APPEND lr_1.
ENDCASE.
* now fill the remaining quarters
lr_2-sign      = 'I'.
lr_2-option    = 'BT'.
lr_2-low       = lr_1-high + 1.
* to get into the third month of the quarter
lr_2-high      = lr_1-high + 70.
* now set the last day of the quarter
CASE lr_2-high+4(2).
  WHEN '03' OR '12'.
    lr_2-high+6(2) = '31'.
  WHEN '06' OR '09'.
    lr_2-high+6(2) = '30'.
ENDCASE.
APPEND lr_2.
* now fill the remaining quarters
lr_3-sign      = 'I'.
lr_3-option    = 'BT'.
lr_3-low       = lr_2-high + 1.
* to get into the third month of the quarter
lr_3-high      = lr_2-high + 70.
* now set the last day of the quarter
CASE lr_3-high+4(2).
  WHEN '03' OR '12'.
    lr_3-high+6(2) = '31'.
  WHEN '06' OR '09'.
    lr_3-high+6(2) = '30'.
ENDCASE.
APPEND lr_3.
* now fill the remaining quarters
lr_4-sign      = 'I'.
lr_4-option    = 'BT'.
lr_4-low       = lr_3-high + 1.
* to get into the third month of the quarter
lr_4-high      = lr_3-high + 70.
* now set the last day of the quarter
CASE lr_4-high+4(2).
  WHEN '03' OR '12'.
    lr_4-high+6(2) = '31'.
  WHEN '06' OR '09'.
    lr_4-high+6(2) = '30'.
ENDCASE.
APPEND lr_4.
* now fill the remaining quarters
lr_5-sign      = 'I'.
lr_5-option    = 'BT'.
lr_5-low       = lr_4-high + 1.
* to get into the third month of the quarter
lr_5-high      = lr_4-high + 70.
* now set the last day of the quarter
CASE lr_5-high+4(2).
  WHEN '03' OR '12'.
    lr_5-high+6(2) = '31'.
  WHEN '06' OR '09'.
    lr_5-high+6(2) = '30'.
ENDCASE.
APPEND lr_5.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This will fill five ranges (one for each subsequent quarter) which you can use to select your data&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select * from xxxxx&lt;/P&gt;&lt;P&gt;          into table yyyy1&lt;/P&gt;&lt;P&gt;          where date_field in lr_1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select * from xxxxx&lt;/P&gt;&lt;P&gt;          into table yyyy2&lt;/P&gt;&lt;P&gt;          where date_field in lr_1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;etc.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope that helps,&lt;/P&gt;&lt;P&gt;Michael&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 30 May 2008 12:23:56 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/future-dates/m-p/3936295#M942015</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-05-30T12:23:56Z</dc:date>
    </item>
  </channel>
</rss>

