<?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 Comparing date ranges. in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/comparing-date-ranges/m-p/7980273#M1604613</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;Need your guys advice how to compare two date ranges,&lt;/P&gt;&lt;P&gt;As my code snippet show below, those date can not be compare even Date1 is within the range of Date2 logically...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any guide and insight i appreciate it alot.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;.
RANGES : date1 FOR p0001-begda,
         date2 FOR p0001-endda.

date1-sign = 'I'.
date1-option = 'BT'.
date1-low = '20110101'.
date1-high = '20110808'.
APPEND date1.

date2-sign = 'I'.
date2-option = 'BT'.
date2-low = '20110101'.
date2-high = '20110808'.
APPEND date2.

IF date1 IN date2 .

  WRITE:/ 'with in date range'.
  SKIP 2.
ENDIF.

&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 16 Jun 2011 02:10:06 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2011-06-16T02:10:06Z</dc:date>
    <item>
      <title>Comparing date ranges.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/comparing-date-ranges/m-p/7980273#M1604613</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;Need your guys advice how to compare two date ranges,&lt;/P&gt;&lt;P&gt;As my code snippet show below, those date can not be compare even Date1 is within the range of Date2 logically...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any guide and insight i appreciate it alot.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;.
RANGES : date1 FOR p0001-begda,
         date2 FOR p0001-endda.

date1-sign = 'I'.
date1-option = 'BT'.
date1-low = '20110101'.
date1-high = '20110808'.
APPEND date1.

date2-sign = 'I'.
date2-option = 'BT'.
date2-low = '20110101'.
date2-high = '20110808'.
APPEND date2.

IF date1 IN date2 .

  WRITE:/ 'with in date range'.
  SKIP 2.
ENDIF.

&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Jun 2011 02:10:06 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/comparing-date-ranges/m-p/7980273#M1604613</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-06-16T02:10:06Z</dc:date>
    </item>
    <item>
      <title>Re: Comparing date ranges.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/comparing-date-ranges/m-p/7980274#M1604614</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;  Change the code like this..&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
if date1-low GE  date2-low and date1-low LE date2-high.
WRITE:/ 'with in date range'.
  SKIP 2.
else.
write: / 'not in the range'.
endif.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Dhina..&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Jun 2011 04:04:10 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/comparing-date-ranges/m-p/7980274#M1604614</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-06-16T04:04:10Z</dc:date>
    </item>
    <item>
      <title>Re: Comparing date ranges.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/comparing-date-ranges/m-p/7980275#M1604615</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;Please find below FM.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;U can give begindate and enddate then u get the differences.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;HR_99S_INTERVAL_BETWEEN_DATES&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks$ Regards.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;MURALII&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Jun 2011 04:25:43 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/comparing-date-ranges/m-p/7980275#M1604615</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-06-16T04:25:43Z</dc:date>
    </item>
    <item>
      <title>Re: Comparing date ranges.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/comparing-date-ranges/m-p/7980276#M1604616</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;   I think only single values can be compared with ranges and not the entire range.&lt;/P&gt;&lt;P&gt;   Instead loop at the first range and check if the dates lies in between the other range.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;   loop at date1.&lt;/P&gt;&lt;P&gt;     if date1-low in date2 and date1-high in date2.&lt;/P&gt;&lt;P&gt;     *your coding.&lt;/P&gt;&lt;P&gt;    else.&lt;/P&gt;&lt;P&gt;    *coding&lt;/P&gt;&lt;P&gt;    endif.&lt;/P&gt;&lt;P&gt;   endloop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Srini.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Jun 2011 04:46:05 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/comparing-date-ranges/m-p/7980276#M1604616</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-06-16T04:46:05Z</dc:date>
    </item>
    <item>
      <title>Re: Comparing date ranges.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/comparing-date-ranges/m-p/7980277#M1604617</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;try the following&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
RANGES : date1 FOR p0001-begda,
         date2 FOR p0001-endda.
 
date1-sign = 'I'.
date1-option = 'BT'.
date1-low = '20110101'.
date1-high = '20110808'.
APPEND date1.
 
date2-sign = 'I'.
date2-option = 'BT'.
date2-low = '20110101'.
date2-high = '20110808'.
APPEND date2.
 &lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;use any one&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
if date1-low GE  date2-low and date1-high LE date2-high.
or
if date1-low in date2-low and date1-high in date2-high.
 &lt;/CODE&gt;&lt;/PRE&gt;&lt;PRE&gt;&lt;CODE&gt;
 WRITE:/ 'with in date range'.
else.
write: / 'out of date range'.
ENDIF. 

&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;or&lt;/P&gt;&lt;P&gt; use this fm to calculate the date range  HR_99S_INTERVAL_BETWEEN_DATES&lt;/P&gt;&lt;P&gt;here if the result is greater that the actual range then write: out of  date range&lt;/P&gt;&lt;P&gt;else if the result is less than or equal to actual range then write: with in range.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;NOTE:  for this second method actual range refers to the difference of dates calculated by you manually.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So i suggest try the first code.&lt;/P&gt;&lt;P&gt;hope it solves your purpose.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanks and regards,&lt;/P&gt;&lt;P&gt;koolspy.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Jun 2011 04:53:38 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/comparing-date-ranges/m-p/7980277#M1604617</guid>
      <dc:creator>koolspy_ultimate</dc:creator>
      <dc:date>2011-06-16T04:53:38Z</dc:date>
    </item>
    <item>
      <title>Re: Comparing date ranges.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/comparing-date-ranges/m-p/7980278#M1604618</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;For comparing single date:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if date1-LOW GE date2-low AND date1-LOW LE date2-high.&lt;/P&gt;&lt;P&gt;   ...............&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;for comparing range of dates.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if date1-LOW GE date2-low AND date1-HIGH LE date2-high.&lt;/P&gt;&lt;P&gt;...........&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Jun 2011 05:13:42 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/comparing-date-ranges/m-p/7980278#M1604618</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-06-16T05:13:42Z</dc:date>
    </item>
  </channel>
</rss>

