<?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: time difference calculation in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/time-difference-calculation/m-p/1698892#M306461</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi raghvendra,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;check this FM CCU_TIMESTAMP_DIFFERENCE&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This will give u in seconds&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;say in the example given by u the diff is 40 sec&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;for the same it will give u 2400&lt;/P&gt;&lt;P&gt;it means 2400/60 = 40 min&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this will help u&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Suresh.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Message was edited by: &lt;/P&gt;&lt;P&gt;        suresh B&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 15 Nov 2006 03:42:19 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2006-11-15T03:42:19Z</dc:date>
    <item>
      <title>time difference calculation</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/time-difference-calculation/m-p/1698891#M306460</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;Is there any function module which gives the difference in time .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;eg :  time1 = 12:30:00 &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;       time2 = 13:10:00 .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;difference is 40min .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanks in advance .&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Nov 2006 03:32:43 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/time-difference-calculation/m-p/1698891#M306460</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-11-15T03:32:43Z</dc:date>
    </item>
    <item>
      <title>Re: time difference calculation</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/time-difference-calculation/m-p/1698892#M306461</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi raghvendra,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;check this FM CCU_TIMESTAMP_DIFFERENCE&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This will give u in seconds&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;say in the example given by u the diff is 40 sec&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;for the same it will give u 2400&lt;/P&gt;&lt;P&gt;it means 2400/60 = 40 min&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this will help u&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Suresh.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Message was edited by: &lt;/P&gt;&lt;P&gt;        suresh B&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Nov 2006 03:42:19 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/time-difference-calculation/m-p/1698892#M306461</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-11-15T03:42:19Z</dc:date>
    </item>
    <item>
      <title>Re: time difference calculation</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/time-difference-calculation/m-p/1698893#M306462</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Ragh,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Check this FM CCU_TIMESTAMP_DIFFERENCE&lt;/P&gt;&lt;P&gt;Hope this will help u&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Suresh&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Nov 2006 03:43:06 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/time-difference-calculation/m-p/1698893#M306462</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-11-15T03:43:06Z</dc:date>
    </item>
    <item>
      <title>Re: time difference calculation</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/time-difference-calculation/m-p/1698894#M306463</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;just subtract the 2 times , no need of any FM&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;diff = t2 - t1 , this will give in seconds , divide by 60 to get minutes&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;or check this FM SD_DATETIME_DIFFERENCE&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Nov 2006 03:43:29 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/time-difference-calculation/m-p/1698894#M306463</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-11-15T03:43:29Z</dc:date>
    </item>
    <item>
      <title>Re: time difference calculation</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/time-difference-calculation/m-p/1698895#M306464</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Initiallly Check whether t2 &amp;gt; t1....&lt;/P&gt;&lt;P&gt;Now, declare a varaible T3 as type Time.&lt;/P&gt;&lt;P&gt;T3 = t2 - t1.&lt;/P&gt;&lt;P&gt;declare variable t4 as type N.&lt;/P&gt;&lt;P&gt;t4 = (t3+0(2) * 60) + (t3+2(2)) + (t3+4(2) / 60).&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Nov 2006 03:51:37 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/time-difference-calculation/m-p/1698895#M306464</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-11-15T03:51:37Z</dc:date>
    </item>
    <item>
      <title>Re: time difference calculation</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/time-difference-calculation/m-p/1698896#M306465</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi raghavendra,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;   try this FM L_MC_TIME_DIFFERENCE,  this gives time difference with the unit.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;eg : time1 = 12:30:00 &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;time2 = 13:10:00 .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;difference is 40min .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards,&lt;/P&gt;&lt;P&gt;Balasubramanian .S&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Nov 2006 03:54:12 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/time-difference-calculation/m-p/1698896#M306465</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-11-15T03:54:12Z</dc:date>
    </item>
    <item>
      <title>Re: time difference calculation</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/time-difference-calculation/m-p/1698897#M306466</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;use the FM:&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;SD_DATETIME_DIFFERENCE&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;It gives the difference in Days and Time for 2 dates.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope it helps.&lt;/P&gt;&lt;P&gt;Reward if helpful.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Sipra&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Nov 2006 04:05:30 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/time-difference-calculation/m-p/1698897#M306466</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-11-15T04:05:30Z</dc:date>
    </item>
    <item>
      <title>Re: time difference calculation</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/time-difference-calculation/m-p/1698898#M306467</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;HI , &lt;/P&gt;&lt;P&gt;jsut execute this code ..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;data :  p_stdat LIKE  LTAK-BDATU,
        p_endat LIKE  LTAK-BDATU,
        p_sttime  LIKE  LTAK-BZEIT,
        p_endtime LIKE  LTAK-BZEIT,
        DELTA_TIME LIKE  MCWMIT-BE_AE,
        DELTA_UNIT LIKE  MCWMIT-LZEIT.

DATA:   P_DIFFTIME LIKE SY-UZEIT.
p_stdat = sy-datum.
p_endat = sy-datum.
p_sttime = '123000'.
p_endtime = '131000'.

P_DIFFTIME = P_ENDTIME - P_STTIME .

WRITE:/ P_DIFFTIME.

CALL FUNCTION 'L_MC_TIME_DIFFERENCE'
  EXPORTING
    date_from             = p_stdat
    date_to               = p_endat
   TIME_FROM              = p_sttime
   TIME_TO                = p_endtime
 IMPORTING
   DELTA_TIME             = DELTA_TIME
   DELTA_UNIT             = DELTA_UNIT
 EXCEPTIONS
   FROM_GREATER_TO       = 1
   OTHERS                = 2
          .
IF sy-subrc &amp;lt;&amp;gt; 0.
 MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.


WRITE:/ DELTA_TIME,
            DELTA_UNIT.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;U can go for the Fm cause if its a date change between the intervals ..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards,&lt;/P&gt;&lt;P&gt;VIjay&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Nov 2006 07:17:39 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/time-difference-calculation/m-p/1698898#M306467</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-11-15T07:17:39Z</dc:date>
    </item>
    <item>
      <title>Re: time difference calculation</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/time-difference-calculation/m-p/1698899#M306468</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Please use the function module    DURATION_DETERMINE&lt;/P&gt;&lt;P&gt;This function module that takes in two dates and two times and gives you the difference in a unit of your need based on a calendar.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Irfan Hussain&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Note: Please reward point for sutiable answers.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Nov 2006 08:42:26 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/time-difference-calculation/m-p/1698899#M306468</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-11-15T08:42:26Z</dc:date>
    </item>
    <item>
      <title>Re: time difference calculation</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/time-difference-calculation/m-p/1698900#M306469</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 also use this funciton module.&lt;/P&gt;&lt;P&gt;DELTA_TIME_DAY_HOUR&lt;/P&gt;&lt;P&gt;To get the differnce between 2 dates and times&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Irfan Hussain&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Note:Please reward suitable answers.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Nov 2006 08:44:44 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/time-difference-calculation/m-p/1698900#M306469</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-11-15T08:44:44Z</dc:date>
    </item>
    <item>
      <title>Re: time difference calculation</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/time-difference-calculation/m-p/1698901#M306470</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Please use the function module    DURATION_DETERMINE&lt;/P&gt;&lt;P&gt;This function module that takes in two dates and two times and gives you the difference in a unit of your need based on a calendar.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Irfan Hussain&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Note: Please reward point for sutiable answers.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Nov 2006 08:46:09 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/time-difference-calculation/m-p/1698901#M306470</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-11-15T08:46:09Z</dc:date>
    </item>
  </channel>
</rss>

