<?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: Difference between dates in BW in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/difference-between-dates-in-bw/m-p/5595713#M1275386</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Can i know what exactly do u want??&lt;/P&gt;&lt;P&gt;If it is diff in no. of days...&lt;/P&gt;&lt;P&gt;jus write...date1 - date2...will give the no of days diff!!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 06 May 2009 13:33:11 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2009-05-06T13:33:11Z</dc:date>
    <item>
      <title>Difference between dates in BW</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/difference-between-dates-in-bw/m-p/5595706#M1275379</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I searched SDN and looked into several threads for this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My req: I need to get the no.of working days between 2 dates in BW. &lt;/P&gt;&lt;P&gt;Amits reply in this thread &lt;A class="jive_macro jive_macro_message" href="https://community.sap.com/" __jive_macro_name="message" modifiedtitle="true" __default_attr="1152615"&gt;&lt;/A&gt; works fine in R/3. But the real problem is that FM DATE_CHECK_WORKINGDAY is not existing in BW.&lt;/P&gt;&lt;P&gt;I tried to copy paste the code from this FM but it doesnt seem to work because there are some dynamic variables.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So please help me how 2 go about it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Kiran&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 05 May 2009 19:18:06 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/difference-between-dates-in-bw/m-p/5595706#M1275379</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-05-05T19:18:06Z</dc:date>
    </item>
    <item>
      <title>Re: Difference between dates in BW</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/difference-between-dates-in-bw/m-p/5595707#M1275380</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This message was moderated.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 05 May 2009 19:25:31 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/difference-between-dates-in-bw/m-p/5595707#M1275380</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-05-05T19:25:31Z</dc:date>
    </item>
    <item>
      <title>Re: Difference between dates in BW</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/difference-between-dates-in-bw/m-p/5595708#M1275381</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Prabhu,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This FM is not existing BW.&lt;/P&gt;&lt;P&gt;I need a write a code in one of the BW start routines.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Kiran&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 05 May 2009 19:34:38 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/difference-between-dates-in-bw/m-p/5595708#M1275381</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-05-05T19:34:38Z</dc:date>
    </item>
    <item>
      <title>Re: Difference between dates in BW</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/difference-between-dates-in-bw/m-p/5595709#M1275382</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;try to use this Fm...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Factory date of day 1 minus the factory date in day 2.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Use function module:&lt;/P&gt;&lt;P&gt;DATE_CONVERT_TO_FACTORYDATE&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Prabhudas&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 05 May 2009 19:55:39 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/difference-between-dates-in-bw/m-p/5595709#M1275382</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-05-05T19:55:39Z</dc:date>
    </item>
    <item>
      <title>Re: Difference between dates in BW</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/difference-between-dates-in-bw/m-p/5595710#M1275383</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Prabu,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This FM exists in our BW system.&lt;/P&gt;&lt;P&gt;But I did not understand your above line.&lt;/P&gt;&lt;P&gt;Can you please tell me in detail or send a psuedo code.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Kiran&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: kiran dasari on May 6, 2009 5:33 PM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 05 May 2009 20:09:36 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/difference-between-dates-in-bw/m-p/5595710#M1275383</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-05-05T20:09:36Z</dc:date>
    </item>
    <item>
      <title>Re: Difference between dates in BW</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/difference-between-dates-in-bw/m-p/5595711#M1275384</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Kiran,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;use the belwo code to get the difference between two days in BW..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
DATE_FROM TYPE  DATUM. "First date
DATE_TO TYPE  DATUM.     "Second Date
  REFERENCE(DAYS) TYPE  I  "Differnce days stored in this

  DATA: l_date         LIKE sy-datum,
        l_end_date     LIKE sy-datum,
        l_factory_date LIKE sy-datum.

* Set L_DATE to the earlier date and L_END_DATE to the later date
  IF date_from &amp;lt;= date_to.
    l_date = date_from.
    l_end_date = date_to.
  ELSE.
    l_date = date_to.
    l_end_date = date_from.
  ENDIF.

  days = 0.

