<?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: Finding a function to get leap year in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/finding-a-function-to-get-leap-year/m-p/1354191#M177083</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Here is some code that I had in my bag of tricks.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;

report zrich_0001 .
parameters: p_datum type  sy-datum.
* check if it is a leap year.
data: march1 type sy-datum.
data: last_day_feb type sy-datum.

march1 = p_datum.
march1+4(4) = '0301'.
last_day_feb = march1 - 1.
if last_day_feb+6(2) = '29'. 
 write:/ 'This is a leap year'.
endif.

&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>Thu, 01 Jun 2006 17:11:43 GMT</pubDate>
    <dc:creator>RichHeilman</dc:creator>
    <dc:date>2006-06-01T17:11:43Z</dc:date>
    <item>
      <title>Finding a function to get leap year</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/finding-a-function-to-get-leap-year/m-p/1354187#M177079</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;I need a function or code to find  if a year is  leap year or normal year.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks a lot of!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 01 Jun 2006 16:59:19 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/finding-a-function-to-get-leap-year/m-p/1354187#M177079</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-06-01T16:59:19Z</dc:date>
    </item>
    <item>
      <title>Re: Finding a function to get leap year</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/finding-a-function-to-get-leap-year/m-p/1354188#M177080</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I don't know of one - but it is quite an easy calculation so you could maybe write your own.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;A year will be a leap year if it is divisible by 4 but not by 100. If a year is divisible by 4 and by 100, it is not a leap year unless it is also divisible by 400.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Message was edited by: Barbara McCallum&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 01 Jun 2006 17:02:59 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/finding-a-function-to-get-leap-year/m-p/1354188#M177080</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-06-01T17:02:59Z</dc:date>
    </item>
    <item>
      <title>Re: Finding a function to get leap year</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/finding-a-function-to-get-leap-year/m-p/1354189#M177081</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 check the below FM, to get days between 2 dates.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can use the logic behind to build Z FM if this is not as per your requirement.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FIMA_LEAP_DAYS_BETWEEN_2_DATES &lt;/P&gt;&lt;P&gt;LEAP_DAYS_BETWEEN_TWO_DATES   &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regds&lt;/P&gt;&lt;P&gt;Manohar&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 01 Jun 2006 17:04:32 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/finding-a-function-to-get-leap-year/m-p/1354189#M177081</guid>
      <dc:creator>Manohar2u</dc:creator>
      <dc:date>2006-06-01T17:04:32Z</dc:date>
    </item>
    <item>
      <title>Re: Finding a function to get leap year</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/finding-a-function-to-get-leap-year/m-p/1354190#M177082</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;PL check this &lt;A class="jive_macro jive_macro_message" href="https://community.sap.com/" __jive_macro_name="message" modifiedtitle="true" __default_attr="1650454"&gt;&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Suresh Datti&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 01 Jun 2006 17:08:16 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/finding-a-function-to-get-leap-year/m-p/1354190#M177082</guid>
      <dc:creator>suresh_datti</dc:creator>
      <dc:date>2006-06-01T17:08:16Z</dc:date>
    </item>
    <item>
      <title>Re: Finding a function to get leap year</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/finding-a-function-to-get-leap-year/m-p/1354191#M177083</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Here is some code that I had in my bag of tricks.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;

report zrich_0001 .
parameters: p_datum type  sy-datum.
* check if it is a leap year.
data: march1 type sy-datum.
data: last_day_feb type sy-datum.

march1 = p_datum.
march1+4(4) = '0301'.
last_day_feb = march1 - 1.
if last_day_feb+6(2) = '29'. 
 write:/ 'This is a leap year'.
endif.

&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>Thu, 01 Jun 2006 17:11:43 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/finding-a-function-to-get-leap-year/m-p/1354191#M177083</guid>
      <dc:creator>RichHeilman</dc:creator>
      <dc:date>2006-06-01T17:11:43Z</dc:date>
    </item>
  </channel>
</rss>

