<?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: Comparing Dates in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/comparing-dates/m-p/4014919#M959334</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi everybody,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;          Can we do date calculations like normal numeric calculations. Will symbols like &amp;gt;, &amp;lt; ,+, _ work for dates as just normal numrics...&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;                      Ram.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 23 Jun 2008 07:18:39 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2008-06-23T07:18:39Z</dc:date>
    <item>
      <title>Comparing Dates</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/comparing-dates/m-p/4014913#M959328</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 have a period of dates in my internal table as start date and end date. i need to compare these dates with the period dates of the selection screen.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;for example, whether these start and end dates are in between the selection screen dates(also have two dates, start and end).&lt;/P&gt;&lt;P&gt;Depend on that i need to calculate teh duration.To do this, do i have any Function modules or just i have to follow normal date calculations.Pls suggest me.&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;                  Ram.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 23 Jun 2008 06:34:05 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/comparing-dates/m-p/4014913#M959328</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-06-23T06:34:05Z</dc:date>
    </item>
    <item>
      <title>Re: Comparing Dates</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/comparing-dates/m-p/4014914#M959329</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;just go for normal date calculations...&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 23 Jun 2008 06:36:53 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/comparing-dates/m-p/4014914#M959329</guid>
      <dc:creator>kesavadas_thekkillath</dc:creator>
      <dc:date>2008-06-23T06:36:53Z</dc:date>
    </item>
    <item>
      <title>Re: Comparing Dates</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/comparing-dates/m-p/4014915#M959330</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Ram,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;   You have to go for normal comparisions as we do for comparing any numerci values.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Najmuddin.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 23 Jun 2008 06:39:07 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/comparing-dates/m-p/4014915#M959330</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-06-23T06:39:07Z</dc:date>
    </item>
    <item>
      <title>Re: Comparing Dates</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/comparing-dates/m-p/4014916#M959331</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Try these FMs:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;ISM_SD_DATE_BETWEEN_TO_RANGE&lt;/STRONG&gt; ,&lt;STRONG&gt;FIMA_DAYS_BETWEEN_TWO_DATES&lt;/STRONG&gt;,&lt;STRONG&gt;FIMA_DAYS_BETWEEN_TWO_DATES_2&lt;/STRONG&gt;,&lt;STRONG&gt;LAGF_DAYS_BETWEEN_2_DATES_GET&lt;/STRONG&gt;,&lt;STRONG&gt;DAYS_BETWEEN_TWO_DATES&lt;/STRONG&gt;,&lt;STRONG&gt;HR_99S_INTERVAL_BETWEEN_DATES&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 23 Jun 2008 06:39:11 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/comparing-dates/m-p/4014916#M959331</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-06-23T06:39:11Z</dc:date>
    </item>
    <item>
      <title>Re: Comparing Dates</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/comparing-dates/m-p/4014917#M959332</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;1.To get a date from a given date +/- period. Input : Date &amp;amp; Period (No. of Days) Output : Calculated Date&lt;/P&gt;&lt;P&gt;Please go through the Function Module "RELATIVE_DATE_CALCULATE". Remember to enter the date in 'yyyymmdd' format in the start date field.&lt;/P&gt;&lt;P&gt;2.if the days variable is integer and other 2 like sy-datum, the math below yields the number of days to yo.. start date = '23.07.2003' End date = '23.09.2003' Days = enddate - Start date.&lt;/P&gt;&lt;P&gt;3. Please go through the Functions Module , it gives date as well as time difference, though U may have to enter time as well. SD_DATETIME_DIFFERENCE&lt;/P&gt;&lt;P&gt;4. with this FM you can get dates between two dates : Function Module RP_CALC_DATE_IN_INTERVAL 5. go into SE37 and search on 'difference between dates', one of these 3 keywords or a combination between the 3 will give you a function module.&lt;/P&gt;&lt;P&gt;6. Date Upper &amp;amp; Lower limit: the lower is obviously the 1st of the month. To get the upper use function module END_OF_MONTH_DETERMINE.&lt;/P&gt;&lt;P&gt;7. to get the logon user setting date dynamically : Using offsets move it into a date field,obviously in the format yyyymmdd. then move it into a char(10) field. U get the data in char(10) using the current user's setting. ex:: w_date type d value '20030822', w_char(10). say logon user setting is mm/dd/yyyy. write w_date to w_char. w_char will have the value 08/22/2003.&lt;/P&gt;&lt;P&gt;You can use the result of the move stmt in bdc table.&lt;/P&gt;&lt;P&gt;8. Check this FM "/SAPDMC/LSM_DATE_CONVERT "&lt;/P&gt;&lt;P&gt;9.statements: 1. CONVERT DATE f1 INTO INVERTED-DATE f2. 2. CONVERT INVERTED-DATE f1 INTO DATE f2.&lt;/P&gt;&lt;P&gt;Calculates the nine's complement of the internal date format (YYYYMMDD - for more information about internal display, meaning and initial values of types and places it in the field f2.&lt;/P&gt;&lt;P&gt;For example, 19950511 ==&amp;gt; 80049488 or 80049488 ==&amp;gt; 19950511.&lt;/P&gt;&lt;P&gt;In the inverse date format, the most recent date has the numerically smallest value. You can make use of this effect when sorting dates.&lt;/P&gt;&lt;P&gt;10. GET TIME STAMP : returns the timestamp in short or long form. The short form contains the current date and time : DATA: s_tst TYPE timestamp, l_tst TYPE timstampl, tzone TYPE timezone. GET TIME STAMP FIELD s_tst. "Short form GET TIME STAMP FIELD l_tst. "Long form tzone = 'UTC '. "Time zone WRITE: / s_tst TIME ZONE tzone, / l_tst TIME ZONE tzone.&lt;/P&gt;&lt;P&gt;Then, The short form might then contain the value 19980204163520, while the long form has the value 19980204163520,1234560.&lt;/P&gt;&lt;P&gt;The time stamp can be converted by using CONVERT TIME STAMP and CONVERT DATE&lt;/P&gt;&lt;P&gt;11.Some system fields: DATLO Local date for user DATUT Global date related to UTC (GMT) TSTLO Timestamp (date and time) for user TSTUT Timestamp (date and time) related to UTC (GMT)&lt;/P&gt;&lt;P&gt;12. Check the site &lt;A href="http://funciones.sapabap.cc" target="test_blank"&gt;http://funciones.sapabap.cc&lt;/A&gt; for functions like DATE_CHECK_PLAUSIBILITY Check to see if a date is in a valid format for SAP.&lt;/P&gt;&lt;P&gt;Works well when validating dates being passed in from other systems.&lt;/P&gt;&lt;P&gt;DATE_COMPUTE_DAY Returns a number indicating what day of the week the date falls on. Monday is returned as a 1, Tuesday as 2, etc.&lt;/P&gt;&lt;P&gt;DATE_GET_WEEK will return the week that a date is in.&lt;/P&gt;&lt;P&gt;DATE_IN_FUTURE Calculate a date N days in the future.&lt;/P&gt;&lt;P&gt;DAY_ATTRIBUTES_GET Return useful information about a day. Will tell you the day of the week as a word (Tuesday), the day of the week (2 would be Tuesday), whether the day is a holiday, and more.&lt;/P&gt;&lt;P&gt;F4_DATE for popping up calendar for date help on value request&lt;/P&gt;&lt;P&gt;RH_GET_DATE_DAYNAME return the day based on the date provided&lt;/P&gt;&lt;P&gt;RP_CALC_DATE_IN_INTERVAL Add/subtract years/months/days from a date&lt;/P&gt;&lt;P&gt;RP_LAST_DAY_OF_MONTHS Determine last day of month&lt;/P&gt;&lt;P&gt;WEEK_GET_FIRST_DAY For a given week (YYYYMM format), this function returns the date of the Monday of that week.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 23 Jun 2008 06:41:05 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/comparing-dates/m-p/4014917#M959332</guid>
      <dc:creator>former_member156446</dc:creator>
      <dc:date>2008-06-23T06:41:05Z</dc:date>
    </item>
    <item>
      <title>Re: Comparing Dates</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/comparing-dates/m-p/4014918#M959333</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;     You can compare them normally with simple logic as below, remove the unwanted records from the internal table those not satisfied with your condition.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For ex:  &lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Loop at ITAB where start_date &amp;lt;Conditional Operator&amp;gt; P_start_date&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;and end_date &amp;lt;Conditional Operator&amp;gt;  P_end_date.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;--&amp;gt; Do Operations here.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;endloop.&lt;/STRONG&gt;&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;Ravi&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 23 Jun 2008 06:44:45 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/comparing-dates/m-p/4014918#M959333</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-06-23T06:44:45Z</dc:date>
    </item>
    <item>
      <title>Re: Comparing Dates</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/comparing-dates/m-p/4014919#M959334</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi everybody,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;          Can we do date calculations like normal numeric calculations. Will symbols like &amp;gt;, &amp;lt; ,+, _ work for dates as just normal numrics...&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;                      Ram.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 23 Jun 2008 07:18:39 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/comparing-dates/m-p/4014919#M959334</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-06-23T07:18:39Z</dc:date>
    </item>
    <item>
      <title>Re: Comparing Dates</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/comparing-dates/m-p/4014920#M959335</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yes you can work as normally... observe the result when you add, subtract...&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 23 Jun 2008 07:21:19 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/comparing-dates/m-p/4014920#M959335</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-06-23T07:21:19Z</dc:date>
    </item>
    <item>
      <title>Re: Comparing Dates</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/comparing-dates/m-p/4014921#M959336</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;Yes we can compare dates as normal numeric data.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;See if this approach work in your case.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;example:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;loop at itab into wa_itab.

select ...........
........
from table..
into itab1.
where p_date_start =  wa_itab-date-start
and p_date_end =  wa_itab-date_end. 

endloop.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this helps you.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;plz reward if useful.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanks,&lt;/P&gt;&lt;P&gt;dhanashri.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 23 Jun 2008 07:28:17 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/comparing-dates/m-p/4014921#M959336</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-06-23T07:28:17Z</dc:date>
    </item>
  </channel>
</rss>

