Converting days into hours and adding this hour to the time

Hi Gurus!
I ahve  a query that outputs the total time between two periods in one column , total number of days between two periods  in onne column. I want to combine those together and show it in hours . For example if the time column shows 7:41(7 hours  and 41 minutes ) and teh days column shows 1 day , I want to combine those two columns and show as one column i.e 24 hours plus 7 hours and 41 minutes as a total of 31 hours and 41 minutes. I had written the follwwing code in the query that calculated the two seprately , can anyone please tell me how to go about converting this hour into time format and then adding the two to get it in total number of hours and minutes in my query.
concatenate vttk-datbg vttk-uatbg into lv_start_time.
    concatenate vttk-daten vttk-uaten into lv_end_time.
    gv_ftstm = lv_end_time - lv_start_time.
    gv_total_time = gv_ftstm+8(6).
    if not ( vttk-datbg is initial
          or vttk-daten is initial ).
      gv_total_days = gv_ftstm+0(8).
    else.
      clear: gv_total_days.
    endif.
    if not p_bl_lns is initial.
      read table gt_vttk with key tknum = vttk-tknum.
      if sy-subrc <> 0.
        append vttk to gt_vttk .
      else.
        clear: vttk-distz,
               vttk-gesztda,
               vttk-fahztda,
               vttk-warztda,
               gv_total_days,
               gv_total_time.
      endif.
    endif.
The gv_total_days have been declared as type P lenght 6, outlenth 10 and decimal 02, and
gv_time as VTTK-FAHZTDA.
Thnaks

Does this help ?
CONVERT DATE par_date TIME par_time INTO
          TIME STAMP par_timestamp TIME ZONE par_time_zone.
also use fm:  SD_DATETIME_DIFFERENCE
01/01/2009
12:00:00
01/02/2010
11:00:00
output:                             365
                             23
365 * 24 = tine in Hrs + 23 hrs

