Date and Time calculation in the Service Module

Dear all,
I have quite of a challenge here and i need serious guidance from your side.
My client is in services industry and requires to calculate the date and time when the service call as to be closed. Not only it depends on the contract type the service is linked to but as well on the priority.
The priority in Business One is unique, therefore we created a UDT (User Defined Table) to store the different 'response time' per contract/per priority. Example: a Platinum contract is always 24/7. But a gold contract priority 1 has to be closed in 240 minutes (4 workable hours) while a gold contract priority 2 has to be closed in 480 minutes (8 workable hours).
I created 7 user defined fields on the Service Contract header that calculates the workable minutes per day. So if my coverage for Monday is from 8 AM to 4 PM, my UDF called DiffMon will show 480. For Tuesday, they start a bit later, and the coverage is 8:30 untill 16:00, therefore my UDF called DiffTue = 450.If the check box before the day in the Service Contract window is not ticked, then the UDF shows zero.
I succeeded to calculate the expected closing time by using CASE WHEN statements as following, (all calculated in minutes):
     First, I need to check which day the Service call is created: A Monday or Thursday or... since my time coverage can change every day! I use SET DATEFIRST = 1 and compare today's date accordingly with my UDF DiffMon, DiffTue, etc.
     Then, When end of coverage time today Monday (4PM) minus the create time on the Service Call (1PM) is less then the time stored in my user defined table for that contract and that priority (i.e.480), then just add that to the create time and the create date (DateAdd(mi,...,...) ).
    When end of coverage time Monday (4PM) - Create time (1PM) + DiffTue(450) is bigger than 480, then I know I have enough time to solve my service call tomorrow Tuesday and I take the start time of Tuesday (8:30) + remaining time from yesterday (480-180 -> 180 = 3hours from 1PM to 4PM) and add that to the Create date + 1 so the end result will show Tuesday date and a time of 13:30
   Etc. untill I cover all possibilities based on which day is the service call created.
NOW, I need to include the holiday table !!!!!!!!!!  And I can't foresee how the hell I am going to do that.
The maximum coverage can go up to 60 hours, that means more than a working week! What happens if I have more than one bank holiday in that week period? What happens when my holiday table tells me that  date is a bank holiday but it is actually a Sunday and my contract is only running from Monday to Friday?
Am I going straight to a big mess up?
I will highly appreciate your comments,
Regards,
Frederic

Hi,
it is possible in query designer,
u do the two things for getting the days between to dates
1) in CMOD write the code for sy-datum create a customer exit variable in query as on caldate like eg zcedate
when 'zcedate'.
clear l_s_range.
l_s_range-sign = 'i'.
l_s_range-opt = 'eq'.
l_s_range-low = sy-datum.
append l_s_range to e_t_range.
u write this code exit_saplrrso_001.
it givs the sydatum
2) then u create one more variable on zdate limit with replacement path
then u go forto create the formula variable then it display ascreen there u select both customer exit variable and replacement path variable
zcedate-replacementpathvariable
it gives days i worked on this and succedded.
like the same way fortime also u can do but here at the time of creating the customer exit varible u go for option as range here
l_s_range-low = '20012009'
l_s_range-high = '29012009'
l_s_range-sign ='i'.
l_s_range-opt = 'bt'.
please try with the above one.
Thanks & rEgards,
k.sathish

