<?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 Bitween  Two Days in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/difference-bitween-two-days/m-p/3875888#M931672</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;  The FM 'HR_AUPBS_MONTH_DAY'&lt;/P&gt;&lt;P&gt;gives us a code that helps you calculate the no of days between two dates.&lt;/P&gt;&lt;P&gt;Jus look at the following code&lt;/P&gt;&lt;P&gt;IF D1 &amp;gt; D2.&lt;/P&gt;&lt;P&gt;D3 = ( D1 - D2 + 1 ) * -1.&lt;/P&gt;&lt;P&gt;ELSE.&lt;/P&gt;&lt;P&gt;D3 = D2 - D1 + 1.&lt;/P&gt;&lt;P&gt;ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;d1 n d2 are the two dates.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;check&lt;/P&gt;&lt;P&gt;&lt;A href="https://forums.sdn.sap.com/click.jspa?searchID=11811178&amp;amp;messageID=3247295" target="test_blank"&gt;https://forums.sdn.sap.com/click.jspa?searchID=11811178&amp;amp;messageID=3247295&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Kiran Sure&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 15 May 2008 07:45:17 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2008-05-15T07:45:17Z</dc:date>
    <item>
      <title>Difference Bitween  Two Days</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/difference-bitween-two-days/m-p/3875882#M931666</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hii ,&lt;/P&gt;&lt;P&gt;        I want to find out difference bitween two days&lt;/P&gt;&lt;P&gt;        supose example &lt;/P&gt;&lt;P&gt;        01/05/2008   and  15/05/2008&lt;/P&gt;&lt;P&gt;       the difference bitween these two days is 15 &lt;/P&gt;&lt;P&gt;       can some one provide me the required Function module&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 15 May 2008 07:34:18 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/difference-bitween-two-days/m-p/3875882#M931666</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-05-15T07:34:18Z</dc:date>
    </item>
    <item>
      <title>Re: Difference Bitween  Two Days</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/difference-bitween-two-days/m-p/3875883#M931667</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Use this FM&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
DATA: G_F_DIFF TYPE I.
  CALL FUNCTION 'DAYS_BETWEEN_TWO_DATES'
       EXPORTING
            I_DATUM_BIS             = G_T_PURO-AEDAT    " End date 
            I_DATUM_VON             = G_T_EBAN-BADAT " Start Date
       IMPORTING
            E_TAGE                  = G_F_DIFF
       EXCEPTIONS
            DAYS_METHOD_NOT_DEFINED = 1
            OTHERS                  = 2.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cheers,&lt;/P&gt;&lt;P&gt;Vasanth&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 15 May 2008 07:37:53 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/difference-bitween-two-days/m-p/3875883#M931667</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-05-15T07:37:53Z</dc:date>
    </item>
    <item>
      <title>Re: Difference Bitween  Two Days</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/difference-bitween-two-days/m-p/3875884#M931668</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;do this way  ..&lt;/P&gt;&lt;P&gt;HR_HK_DIFF_BT_2_DATES&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;or you can use FIMA_DAYS_AND_MONTHS_AND_YEARS&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;See the below code for ur refrence:&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
REPORT ZDATEDIFF.

DATA: EDAYS LIKE VTBBEWE-ATAGE,
EMONTHS LIKE VTBBEWE-ATAGE,
EYEARS LIKE VTBBEWE-ATAGE.

PARAMETERS: FROMDATE LIKE VTBBEWE-DBERVON,
TODATE LIKE VTBBEWE-DBERBIS DEFAULT SY-DATUM.

call function 'FIMA_DAYS_AND_MONTHS_AND_YEARS'
exporting
i_date_from = FROMDATE
i_date_to = TODATE

    * I_FLG_SEPARATE = ' '

IMPORTING
E_DAYS = EDAYS
E_MONTHS = EMONTHS
E_YEARS = EYEARS.

WRITE:/ 'Difference in Days ', EDAYS.
WRITE:/ 'Difference in Months ', EMONTHS.
WRITE:/ 'Difference in Years ', EYEARS.
 &lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Santosh&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 15 May 2008 07:39:45 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/difference-bitween-two-days/m-p/3875884#M931668</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-05-15T07:39:45Z</dc:date>
    </item>
    <item>
      <title>Re: Difference Bitween  Two Days</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/difference-bitween-two-days/m-p/3875885#M931669</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; You can even define a variable of type I and just subtract both dates.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
