<?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 Incorrect month value between 2 dates with Function Module FIMA_DAYS_AND_MONTHS_AND_YEARS in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/incorrect-month-value-between-2-dates-with-function-module-fima-days-and/m-p/12380168#M1994139</link>
    <description>&lt;P&gt;Hi all,&lt;/P&gt;
  &lt;P&gt;I´m using the SAP standard Function Module FIMA_DAYS_AND_MONTHS_AND_YEARS to calculate the difference in months between two dates.&lt;/P&gt;
  &lt;P&gt;While calculating the month difference with input parameter I_DATE_FROM as 28.02. (in case of not a leap year, e.g. 2021, 2022, 2023) or 29.02 (in case of a leap year, e.g. 2016, 2020, etc.) and 31.03 as an I_DATE_TO input parameter I´m facing the not as expected result for the export parameter E_MONTHS. With 30.03. as example I_DATE_TO the month value is calculated as expected.&lt;/P&gt;
  &lt;P&gt;&lt;STRONG&gt;1.) Not a leap year case:&lt;/STRONG&gt;&lt;/P&gt;
  &lt;P&gt;&lt;EM&gt;1a) Positive Example (as expected):&lt;BR /&gt;&lt;/EM&gt;&lt;/P&gt;
  &lt;P&gt;- I_DATE_FROM: 28.02.2021&lt;BR /&gt;- I_DATE_TO: 30.03.2021&lt;EM&gt;&lt;BR /&gt;&lt;/EM&gt;- E_MONTHS: 2 (as expected)&lt;EM&gt;&lt;BR /&gt;&lt;/EM&gt;- I_FLG_ROUND_UP: X&lt;EM&gt;&lt;BR /&gt;&lt;/EM&gt;&lt;/P&gt;
  &lt;P&gt;&lt;IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/attachments/storage/7/attachments/1896534-iva7f.png" /&gt;&lt;/P&gt;
  &lt;P&gt;&lt;EM&gt;1b) Negative Example (not as expected):&lt;BR /&gt;&lt;/EM&gt;&lt;/P&gt;
  &lt;P&gt;- I_DATE_FROM: 28.02.2021&lt;BR /&gt;- I_DATE_TO: 31.03.2021&lt;BR /&gt;- E_MONTHS: 1 (not as as expected, instead 2 months are expected)&lt;BR /&gt;- I_FLG_ROUND_UP: X&lt;/P&gt;
  &lt;P&gt;&lt;IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/attachments/storage/7/attachments/1896536-yzuyb.png" /&gt;&lt;/P&gt;
  &lt;P&gt;&lt;STRONG&gt;2.) Leap year case:&lt;BR /&gt;&lt;/STRONG&gt;&lt;/P&gt;
  &lt;P&gt;&lt;EM&gt;2a) Positive Example (as expected):&lt;BR /&gt;&lt;/EM&gt;&lt;/P&gt;
  &lt;P&gt;- I_DATE_FROM: 29.02.2020&lt;BR /&gt;- I_DATE_TO: 30.03.2020&lt;BR /&gt;- E_MONTHS: 2 (as expected)&lt;BR /&gt;- I_FLG_ROUND_UP: X&lt;/P&gt;
  &lt;P&gt;&lt;STRONG&gt;&lt;/STRONG&gt;&lt;/P&gt;
  &lt;P&gt;&lt;IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/attachments/storage/7/attachments/1896535-swtjn.png" /&gt;&lt;/P&gt;
  &lt;P&gt;&lt;EM&gt;2b) Negative Example (not as expected):&lt;BR /&gt;&lt;/EM&gt;&lt;/P&gt;
  &lt;P&gt;- I_DATE_FROM: 29.02.2020&lt;BR /&gt;- I_DATE_TO: 31.03.2020&lt;BR /&gt;- E_MONTHS: 1 (not as as expected, instead 2 months are expected)&lt;BR /&gt;- I_FLG_ROUND_UP: X&lt;/P&gt;
  &lt;P&gt;&lt;IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/attachments/storage/7/attachments/1896537-ihgim.png" /&gt;&lt;/P&gt;
  &lt;P&gt;Any ideas?&lt;/P&gt;
  &lt;P&gt;Thank you in advance.&lt;/P&gt;
  &lt;P&gt;Best regards,&lt;BR /&gt;Michael&lt;/P&gt;</description>
    <pubDate>Sat, 27 Feb 2021 21:20:04 GMT</pubDate>
    <dc:creator>former_member665091</dc:creator>
    <dc:date>2021-02-27T21:20:04Z</dc:date>
    <item>
      <title>Incorrect month value between 2 dates with Function Module FIMA_DAYS_AND_MONTHS_AND_YEARS</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/incorrect-month-value-between-2-dates-with-function-module-fima-days-and/m-p/12380168#M1994139</link>
      <description>&lt;P&gt;Hi all,&lt;/P&gt;
  &lt;P&gt;I´m using the SAP standard Function Module FIMA_DAYS_AND_MONTHS_AND_YEARS to calculate the difference in months between two dates.&lt;/P&gt;
  &lt;P&gt;While calculating the month difference with input parameter I_DATE_FROM as 28.02. (in case of not a leap year, e.g. 2021, 2022, 2023) or 29.02 (in case of a leap year, e.g. 2016, 2020, etc.) and 31.03 as an I_DATE_TO input parameter I´m facing the not as expected result for the export parameter E_MONTHS. With 30.03. as example I_DATE_TO the month value is calculated as expected.&lt;/P&gt;
  &lt;P&gt;&lt;STRONG&gt;1.) Not a leap year case:&lt;/STRONG&gt;&lt;/P&gt;
  &lt;P&gt;&lt;EM&gt;1a) Positive Example (as expected):&lt;BR /&gt;&lt;/EM&gt;&lt;/P&gt;
  &lt;P&gt;- I_DATE_FROM: 28.02.2021&lt;BR /&gt;- I_DATE_TO: 30.03.2021&lt;EM&gt;&lt;BR /&gt;&lt;/EM&gt;- E_MONTHS: 2 (as expected)&lt;EM&gt;&lt;BR /&gt;&lt;/EM&gt;- I_FLG_ROUND_UP: X&lt;EM&gt;&lt;BR /&gt;&lt;/EM&gt;&lt;/P&gt;
  &lt;P&gt;&lt;IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/attachments/storage/7/attachments/1896534-iva7f.png" /&gt;&lt;/P&gt;
  &lt;P&gt;&lt;EM&gt;1b) Negative Example (not as expected):&lt;BR /&gt;&lt;/EM&gt;&lt;/P&gt;
  &lt;P&gt;- I_DATE_FROM: 28.02.2021&lt;BR /&gt;- I_DATE_TO: 31.03.2021&lt;BR /&gt;- E_MONTHS: 1 (not as as expected, instead 2 months are expected)&lt;BR /&gt;- I_FLG_ROUND_UP: X&lt;/P&gt;
  &lt;P&gt;&lt;IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/attachments/storage/7/attachments/1896536-yzuyb.png" /&gt;&lt;/P&gt;
  &lt;P&gt;&lt;STRONG&gt;2.) Leap year case:&lt;BR /&gt;&lt;/STRONG&gt;&lt;/P&gt;
  &lt;P&gt;&lt;EM&gt;2a) Positive Example (as expected):&lt;BR /&gt;&lt;/EM&gt;&lt;/P&gt;
  &lt;P&gt;- I_DATE_FROM: 29.02.2020&lt;BR /&gt;- I_DATE_TO: 30.03.2020&lt;BR /&gt;- E_MONTHS: 2 (as expected)&lt;BR /&gt;- I_FLG_ROUND_UP: X&lt;/P&gt;
  &lt;P&gt;&lt;STRONG&gt;&lt;/STRONG&gt;&lt;/P&gt;
  &lt;P&gt;&lt;IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/attachments/storage/7/attachments/1896535-swtjn.png" /&gt;&lt;/P&gt;
  &lt;P&gt;&lt;EM&gt;2b) Negative Example (not as expected):&lt;BR /&gt;&lt;/EM&gt;&lt;/P&gt;
  &lt;P&gt;- I_DATE_FROM: 29.02.2020&lt;BR /&gt;- I_DATE_TO: 31.03.2020&lt;BR /&gt;- E_MONTHS: 1 (not as as expected, instead 2 months are expected)&lt;BR /&gt;- I_FLG_ROUND_UP: X&lt;/P&gt;
  &lt;P&gt;&lt;IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/attachments/storage/7/attachments/1896537-ihgim.png" /&gt;&lt;/P&gt;
  &lt;P&gt;Any ideas?&lt;/P&gt;
  &lt;P&gt;Thank you in advance.&lt;/P&gt;
  &lt;P&gt;Best regards,&lt;BR /&gt;Michael&lt;/P&gt;</description>
      <pubDate>Sat, 27 Feb 2021 21:20:04 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/incorrect-month-value-between-2-dates-with-function-module-fima-days-and/m-p/12380168#M1994139</guid>
      <dc:creator>former_member665091</dc:creator>
      <dc:date>2021-02-27T21:20:04Z</dc:date>
    </item>
    <item>
      <title>Re: Incorrect month value between 2 dates with Function Module FIMA_DAYS_AND_MONTHS_AND_YEARS</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/incorrect-month-value-between-2-dates-with-function-module-fima-days-and/m-p/12380169#M1994140</link>
      <description>&lt;P&gt;The problem are ultimo days. Additionally you can't supply a day count method. So it automatically decides whether both dates are ultimo. If that is the case the difference is exactly one month (actual/actual). So no need to round up. &lt;/P&gt;&lt;P&gt;If you specify one of the dates as non ultimo the system assumes that you need to calculate from the actual date: 28.02. to 28.03. is one month and to the 30.03. are two more days. Rounded up this result in 2 months difference. &lt;/P&gt;</description>
      <pubDate>Sat, 27 Feb 2021 21:43:54 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/incorrect-month-value-between-2-dates-with-function-module-fima-days-and/m-p/12380169#M1994140</guid>
      <dc:creator>BiberM</dc:creator>
      <dc:date>2021-02-27T21:43:54Z</dc:date>
    </item>
    <item>
      <title>Re: Incorrect month value between 2 dates with Function Module FIMA_DAYS_AND_MONTHS_AND_YEARS</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/incorrect-month-value-between-2-dates-with-function-module-fima-days-and/m-p/12380170#M1994141</link>
      <description>&lt;P&gt;Thanks for the explanation related to the ultimo problem and the recommendation to specify one of the dates as non ultimo day. I added now in my function module in which I´m reusing the function module FIMA_DAYS_AND_MONTHS_AND_YEARS a pre-check with the help of the function module FIMA_END_OF_MONTH_DETERMINE to check if my I_DATE_FROM is a ultimo day (last day of a month), e.g. 29.02.2020, 28.02.2021, etc. If I_DATE_FROM is a ultimo day, specify it as a non ultimo day by subtracting one day, if I_DATE_FROM is not on a ultimo day take it as it is. With specifying I_DATE_FROM as non ultimo day, if it´s as per the check on a ultimo day, the result for E_MONTHS is now, within my function module, with the help of the reused function module FIMA_DAYS_AND_MONTHS_AND_YEARS calculated as expected.&lt;/P&gt;</description>
      <pubDate>Sun, 28 Feb 2021 08:22:03 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/incorrect-month-value-between-2-dates-with-function-module-fima-days-and/m-p/12380170#M1994141</guid>
      <dc:creator>former_member665091</dc:creator>
      <dc:date>2021-02-28T08:22:03Z</dc:date>
    </item>
  </channel>
</rss>