* Test all days between the two dates, and count just the factory days
  WHILE l_date &amp;lt;= l_end_date.

*   Determine if L_DATE is a factory date
    CALL FUNCTION 'DATE_CONVERT_TO_FACTORYDATE'
         EXPORTING
              date                         = l_date
              correct_option               = '+'
              factory_calendar_id          = factory_calendar_id
         IMPORTING
              date                         = l_factory_date
         EXCEPTIONS
              calendar_buffer_not_loadable = 1
              correct_option_invalid       = 2
              date_after_range             = 3
              date_before_range            = 4
              date_invalid                 = 5
              factory_calendar_not_found   = 6
              OTHERS                       = 7.

    CASE sy-subrc.
      WHEN 0.
        IF l_date = l_factory_date.
          days = days + 1.
        ENDIF.
        l_date = l_date + 1.
      WHEN 3.
        MESSAGE e523(m7) WITH l_date
          RAISING date_after_range.
      WHEN 4.
        MESSAGE e524(m7) WITH l_date
          RAISING date_before_range.
      WHEN 5.
        MESSAGE e220(zsd) WITH l_date.
        RAISE invalid_date_format.
      WHEN 6.
        MESSAGE e526(m7) WITH factory_calendar_id
          RAISING factory_calendar_not_found.
      WHEN OTHERS.
        MESSAGE e525(m7) WITH l_date
          RAISING others.
    ENDCASE.

  ENDWHILE.

" this part of code is for inclusive of start date and enddate ,
"if you want exclsive comment the belwo code and capture the Days from above.
  IF date_from &amp;gt; date_to.
    days = days * -1.            "the difference days is stored in this Varaible
  ENDIF.

&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Prabhudas&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 06 May 2009 12:31:47 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/difference-between-dates-in-bw/m-p/5595711#M1275384</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-05-06T12:31:47Z</dc:date>
    </item>
    <item>
      <title>Re: Difference between dates in BW</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/difference-between-dates-in-bw/m-p/5595712#M1275385</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Prabhu,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for your code and efforts.&lt;/P&gt;&lt;P&gt;But what is factory_calendar_id. Should I just declare and leave it or should I pass some value into it. If so, how can I determine the calender id.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Kiran&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 06 May 2009 13:21:11 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/difference-between-dates-in-bw/m-p/5595712#M1275385</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-05-06T13:21:11Z</dc:date>
    </item>
    <item>
      <title>Re: Difference between dates in BW</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/difference-between-dates-in-bw/m-p/5595713#M1275386</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Can i know what exactly do u want??&lt;/P&gt;&lt;P&gt;If it is diff in no. of days...&lt;/P&gt;&lt;P&gt;jus write...date1 - date2...will give the no of days diff!!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 06 May 2009 13:33:11 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/difference-between-dates-in-bw/m-p/5595713#M1275386</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-05-06T13:33:11Z</dc:date>
    </item>
    <item>
      <title>Re: Difference between dates in BW</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/difference-between-dates-in-bw/m-p/5595714#M1275387</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;"factory_calendar_id" This is passed to the FM.&lt;/P&gt;&lt;P&gt;I want to know what it is exactly and what value need to be passed when FM is called.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Kiran&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: kiran dasari on May 7, 2009 12:30 AM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 06 May 2009 13:51:59 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/difference-between-dates-in-bw/m-p/5595714#M1275387</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-05-06T13:51:59Z</dc:date>
    </item>
    <item>
      <title>Re: Difference between dates in BW</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/difference-between-dates-in-bw/m-p/5595715#M1275388</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Kiran,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
SELECT SINGLE fabkl INTO factory_calendar_id  "Pass this factory_calendar_id  to FM
    FROM tvst where ALAND = 'US'.   "country which you are checking the Holiday list


use the above query to get the factory_calendar_id .
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;dont forget to give points..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards,&lt;/P&gt;&lt;P&gt;Prabhudas&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 06 May 2009 19:05:05 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/difference-between-dates-in-bw/m-p/5595715#M1275388</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-05-06T19:05:05Z</dc:date>
    </item>
  </channel>
</rss>