days = date2 - date1. &lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Santosh&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 15 May 2008 07:41:54 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/difference-bitween-two-days/m-p/3875885#M931669</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-05-15T07:41:54Z</dc:date>
    </item>
    <item>
      <title>Re: Difference Bitween  Two Days</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/difference-bitween-two-days/m-p/3875886#M931670</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;You don't need a funciton module.  Provided the two fields are held as type DAT you just need to subtract one field from the other;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
DAYS = W_DATE1 - W_DATE2.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Nick&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 15 May 2008 07:43:26 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/difference-bitween-two-days/m-p/3875886#M931670</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-05-15T07:43:26Z</dc:date>
    </item>
    <item>
      <title>Re: Difference Bitween  Two Days</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/difference-bitween-two-days/m-p/3875887#M931671</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;&lt;/P&gt;&lt;P&gt;Use Function module &lt;STRONG&gt;SD_DATETIME_DIFFERENCE&lt;/STRONG&gt; to get Difference Bitween  Two Days&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FUNCTION SD_DATETIME_DIFFERENCE.&lt;/P&gt;&lt;P&gt;*"----&lt;/P&gt;&lt;HR originaltext="------------------------------------------------" /&gt;&lt;P&gt;""Lokale Schnittstelle:&lt;/P&gt;&lt;P&gt;*" IMPORTING&lt;/P&gt;&lt;P&gt;*" VALUE(DATE1) TYPE D&lt;/P&gt;&lt;P&gt;*" VALUE(TIME1) TYPE T&lt;/P&gt;&lt;P&gt;*" VALUE(DATE2) TYPE D&lt;/P&gt;&lt;P&gt;*" VALUE(TIME2) TYPE T&lt;/P&gt;&lt;P&gt;*" EXPORTING&lt;/P&gt;&lt;P&gt;*" VALUE(DATEDIFF) TYPE P&lt;/P&gt;&lt;P&gt;*" VALUE(TIMEDIFF) TYPE P&lt;/P&gt;&lt;P&gt;*" VALUE(EARLIEST) TYPE C&lt;/P&gt;&lt;P&gt;*" EXCEPTIONS&lt;/P&gt;&lt;P&gt;*" INVALID_DATETIME&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So the type D is datum (so those parameters are dates), type T is for time, type P is for number&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can also have alook at these Function modules&lt;/P&gt;&lt;P&gt;SD_DATETIME_DIFFERENCE&lt;/P&gt;&lt;P&gt;DAYS_BETWEEN_TWO_DATES&lt;/P&gt;&lt;P&gt;MONTHS_BETWEEN_TWO_DATES..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Raj.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 15 May 2008 07:44:45 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/difference-bitween-two-days/m-p/3875887#M931671</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-05-15T07:44:45Z</dc:date>
    </item>
    <item>
      <title>Re: Difference Bitween  Two Days</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/difference-bitween-two-days/m-p/3875888#M931672</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;  The FM 'HR_AUPBS_MONTH_DAY'&lt;/P&gt;&lt;P&gt;gives us a code that helps you calculate the no of days between two dates.&lt;/P&gt;&lt;P&gt;Jus look at the following code&lt;/P&gt;&lt;P&gt;IF D1 &amp;gt; D2.&lt;/P&gt;&lt;P&gt;D3 = ( D1 - D2 + 1 ) * -1.&lt;/P&gt;&lt;P&gt;ELSE.&lt;/P&gt;&lt;P&gt;D3 = D2 - D1 + 1.&lt;/P&gt;&lt;P&gt;ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;d1 n d2 are the two dates.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;check&lt;/P&gt;&lt;P&gt;&lt;A href="https://forums.sdn.sap.com/click.jspa?searchID=11811178&amp;amp;messageID=3247295" target="test_blank"&gt;https://forums.sdn.sap.com/click.jspa?searchID=11811178&amp;amp;messageID=3247295&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Kiran Sure&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 15 May 2008 07:45:17 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/difference-bitween-two-days/m-p/3875888#M931672</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-05-15T07:45:17Z</dc:date>
    </item>
  </channel>
</rss>

