<?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 dif between two dates in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/dif-between-two-dates/m-p/2735865#M635444</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Dear All,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I want to find the difference between two dates according to the factory calender.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For eg: 13.07.2007 - 04.07.2007 =  9 days&lt;/P&gt;&lt;P&gt;But in that 9 days there is one festival  holiday and weekenend.So totally three days has to remove.So finally the difference between 13.07 and 14.07 is 6 days only according to the factory calender.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please let me know how to get this.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 03 Sep 2007 08:31:00 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2007-09-03T08:31:00Z</dc:date>
    <item>
      <title>dif between two dates</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/dif-between-two-dates/m-p/2735865#M635444</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Dear All,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I want to find the difference between two dates according to the factory calender.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For eg: 13.07.2007 - 04.07.2007 =  9 days&lt;/P&gt;&lt;P&gt;But in that 9 days there is one festival  holiday and weekenend.So totally three days has to remove.So finally the difference between 13.07 and 14.07 is 6 days only according to the factory calender.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please let me know how to get this.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 03 Sep 2007 08:31:00 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/dif-between-two-dates/m-p/2735865#M635444</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-09-03T08:31:00Z</dc:date>
    </item>
    <item>
      <title>Re: dif between two dates</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/dif-between-two-dates/m-p/2735866#M635445</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;*For calculating days excluding weekends&lt;/P&gt;&lt;P&gt;        CALL FUNCTION 'DAYS_BETWEEN_TWO_DATES'&lt;/P&gt;&lt;P&gt;          EXPORTING&lt;/P&gt;&lt;P&gt;            i_datum_bis             = end_date&lt;/P&gt;&lt;P&gt;            i_datum_von             = start_date&lt;/P&gt;&lt;P&gt;          IMPORTING&lt;/P&gt;&lt;P&gt;            e_tage                  = l_diff_dates&lt;/P&gt;&lt;P&gt;          EXCEPTIONS&lt;/P&gt;&lt;P&gt;            days_method_not_defined = 1&lt;/P&gt;&lt;P&gt;            OTHERS                  = 2.&lt;/P&gt;&lt;P&gt;        IF sy-subrc &amp;lt;&amp;gt; 0.&lt;/P&gt;&lt;P&gt;          MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno&lt;/P&gt;&lt;P&gt;                  WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.&lt;/P&gt;&lt;P&gt;        ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;        IF NOT start_date IS INITIAL AND&lt;/P&gt;&lt;P&gt;           NOT end_date   IS INITIAL.&lt;/P&gt;&lt;P&gt;          CALL FUNCTION 'CATSXT_GET_HOLIDAYS'&lt;/P&gt;&lt;P&gt;            EXPORTING&lt;/P&gt;&lt;P&gt;              im_personnel_number = '00000000'&lt;/P&gt;&lt;P&gt;              im_begin_date       = start_date&lt;/P&gt;&lt;P&gt;              im_end_date         = end_date&lt;/P&gt;&lt;P&gt;              im_get_weekend_days = 'X'&lt;/P&gt;&lt;P&gt;            IMPORTING&lt;/P&gt;&lt;P&gt;              ex_holidays         = i_holiday_tab.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;          DELETE i_holiday_tab WHERE freeday = ' '.&lt;/P&gt;&lt;P&gt;          DESCRIBE TABLE i_holiday_tab LINES l_lines.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;          IF l_diff_dates NE 1.&lt;/P&gt;&lt;P&gt;            l_diff_dates = l_diff_dates - l_lines.&lt;/P&gt;&lt;P&gt;          ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;        ENDIF.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 03 Sep 2007 08:33:19 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/dif-between-two-dates/m-p/2735866#M635445</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-09-03T08:33:19Z</dc:date>
    </item>
    <item>
      <title>Re: dif between two dates</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/dif-between-two-dates/m-p/2735867#M635446</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;use the function module&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;HR_HK_DIFF_BT_2_DATES&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and run this with the following values&lt;/P&gt;&lt;P&gt; DATE1                           02.10.2007&lt;/P&gt;&lt;P&gt; DATE2                           10.09.2007&lt;/P&gt;&lt;P&gt; OUTPUT_FORMAT                   02&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;output will be like this&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt; Export Parameters               Value&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; YEARS                           0,0000&lt;/P&gt;&lt;P&gt; MONTHS                             0,0000&lt;/P&gt;&lt;P&gt; DAYS                                23&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if you change the output_format to 01&lt;/P&gt;&lt;P&gt;it will give in years&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanks &amp;amp; regards,&lt;/P&gt;&lt;P&gt;Venkatesh&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 03 Sep 2007 08:33:35 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/dif-between-two-dates/m-p/2735867#M635446</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-09-03T08:33:35Z</dc:date>
    </item>
    <item>
      <title>Re: dif between two dates</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/dif-between-two-dates/m-p/2735868#M635447</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi shoban babu&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;        This is the FM that you can use to fine a date between period that you would like . &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; CALL FUNCTION 'RKE_SELECT_FACTDAYS_FOR_PERIOD'&lt;/P&gt;&lt;P&gt;    EXPORTING&lt;/P&gt;&lt;P&gt;      i_datab  = p_start_date&lt;/P&gt;&lt;P&gt;      i_datbi  = p_end_date&lt;/P&gt;&lt;P&gt;      i_factid = 'TH'&lt;/P&gt;&lt;P&gt;    TABLES&lt;/P&gt;&lt;P&gt;      eth_dats = it_rke_dat.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;    EXCEPTIONS&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;      DATE_CONVERSION_ERROR       = 1&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;      OTHERS                      = 2&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Wiboon&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 03 Sep 2007 08:34:02 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/dif-between-two-dates/m-p/2735868#M635447</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-09-03T08:34:02Z</dc:date>
    </item>
    <item>
      <title>Re: dif between two dates</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/dif-between-two-dates/m-p/2735869#M635448</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi shoban,&lt;/P&gt;&lt;P&gt;you may use function module DURATION_DETERMINE.&lt;/P&gt;&lt;P&gt;I hope this helps. Best regards,&lt;/P&gt;&lt;P&gt;Alvaro&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 03 Sep 2007 08:36:30 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/dif-between-two-dates/m-p/2735869#M635448</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-09-03T08:36:30Z</dc:date>
    </item>
    <item>
      <title>Re: dif between two dates</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/dif-between-two-dates/m-p/2735870#M635449</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;shoban babu pointed the right FM... It just does the same as my pseudo-code would do.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-&lt;/P&gt;&lt;P&gt;-&lt;/P&gt;&lt;HR originaltext="--------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you cannot get a FM to do it, just make your own.&lt;/P&gt;&lt;P&gt;Call the function DATE_CONVERT_TO_FACTORYDATE from the lower date to the highest, adding one day to the next working day obtained.&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;date_ini = lower_date.
DO.
  CALL FUNCTION 'DATE_CONVERT_TO_FACTORYDATE'
* parameters, yadda yadda
* EXPORTING new_date
  IF new_date = higher_date.
    EXIT.
  ELSE.
    ADD 1 TO diff.
    ADD 1 TO date_ini.
  ENDIF.
ENDDO.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Message was edited by: &lt;/P&gt;&lt;P&gt;        Vicenç Lozano&lt;/P&gt;&lt;P&gt;Who hates to duplicate answers because timing &lt;SPAN __jive_emoticon_name="sad"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 03 Sep 2007 08:36:41 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/dif-between-two-dates/m-p/2735870#M635449</guid>
      <dc:creator>VXLozano</dc:creator>
      <dc:date>2007-09-03T08:36:41Z</dc:date>
    </item>
  </channel>
</rss>