Similar Messages

  • Averaging over the last hour and last eight hours.

    This is fairly simple but I'm not sure what a "good" approach is. Basically I need to track how many times a user has performed an action over the last hour and last eight hours. I'll receive a notification of some sort when they perform this action and could get the current time, but I'm not sure what a fast way of determining how many times this has occurred in a given time period is.
    I was thinking perhaps an array with the time of each in milliseconds and just find the first index that was < 8 hours or < 1 hour ago and then subtract the index from the current size. I think that would be problematic though. To keep the array from continuously growing I'd have to shift everything over to the left which means an expensive arraycopy. Perhaps if I only did the resizing when there were > 20 or elements I no longer care about or something would help, but then I'd have to iterate over 20 elements I don't care about everytime it's calculated, which is once a second.
    Any algorithms that will solve this?

    Here is a method with a granularity of a minute (i.e.
    it only updates the average value every minute - you
    can change it to give whatever granularity you want)
    Keep an array with 60 elements in it. The array
    counts the number of times that the user performed
    the action each minute.
    The array in indexed modulo real time, and you make
    entries based on actual time of day. So when a user
    performs an action at 8:38:45 you increment slot 38.
    Each slot counts the number of actions that took
    place in that particular minute. When the next minute
    rolls around, you move to the next slot, set the
    value to zero (thus throwing out the events that
    happened over an hour ago, and prepare to count the
    new events)
    The sum of the entire array is of course the total
    number of events that have taken place in the last
    hour.
    You do not need to actually run through the array and
    total the events every time you want to calculate the
    average. You can use the fact that you increase the
    total by one every time you get a new event and you
    decrease the total by X everytime you zero out a slot
    that had X for its event count.
    So you can just keep a single value, Total, along
    with your array that goes up by one on every event
    and then drops back a little every minute, when you
    throw out the hour old events.That is probably a good solution to the question I posed, but I realize now I was not thorough or accurate enough in describing the context and requirements. I don't think that will work without a lot of unnecessary memory, but maybe I'm wrong.
    The user action is actually the successful completion of entering a form, a bill to be more precise. I expect this to happen 100-300 times an hour to give an idea of the frequency. Given a period of time, if they've been at it for that period of time or longer I need to find the number of bills completed in that most recent period of time. Otherwise, I need to use what is available to predict what they will reach in that period of time. In other words, if the time period is an hour I need to figure out how many bills were completed in the last hour, but if they've been going for only five minutes I need to predict what they will have completed in an hour including those last five minutes. Then I need to do the same thing for seven hours, using the last seven hours or less of data.
    I guess I'd just have to use a granularity of a minute or less and calculate how many bills over how many minutes and make a prediction on that? I suppose I was hoping for something more precise, but now that I think about it that will probably suffice.
    How would you implement it though? Create a "minute" array of size 60 initially, then when reaching the end of that array adding the total for that array to an "hourly" array (keeps track of bills in that hour) and then start over? I guess then you'd just have to add each from the hourly array to the current total and calculate based upon that. At any given time I'd have the number of bills processed in the last x hours and y minutes, which is enough to calculate how much can be completed at that rate in a given hour or seven hour day.
    I'll try this tomorrow when I get to work, thank you very much I was needlessly complicating it with timestamps. In fact, this inadvertently (or perhaps purposefully?) solves an issue with not calculating time when a user is at lunch or on break. At least I think it does.

  • How do you calculate difference in time (hours and minutes) between 2 two date/time fields?

    Have trouble creating formula using FormCalc that will calculate difference in time (hours and minutes) from a Start Date/Time field and End Date/Time field. 
    I am using to automatically calculate total time in hours and minutes only of an equipment outage based on a user entered start date and time and end date and time. 
    For example a user enters start date/time of an equipment outage as 14-Oct-12 08:12 AM and then enters an end date/time of the outage of 15-Oct-12 01:48 PM.  I need a return that automatically calculates total time in hours and minutes of the equipment outage.
    Thanks Chris

    Hi,
    In JavaScript you could do something like;
    var DateTimeRegex = /(\d\d\d\d)-(\d\d)-(\d\d)T(\d\d):(\d\d)/;
    var d1 = DateTimeRegex.exec(DateTimeField1.rawValue);
    if (d1 !== null)
        var fromDate = new Date(d1[1], d1[2]-1, d1[3], d1[4], d1[5]);
    var d2 = DateTimeRegex.exec(DateTimeField2.rawValue);
    if (d2 !== null)
        var toDate = new Date(d2[1], d2[2]-1, d2[3], d2[4], d2[5]);
    const millisecondsPerMinute = 1000 * 60;
    const millisecondsPerHour = millisecondsPerMinute * 60;
    const millisecondsPerDay = millisecondsPerHour * 24;
    var interval = toDate.getTime() - fromDate.getTime();
    var days = Math.floor(interval / millisecondsPerDay );
    interval = interval - (days * millisecondsPerDay );
    var hours = Math.floor(interval / millisecondsPerHour );
    interval = interval - (hours * millisecondsPerHour );
    var minutes = Math.floor(interval / millisecondsPerMinute );
    console.println(days + " days, " + hours + " hours, " + minutes + " minutes");
    This assumes that the values in DateTimeField1 and DateTimeField2 are valid, which means the rawValue will be in a format like 2009-03-15T18:15
    Regards
    Bruce

  • My mac hung up while installing an update. It took hours and still did not complete the update. I restarted my mac. Upon turning it back on, a wheel has been spinning on a grey screen. I tried to reinstall OS X from utilities, but encounter an error. Why?

    My mac hung up while installing an update. It took hours and still did not complete the update. I restarted my mac. Upon turning it back on, a wheel has been spinning on a grey screen. I tried to reinstall OS X from utilities, but encounter an error. What do I do?

    Hey Manaskala,
    First point of call on all grey screen issues is the following:
    http://support.apple.com/kb/TS2570
    Given this issue has appeared after a software update, I'd advise you do the following instead though:
    1. Get an external hard drive, with enough space to put the entire hard drive of your Mac onto. Make sure you've safely copied any data you have off of it, as the next step will erase it.
    2. In the recovery HD of your machine, use Disk Utility to format you EXTERNAL hard drive with the partition table as GUID, and the format as Mac OS Extended (Journaled).
    3. Get out of Disk Utility, and click Reinstall Mac OS X.
    4. When asked where, choose to install onto your external hard drive.
    5. When the download and installation is complete, your Mac will reboot into a clean fresh setup screen. Make your user account an administrator, and make up a name and password; I use 'Test' and 'test'.
    6. Your machine is now running from the external hard drive, not the internal hard drive, so don't be alarmed when you don't see your files.
    7. Open the finder, you should see 'Macintosh HD' in the sidebar. This is the internal hard drive of your computer.
    8. Open Macintosh HD, and copy out the following folders into a new folder on your desktop:
    -Users.
    -Applications.
    -Library. (This only needs to be done if you use 3rd party software that saves things in the /Library, do a quick google and see if it does e.g. Photoshop, Protools).
    9. When these have copied (it'll take quiet a while), you can now use Disk Utility to erase your hard drive. Don't erase Macintosh HD but the ENTIRE hard drive on the inside of your Mac, and as Thomas A Reed mentioned, there was likely an existing issue on your HDD so please go to Security Options and choose 'Zero Out' before clicking erase. This will rebuild the partition table which was a possible cause of the failed update.
    10. Reboot the machine holding 'Option', go to recovery HD.
    11. Choose 'Reinstall Mac OS X', this time onto your INTERNAL hard drive.
    12. When this is complete, make another admin user called test and password test, like you did last time.
    13. Run Software Update from the  menu of your Mac.
    14. In the Finder, you should see your external Hard Drive. open it up, inside that you should see your desktop etc, and on the desktop will be your folder containing Library, Applications and Users.
    15. Go to Finder up next to the  and choose File -> New Finder Window.
    16. In your second finder window, open up Macintosh HD (through the Go -> Computer menu), and go to your Users folder.
    17. Open the Users folder in your first finder window, and copy your user folder (has your name on it) into the second user folder (the one inside Macintosh HD).
    18. This might take a while.
    19. When complete, go to System Preferences -> Users and Groups and unlock the padlock.
    20. Click the '+' sign, and make a new administrator user.
    21. Now, the fun bit. Note the name of your user folder you copied, e.g. 'Nathan', containing all of your stuff. Note the difference between your user folder (has your name on it) and the Users folder (contains YOUR user folder, guest folder and shared folder).
    22. Make the ACCOUNT NAME of your new adminstrator user the EXACT name of your user folder (normally lower case and without spaces), this is case sensitive folks. Your full name can be whatever you want, usually your full name.
    23. Then click create. You should be informed that a home folder with that name in it already exists in the Users folder, would you like to make your new account from that folder? say YES!
    24. When this is complete, log out of the Test user, log into your new account we've just made, all your stuff should be there.
    25. ???????
    26. Profit.
    There's a few little bits that may need to be cleaned up afterwards, applications folder from your external hard drive should replace the applications folder on your internal hard drive, if the previously mentioned /Library folder contained important goodies then that should replace the /Library folder on your new Mac.
    Hopefully that will help you out, straight after that is done make sure your stuff is there, erase your external hard drive and turn on time machine!

  • My wifi goes down at least once a day and I have to unplug the time capsule and reboot it and then it works fine.  Any idea why this is happening/what I can do to fix it?

    My wifi goes down at least once a day and I have to unplug the time capsule and reboot it and then it works fine.  Any idea why this is happening/what I can do to fix it?

    I was having this problem while still using Mavericks -- it started after a Mavericks update last spring.  During the initial Yosemite beta runs over the summer, it seemed to be fixed, but after the official launch in October, I had all sorts of problems keeping connected.  Its gotten a little better, but still happens to at least one of my devices every day.  Weird that we still cannot figure out why the connection keeps dropping on some devices, but not others, and then the next day, one of the devices that didn't disconnect the previous day will disconnect, but the ones that did disconnect, stay connected.  It's just sloppy, poorly written software for technology that isn't working the way it should.  If you turn off Continuity and Handoff on all your devices, you will probably see that everything stays connected.  With those turned off on all devices, TC stayed connected to everything for over a month.  The day I turned Continuity back on, all the problems started again.  It had something to do with the bluetooth version being used, the wifi routine, and Apple's AirPlay technology not quite getting along with each other.

  • HT203433 Download of song will not complete has been over an hour and I have done all the suggested troubleshooting

                                                                Download of song will not complete has been over an hour and I have done all the troubleshooting suggestions to correct

    Hi Lisa Wozniak,
    Are you on a slow Network Connection? I would recommend you to Clear the browser Cache and History and  then try again or try using a different browser on a different Network Connection.
    Let me know if it works or not.
    Regards,
    Rahul Tyagi

  • What do you mean by standby 4 hours and usage 2 hours

    What do you mean by usage 2 hours and standby 4 hours?  Can we off the phone after setting the alarm ? Nokia phone able to do it, the alarm will ring if the phone is off.
    So that I do not have to on the phone to let the battery drain overnight.

    Off is off.  Nothing will work when the iphone is off.
    Your Nokia is not truly off either. It is simply in stand-by.

  • I have been trying for three days to try and get this working , and tried a few of the forum suggestions already and this is just to try them ... so glad i haven't pais anything yet . i get the signed out loop no matter what i try

    i have been trying for three days to try and get this working , and tried a few of the forum suggestions already and this is just to try them ... so glad i haven't pais anything yet . i get the signed out loop no matter what i try

    What have you been trying for three days to try and get this working???
    Supply pertinent information for quicker answers
    The more information you supply about your situation, the better equipped other community members will be to answer. Consider including the following in your question:
    Adobe product and version number
    Operating system and version number
    The full text of any error message(s)
    What you were doing when the problem occurred
    Screenshots of the problem
    Computer hardware, such as CPU; GPU; amount of RAM; etc.

  • Is it possible to convert Java to EXE and run this EXE file without any JRE

    hello friends
    I have GCC/GCJ for windows but dont know how to work with it... it creates file with .o extension but i m not able to create .exe from that... i installed mingw for that also .. unsuccessful ...
    tell me the solution for it... i want to generate machine dependent exe from java file...on the web i ve seen that GCC/GCJ is used on linux platform..not cleared properly..
    Again i m writing my question
    Is it possible to convert Java to EXE and run this EXE file without any JRE if yes then how... tell me the procedure to do that...

    Vipul wrote:
    Its software now hardware .... some times u need these things ...anyway do u ve solution for my questionSo what? By creating a native executable you are restricting the program to the OS for which that native executable was made, just like removing the engine from a car restricts driving to downhill only. So like the I said, the principle remains the same, "Why would you want to?"
    I am asking you, truthfully, why do you feel the need to negate the largest advantage of using Java by creating a native executable from it?
    What is your rationale?
    I can pretty much guarantee there is a much better way of achieving your wish without "removing the engine".

  • Is there a way to keep the backlight on while I am using my ipod nano 6? I was able to go into setting and do this for my old Ipod.

    Is there a way to keep the backlight on while I am using my ipod nano 6? I was able to go into setting and do this for my old Ipod.

    There is not.  It can only be on for a set amount of time.
    B-rock

  • When I bought the program asks enter Albasword and when enter Albasword turned into questions , and I do not remember the questions is the best teacher

    When I bought the program asks enter Albasword and when enter Albasword turned into questions , and I do not remember the questions is the best teacher

    Click here for information. If the option to have the answers emailed to you isn't available or doesn't work(the email may take a few hours to arrive), contact the iTunes Store staff via the link in the 'Additional Information' section of that article.
    (88705)

  • HT201317 Dear Sir/Madam i want to tell you that I am very disappointed because I just read that in photo stream my photos are stored only for (30) thirty days.I didn't know that and i didn't have the time to save them on a device.I was robbed of mobile al

    Dear Sir/Madam
    I want to tell you that I am very disappointed because I just read that in photo stream my photos are stored only for (30) thirty days.I didn't know that and I didn't have the time to save them on a device.
    I was robbed of mobile before (3) three days and I lost 2.000 photos!
    Is there any possibility to retrieve them?
    If it was possible that would be great as I would save them immediately to my computer instead of losing them again.
    Thank you for understanding
    Kind Regards
    Giaourtsakis Kleanthis

    If you were trying to get this apple, you would do it here:  https://getsupport.apple.com/

  • HT3275 For the past several days, I have been getting this message during backups: Time Machine could not complete the back up.  The backup disk image "Volumes/Data/iMac.sparsebundle" could not be accessed (error-1).

    For the past several days, I have been getting this message during backups:
    Time Machine could not complete the back up.  The backup disk image "Volumes/Data/bhoppy2's iMac.sparsebundle" could not be accessed (error-1).  When I click on the 'help' icon on the message, it reverts to a blank page, and I cannot find anything online regarding the term 'sparsebundle.'  In addition, I cannot access previous backups any longer. 
    Help?

    See C17 in Time Machine Troubleshooting by Time Machine guru Pondini:
    http://pondini.org/TM/Troubleshooting.html

  • When I am logged into iTunes and try to purchase something the window requesting I sign in to iTunes store keeps an appearing no matter how many times I enter the password (even though I'm already signed in!). Any suggestions greatly appreciated. Thanks.

    When I am logged into iTunes and try to purchase something the window requesting I sign in to iTunes store keeps an appearing no matter how many times I enter the password (even though I'm already signed in!). Any suggestions greatly appreciated. Thanks.

    This may help.
    Fix for “No Content” on iPhone & iPod after iOS 4.2.1 update
    The try the standar fixes:
    - Reset. Nothing will be lost.
    Reset iPod touch:  Press and hold the On/Off Sleep/Wake button and the Home
    button at the same time for at least ten seconds, until the Apple logo appears.
    - Restore the iPod from backup via iTues
    - Restore the iPod factoery defaults/new iPod.

  • I have a MacBook 7,1 which i recently installed a PNY 250 SSD and added some RAM. The laptop was running awesome with OSX 10.6.8, lightning fast.  Then I installed Yosemite. There was a bit of hang during the install, but Yosemite came up no issue

    I have a MacBook 7,1 which i recently installed a PNY 250 SSD and added some RAM. The laptop was running awesome with OSX 10.6.8, lightning fast.
    Then I installed Yosemite. There was a bit of hang during the install, but Yosemite came up no issue when I rebooted. Here is the problem:
    Every other time I boot the MacBook it hangs at a grey screen with the prohibitory sign. Verbose reveals a "still waiting for root device" error. Now if I reboot from that hang, it boots fine, but then will hang again the next time. It keeps alternating like this. Any ideas??
    I am not running any third party trim software, so that's not the issue.

    I have a MacBook 7,1 which i recently installed a PNY 250 SSD and added some RAM. The laptop was running awesome with OSX 10.6.8, lightning fast.
    Then I installed Yosemite. There was a bit of hang during the install, but Yosemite came up no issue when I rebooted. Here is the problem:
    Every other time I boot the MacBook it hangs at a grey screen with the prohibitory sign. Verbose reveals a "still waiting for root device" error. Now if I reboot from that hang, it boots fine, but then will hang again the next time. It keeps alternating like this. Any ideas??
    I am not running any third party trim software, so that's not the issue.

Maybe you are looking for

  • Adobe Acrobat Pro 9 Extended Web Capture Problem

    There are three different ways to convert a web page to .pdf that I am aware of.  I have used the first for several years but it has stopped working.  The second now has corrupt fonts.  The third still works.  I have repaired Acrobat to no avail - do

  • In Boot Camp assistant no network connection

    My network works fine, but error message appears "Can't download Windows Support Software because of a network problem." I am trying to use Boot Camp to partition my MacBook into a Windows PC. Also download of Windows Support Software is very slow.

  • In UserInterface, how can I get "SequenceCall" step's "Sequence Call Trace Setting" property ?

    HI ALL! I'm writing an UI. I want to know "SequenceCall" step is tracingEnable or Not. It's said that "Use the Step.Module property to obtain a reference to a SequenceCallModule object". I can not fine it. I can obtain a reference using "TS Adapter A

  • HT4101 Compact Flash RAW files

    I am going to Africa on holiday v soon. To save on bulk I want to be able to transfer my RAW picture files from the compact flash card onto my iPad 2. I purchased a device which acts as a reader and had an Apple connector but even though I have purch

  • Akamai Client Quits When I try to Download CS5

    I keep trying to download CS5 Master Collection for the Mac. The Akamai Client Installer says "connecting" for a few seconds, then it quits. Zuh?