<?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: duration between given date range, without weekends in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/duration-between-given-date-range-without-weekends/m-p/1073401#M95543</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;here the function module will be called 100 time , if the difference which will reduce the performance. can u suggest some other way.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 23 Dec 2005 10:20:01 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2005-12-23T10:20:01Z</dc:date>
    <item>
      <title>duration between given date range, without weekends</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/duration-between-given-date-range-without-weekends/m-p/1073397#M95539</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Need a sample program, which gives the number of days between the given date range excluding the weekends.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;eg: suppose is give start date is: 16.12.2005 and end date as: 21.12.2005, it should display 19.12.2005, 20.12.2005, 21.12.2005, leaving 17.12.2005 and 18.12.2005, because these two days are saturday and sunday. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For this example i need the ouput as 3.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 23 Dec 2005 07:51:23 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/duration-between-given-date-range-without-weekends/m-p/1073397#M95539</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-12-23T07:51:23Z</dc:date>
    </item>
    <item>
      <title>Re: duration between given date range, without weekends</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/duration-between-given-date-range-without-weekends/m-p/1073398#M95540</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Anitha&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;you will need to convert to factory date   and to make the minus beetween the two values. &lt;/P&gt;&lt;P&gt;For that, you will need to use a calendar.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FM : DATE_CONVERT_TO_FACTORYDATE&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Rgd&lt;/P&gt;&lt;P&gt;Frédéric&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 23 Dec 2005 08:06:46 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/duration-between-given-date-range-without-weekends/m-p/1073398#M95540</guid>
      <dc:creator>FredericGirod</dc:creator>
      <dc:date>2005-12-23T08:06:46Z</dc:date>
    </item>
    <item>
      <title>Re: duration between given date range, without weekends</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/duration-between-given-date-range-without-weekends/m-p/1073399#M95541</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Anitha,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1. DATE_CHECK_WORKINGDAY&lt;/P&gt;&lt;P&gt;   This is one useful FM&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2. Try this code (just copy paste)&lt;/P&gt;&lt;P&gt;   IT DOES EXACTLY WHAT U REQUIRE.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;REPORT abc.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data : num type i.&lt;/P&gt;&lt;P&gt;parameters : frdate type sy-datum default '20051216'.&lt;/P&gt;&lt;P&gt;parameters : todate type sy-datum default '20051221'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;perform getinfo using frdate todate changing num.&lt;/P&gt;&lt;P&gt;break-point.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;amp;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="---------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*&amp;amp;      Form  getinfo&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;amp;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="---------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;      text&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;STRONG&gt;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FORM getinfo USING fromdate todate CHANGING numofdays type i.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  DATA :  d TYPE sy-datum.&lt;/P&gt;&lt;P&gt;  d = fromdate - 1.&lt;/P&gt;&lt;P&gt;  DO.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    d = d + 1.&lt;/P&gt;&lt;P&gt;    IF d &amp;gt; todate.&lt;/P&gt;&lt;P&gt;      EXIT.&lt;/P&gt;&lt;P&gt;      endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;      CALL FUNCTION 'DATE_CHECK_WORKINGDAY'&lt;/P&gt;&lt;P&gt;        EXPORTING&lt;/P&gt;&lt;P&gt;          date                       = d&lt;/P&gt;&lt;P&gt;          factory_calendar_id        = '01'&lt;/P&gt;&lt;P&gt;          message_type               = 'I'&lt;/P&gt;&lt;P&gt;        EXCEPTIONS&lt;/P&gt;&lt;P&gt;          date_after_range           = 1&lt;/P&gt;&lt;P&gt;          date_before_range          = 2&lt;/P&gt;&lt;P&gt;          date_invalid               = 3&lt;/P&gt;&lt;P&gt;          date_no_workingday         = 4&lt;/P&gt;&lt;P&gt;          factory_calendar_not_found = 5&lt;/P&gt;&lt;P&gt;          message_type_invalid       = 6&lt;/P&gt;&lt;P&gt;          OTHERS                     = 7.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    IF sy-subrc = 0.&lt;/P&gt;&lt;P&gt;      numofdays = numofdays + 1.&lt;/P&gt;&lt;P&gt;      write &lt;span class="lia-unicode-emoji" title=":confused_face:"&gt;😕&lt;/span&gt; d.&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;    ENDDO.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  ENDFORM.                    "getinfo&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I hope it helps.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Amit M.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 23 Dec 2005 08:09:43 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/duration-between-given-date-range-without-weekends/m-p/1073399#M95541</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-12-23T08:09:43Z</dc:date>
    </item>
    <item>
      <title>Re: duration between given date range, without weekends</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/duration-between-given-date-range-without-weekends/m-p/1073400#M95542</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;check this thread may be it will be useful..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A class="jive_macro jive_macro_thread" href="https://community.sap.com/" __jive_macro_name="thread" modifiedtitle="true" __default_attr="90665"&gt;&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 23 Dec 2005 08:10:40 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/duration-between-given-date-range-without-weekends/m-p/1073400#M95542</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-12-23T08:10:40Z</dc:date>
    </item>
    <item>
      <title>Re: duration between given date range, without weekends</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/duration-between-given-date-range-without-weekends/m-p/1073401#M95543</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;here the function module will be called 100 time , if the difference which will reduce the performance. can u suggest some other way.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 23 Dec 2005 10:20:01 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/duration-between-given-date-range-without-weekends/m-p/1073401#M95543</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-12-23T10:20:01Z</dc:date>
    </item>
    <item>
      <title>Re: duration between given date range, without weekends</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/duration-between-given-date-range-without-weekends/m-p/1073402#M95544</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Anitha,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1. other than FM we don't have any way&lt;/P&gt;&lt;P&gt;   to find out saturday sunday.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2. There is no command/statement in abap.&lt;/P&gt;&lt;P&gt;3. DON'T WORRY ABOUT PERFROMANCE.&lt;/P&gt;&lt;P&gt;   100 TIMES IS NOTHING.&lt;/P&gt;&lt;P&gt;  &lt;/P&gt;&lt;P&gt;   EVEN 1000 TIMES CALLING THIS FM&lt;/P&gt;&lt;P&gt;   won't be much strain on the server.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards,&lt;/P&gt;&lt;P&gt;amit m.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 23 Dec 2005 10:23:28 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/duration-between-given-date-range-without-weekends/m-p/1073402#M95544</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-12-23T10:23:28Z</dc:date>
    </item>
  </channel>
</rss>