Similar Messages

  • Why won't the date and time stay in the menu bar?

    I just installed 10.6.2 and even when I use System Preferences to check the box in the Date/Time panel they flicker and disappear from the menu bar. Why won't the Date and Time stay in the Menu Bar? Any suggestions? Thanks.
    Frank B

    Doesn't any bring up the fact that Apple has so many customers with problems that the refuse to help unless you pay them cash? They update you and screw you over and then offer no useful troubleshooting scenarioius to help their millions of customers. It is because they want millions of our dollars. I hate Apple.

  • Report the date and time of all the systems reporting to sccm

    Hi,
    We have a requirement to report the date and time of all the systems reporting to SCCMnot sure if this is possible.
    Appreciate any help regarding this.
    Thanks

    Not sure I understand what you are asking. Do you want to get the date/time for the last hardware inventory, heartbeat discovery etc?
    Kent Agerlund | My blogs: blog.coretech.dk/kea and
    SCUG.dk/ | Twitter:
    @Agerlund | Linkedin: Kent Agerlund |
    Mastering ConfigMgr 2012 The Fundamentals

  • How can I put current date and time in Photo Info (Print module)?

    I often use the Photo Info option in the Print Module to caption my proofs with File Number plus the date and time the print is made.  This allows me to match up the print to the History state for the image, so I know which print version I'm looking at.  I've always wanted to get Lightroom to automatically enter the date and time the print is made.  It obviously knows this info, since it stamps the History state with date and time.  Currently I have to modify my caption manually with Custom text each time I make a print.  This is a major PITA.  Has anyone figured out how to get Lightroom to do this?

    There is a Date/Time title in the titles browser, does just what it says...

  • How do you know the date and time synchronization in the windows version?

    Where can I see the date and time synchronization?

    There's a toolbar button sitting in the Customize Palette. Move that button to a toolbar or into the Open Menu box; when you hover the cursor over that button a tooltip will appear with the day-of-week and the time of the last Sync event.

  • HT2473 How can I get the date and time back on the menu bar?

    Several items disappeared from my menu bar for no  reason known to me.  I miss the date and time and want it back. Please .  I have gone to System Preferences and clicked "date and Time" but it will not allow me to check anything on the page even though there is a box "Show date and time in Menu bar".
    What should be my next move?

    One more thing might help us
    In the Finder > Date & Time Preferences > Take a Full ScreenShot of the entire display showing the "absence" of the check box (or whatever) to Show in Menu Bar
    ⌘ Command + ⇧ Shift > Press ' 3 ' > release all three
    Use the camera tool > locate the screenshot in the Desktop (not sure whether it will say "Picture 1.png" or have a TimeDateStamp as a title.
    ÇÇÇ

  • How to provide date and time stamp to the extracted file.

    I 'm downloading data from DB to Flat file using GUI_DOWLOAD. whenever it is executed it is creating with a file name.
    if i rerun the program the file is overwriting with the same name.
    now based on the requirement how many times i executed, that many times file should be individually created and should be added with date and time stamp.
    like
    if when i executed  at the very first time it should saved with filename, date and time.
    say "Address.txt 04/05/2007 07:55:10"
    When i executed it for second time it doesn't overwrite the file.
    it should create a new file.
    like "Address.txt 04/05/2007 07:59:20".
    Please guide me the way if possible code.
    Thanks in advance.

    Hi Vamsi,
                   Use FM 'F4_PROGRAM' to take file from the user .
    In this case user will enter the file name. u can append date & time to that file path.
    Refer this code.
    CALL FUNCTION 'F4_FILENAME'
        EXPORTING
          PROGRAM_NAME  = SY-REPID
          DYNPRO_NUMBER = SYST-DYNNR
        IMPORTING
          FILE_NAME     = P_P_FILE.
    concatenate P_FILE '04/05/2007 07:59:20' into V_FILE.
    CALL FUNCTION 'GUI_DOWNLOAD'
        EXPORTING
          filename                        = v_file
         filetype                        = 'ASC'
          write_field_separator           = 'X'
        TABLES
          data_tab                        = i_tab
      IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
      IF sy-subrc = 0.
        MESSAGE i002.
      ENDIF.
    Reward points if helpful.
    Regards,
    Hemant.

  • I have a iphone 3 and want to know if there is a date and time stamp on the phone for the pictures

    is there a date and time stamp for pictures on iphone 3?

    Open a one of your pictures in any photo app on your computer and see if the metadata is there.  I'd be surprised if it isn't.

  • Why can't I set the date and time insert to the format I want?

    I would like the date to be formatted in the short form on my docs.  However whenever I insert date and Time it always come out  at the long form i.e.
    Monday, 15 April 2013.
    Right clicking allows me to edit it but the next time I inset it the long form re-appears.
    I've tried to do it via the system preferences > language and text > region > customise  route but the same thing thing happens.  I choose the short form at the top of the choices but it still comes out in the long form on the docs.
    Only a minor point but it is irritating 'cos it should be simple (probably is 'cept I'm a bit slow).
    I'm running Mountain Lion 10.8.3
    Thanks
    W.

    Wilfred.   I found this in one of the More like this posts   >>>>>  opposite your first post.  It might apply if you are on Pages 08.   Insert Date/Time: Apple Support Communities
    I would never have thought of double or right clicking on the date itself.  I haven't tested it to see what formats exist.   One last suggestion, if we don't resolve it here, write a new post and put it in the iWork pages columns.   There you may meet up with the gurus in that persuasion.

  • Date and Time Calculation in Bex.

    Hi All,
    I want to calculate the number of days and the time by subtracting from two dates and time.
    Ex : 27-Jan-2009 10.30AM  - 20-Jan-2009 10.00AM
    Result : 6 days 23 hrs
    In my ODS, i have FROM date, time and TO date,time are in Characteristics.
    is it possible do it in the Query designer.
    Pls provide me the steps.
    Thanks,
    Ram.
    Edited by: Ram Siva on Jan 27, 2009 6:29 AM

    Hi,
    it is possible in query designer,
    u do the two things for getting the days between to dates
    1) in CMOD write the code for sy-datum create a customer exit variable in query as on caldate like eg zcedate
    when 'zcedate'.
    clear l_s_range.
    l_s_range-sign = 'i'.
    l_s_range-opt = 'eq'.
    l_s_range-low = sy-datum.
    append l_s_range to e_t_range.
    u write this code exit_saplrrso_001.
    it givs the sydatum
    2) then u create one more variable on zdate limit with replacement path
    then u go forto create the formula variable then it display ascreen there u select both customer exit variable and replacement path variable
    zcedate-replacementpathvariable
    it gives days i worked on this and succedded.
    like the same way fortime also u can do but here at the time of creating the customer exit varible u go for option as range here
    l_s_range-low = '20012009'
    l_s_range-high = '29012009'
    l_s_range-sign ='i'.
    l_s_range-opt = 'bt'.
    please try with the above one.
    Thanks & rEgards,
    k.sathish

  • Change "date and time"  format in the server.

    i would like to change the "time and date format" to european format from the current default(US) format in the serever.
    Server is on windows XP. if i make the changes to control panel in the server, then too the changes are not reflected.
    do i need to make a change in the SAP engine config?
    nikhil

    hi nikhil,
    go to su01 T-code and type the name for which u want to change the date and time settings as u require go to change mode and then click on defaults tab theer eu can find ur required format for time and date settings. I hope this will help u.
    regards,
    bharath kumar. k

  • HT1551 Apple TV searches for date and time settings, then the screen goes completely black and I get no response from the remote. Any suggestions?

    I've moved to Sweden from Canada, and when I plug my Apple TV in, I get the LED light and the Apple logo, followed by the Setting Date and Time message. After that, everything goes black and I can't make any selections. The LED lgiht is still on however.
    Any help would be appreciated.

    Welcome to the Apple Community.
    If your problem persists get yourself a micro USB cable (sold separately), you can restore your Apple TV from iTunes:
    Remove ALL cables from Apple TV. (if you don't you will not see Apple TV in the iTunes Source list)
    Connect the micro USB cable to the Apple TV and to your computer.
    Reconnect the power cable (only for Apple TV 3)
    Open iTunes.
    Select your Apple TV in the Source list, and then click Restore.

  • Showing date and time not in the big sidebar

    in the previous version i could see the date and time in a little window in the left bottom corner (when info was open) in the existing sidebar. i liked that very much.
    now i can see it only in a very wide sidebar on the right when info is open. i don't like this very much.
    that right sidebar takes a lot of place. i see a lot less photo's on the screen..
    is there a option or hack to see the date and time when i hover above, or click a photo, on a existing top or bottom bar? space enough there...
    cheers...

    Afraid not.
    Regards
    TD

  • Need help with date and time calculations please

    Hello there.. Im stuck, and im hoping someone can help..
    Working on a list to manage and track PTO.  User completes PTO request form,
    Fields
    Name
    Start Date (with time)
    End Date (with time)
    Total Number of Days/hours requested: (calculation)
    Full Day: (Yes/No)
    ok business need
    user has the ability to request a certain number of hours as opposed to a full day.
    After searching around on google. I found this calculation to help me figure out how many BUSINESS days being requested.
    =IF(ISERROR(DATEDIF([Start Date],[End Date],"d")),"",(DATEDIF([Start Date],[End Date],"d"))+1-INT(DATEDIF([Start Date],[End Date],"d")/7)*2-IF((WEEKDAY([End Date])-WEEKDAY([Start Date]))<0,2,0)-IF(OR(AND(WEEKDAY([End
    Date])=7,WEEKDAY([Start Date])=7),AND(WEEKDAY([End Date])=1,WEEKDAY([Start Date])=1)),1,0)-IF(AND(WEEKDAY([Start Date])=1,(WEEKDAY([End Date])-WEEKDAY([Start Date]))>0),1,0)-IF(AND(NOT(WEEKDAY([Start Date])=7),WEEKDAY([End Date])=7),1,0))
    This works great as long as its a [Full Day]="YES", displays results in column labeled Number of days
    now if [Full Day]="No", displays results in column labeled Number of Hours
    BUT this is my issue (well part of it) it calcuate the correct number of hours.. but puts a "1" in "Number of Days" why.. dates have not changed.. I think Its something with the above calculation but I could be way off.
    the end result is I need number of days to concat with number of hours 
    i.e 1 full day 4 hours  1.4
        0 full day 5 hours  0.5
        1 full day 0 hours  1.0
    so that the total can be deducted via workflow.. from the remaining balance in a tracker. (seperate list) 
    Any angels out there??

    Posnera-
    Try changing time zones and see if the travel itinerary times change.
    Fred

  • Date and Time Calculation

    Dear all.
       I need a function that receives a Date / Time and another Date and calculates the the sum of those values.
    Best Regards,
    Thanks In advanced.
    PMR

    Hai Rodrigues,
    The function module CALCULATE_DATE also adds/subtracts days and months to/from a date. The following website also demonstrates a number of ways to add days/months taking into account working and non working days if that is any use. http://www.sapdevelopment.co.uk/tips/date/datehome.htm
    CALL FUNCTION 'CALCULATE_DATE'
    EXPORTING
    DAYS = '0'
    months = '01'
    start_date = p_date
    IMPORTING
    result_date = p_date.
    You can even check this function modules, it works fine.
    Function Module Name:: ADD_TIME_TO_DATE
    Short Description :: Adds months/days/years to date.
    Entering a negative value will subtract from the date.
    Parameters ::
    Exporting:
    I_IDATE : Initial date
    I_TIME : Quantity to add
    I_IPRKZ : Unit of time(D:day, M:month, W:week, Y:year)
    Importing:
    O_IDATE : OUTPUT DATE
    Regards,
    Srikanth.

Maybe you are looking for