<?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 Split in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/time-split/m-p/5303414#M1223064</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;convert your time in minutes first:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Pseudocode:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
split time_1 at ':' into hours minutes.

duration = hours * 60 + minutes.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Do that with all your time durations:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
split time_n at ':' into hours minutes.

duration = duration + hours * 60 + minutes.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;After that, recalulate the hours by dividing the duartion by 60, ignoring the fraction, and caculating the minutes by the remainder.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 05 Mar 2009 10:20:59 GMT</pubDate>
    <dc:creator>rainer_hbenthal</dc:creator>
    <dc:date>2009-03-05T10:20:59Z</dc:date>
    <item>
      <title>Time Split</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/time-split/m-p/5303413#M1223063</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Dear Experts,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My report requires to calculate average of the time given. Now, when I calculate, it's giving me the correct output, however, it's not according to the time format.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;e.g. The Result = 7.76&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Correct Value should be 8.26 i.e. 8 hours and 26 mins&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is there any Function Module available for this?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My Logic is as follows, but not able to calculate it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FORM time_split USING       l_tim1&lt;/P&gt;&lt;P&gt;                         CHANGING l_tim2.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  DATA: l_hrs TYPE i,&lt;/P&gt;&lt;P&gt;        l_min TYPE p DECIMALS 2,&lt;/P&gt;&lt;P&gt;        l_t1   TYPE i,&lt;/P&gt;&lt;P&gt;        l_t2   TYPE i.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  DATA: l_hr     TYPE n,&lt;/P&gt;&lt;P&gt;        l_mn        TYPE n,&lt;/P&gt;&lt;P&gt;        l_t3          TYPE n,&lt;/P&gt;&lt;P&gt;        l_t4           TYPE n.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  SPLIT l_tim1 AT '.' INTO l_hr l_mn.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  l_hrs = l_hr.&lt;/P&gt;&lt;P&gt;  l_min = l_mn.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  IF l_min GE 60.&lt;/P&gt;&lt;P&gt;    l_min = l_min / 60.&lt;/P&gt;&lt;P&gt;  ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  l_mn = l_min.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  SPLIT l_mn AT '.' INTO l_t3 l_t4.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  l_t1 = l_t3.&lt;/P&gt;&lt;P&gt;  l_t2 = l_t4.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  l_hrs = l_hrs + l_t1.&lt;/P&gt;&lt;P&gt;  l_hr  = l_hrs.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  l_t4 = l_t2.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  CONCATENATE l_hr '.' l_t4 INTO l_tim2.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ENDFORM.                    " TIME_SPLIT&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 05 Mar 2009 10:11:39 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/time-split/m-p/5303413#M1223063</guid>
      <dc:creator>aasim_khan</dc:creator>
      <dc:date>2009-03-05T10:11:39Z</dc:date>
    </item>
    <item>
      <title>Re: Time Split</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/time-split/m-p/5303414#M1223064</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;convert your time in minutes first:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Pseudocode:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
split time_1 at ':' into hours minutes.

duration = hours * 60 + minutes.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Do that with all your time durations:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
split time_n at ':' into hours minutes.

duration = duration + hours * 60 + minutes.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;After that, recalulate the hours by dividing the duartion by 60, ignoring the fraction, and caculating the minutes by the remainder.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 05 Mar 2009 10:20:59 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/time-split/m-p/5303414#M1223064</guid>
      <dc:creator>rainer_hbenthal</dc:creator>
      <dc:date>2009-03-05T10:20:59Z</dc:date>
    </item>
    <item>
      <title>Re: Time Split</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/time-split/m-p/5303415#M1223065</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Aasim,&lt;/P&gt;&lt;P&gt;use the following logic&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PARAMETERS : p_time1 TYPE sy-uzeit,&lt;/P&gt;&lt;P&gt;             p_time2 TYPE sy-uzeit.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA : l_avg_time TYPE sy-uzeit,&lt;/P&gt;&lt;P&gt;       l_avg type string.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;l_avg_time =  ( p_time1 + p_time2 ) / 2.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;concatenate l_avg_time&lt;EM&gt;00(02) 'Hrs' l_avg_time&lt;/EM&gt;02(02) 'Minutes' into l_avg separated by space.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;WRITE l_avg.&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;Mansi&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 05 Mar 2009 10:22:13 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/time-split/m-p/5303415#M1223065</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-03-05T10:22:13Z</dc:date>
    </item>
    <item>
      <title>Re: Time Split</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/time-split/m-p/5303416#M1223066</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;I think if you assign l_tm1 to a char type variable and finally use this char type variable in split as Split work with char or string type variable ,I am guessing that SPLIT command is not working fine in your code.else everything seesm to be ok.Just check in the debugger the value l_hr l_mn after split.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Pooja&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 05 Mar 2009 10:28:50 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/time-split/m-p/5303416#M1223066</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-03-05T10:28:50Z</dc:date>
    </item>
  </channel>
</rss>

