Mean time calculation in hrs

Hi,
I need to calculate the time difference between Delivery and sales order time in hrs  using delivery date and time and sales date and time. How can I achieve it?
Please help.
Thanks

d1, t1- sales date and time
d2, t2- Delivery date and time
ABAP code prototype:
hrs type I.
hrs = ( d2 - d1 ) * 24 + ( t2 - t1 ) / 3600.

Similar Messages

  • XMII Logic for calculating mean time

    Hi All,
    My xMII is connected to OPC and from OPC server I am getting the Status of few equipments. I am trying to calculate the mean time between failures. Let me be bit precise.
    Lets take for example, an equipment called Reactor. The Reactor was in running status at 6:00. The status was failure at 6:15, again failure at 6:30. So, I have to track the mean time between two successive 'Failures'. If the time difference between two successive failures exceeds 15 mins, then an entry of that equipment is to be made into the database.
    Can anybody help me out with a logic as to how should I proceed??
    And please explain the steps in detail.
    Thanks in Advance,
    Lipsa.

    If your OPC tag is a digital tag, you can se the totalizer block and some simple math to achieve this.  But you'll need to read the documentation first, try it, then come back with questions! 

  • Ess Leave  Request -Change in Time calculation without changing work schedu

    Hi All,
    We are implementing a ESS Leave Request in EP6 with backend HR ECC5.0.
    The time calculation is taken  from the Work schedule rule in
    HR backend which is 24*7.
    For example if the leave taken is for 2 days-systems calculates as 24*2=48 hrs
    but in actual the requirement is to calculate 2*8 =16 hrs without changing
    the Work Schedule in 2001 infotype in HR Backend.
    Can we do this change through
    1.Validation in portal itself
    2.Changing the RFC PT_ARQ_REQUEST_CHECK
    3.Changing the Absence Types
    Regards
    Anand.

    Hello,
    Please use:
    programming
    but without the spaces before and after } and {
    Testing:
    programming
    regards
    Rick Bakker
    Hanabi Technology

  • My iphone has been water damaged and in the mean time ive gone back to using my old phone. But i need to get all the contacts from my iphone i had synced to my laptop, but i don't know where to find them and im not sure if ive backed them up to anything!

    my iphone has been water damaged and in the mean time ive gone back to using my old phone. But i need to get all the contacts from my iphone i had synced to my laptop, but i don't know where to find them and im not sure if ive backed them up to anything!

    If your contacts are synced to your computer then they are in the supported app you are syncing with.
    When you set up syncing of contacts on your device, which application did you select? 

  • I had a blank iphone and took photos on it then restored it from my last iphone and the photos i recently took in the mean time have gone, how do i get them back?

    I had a blank iphone and took photos on it then restored it from my last iphone and the photos i recently took in the mean time have gone, how do i get them back?

    Retake the photos. They are no longer on your device.

  • Execution time calculation issue

    Hi,
    I have a proceudre which update the tables data and it will capture the execution time for each and every table.
    For that i am using below procedure and its giving incorrect values. i.e., its giving end_time<start_time
    PFB code(Line nos 25,26,33,73,7679,80 code for exeution time calculation) and output.
    1 CREATE OR REPLACE PROCEDURE my_proc
    2 IS
    3 CURSOR c
    4 IS
    5 SELECT tablename, TYPE
    6 FROM table_list;
    7
    8 TYPE emp_record IS RECORD (
    9 empkey tab1.pkey%TYPE,
    10 rid ROWID,
    11 ID tab_join.ID%TYPE,
    12 dt tab_join.dt%TYPE
    13 );
    14
    15 TYPE emp_type IS TABLE OF emp_record
    16 INDEX BY BINARY_INTEGER;
    17
    18 v_emp emp_type;
    19
    20 TYPE emp_type_rowid IS TABLE OF ROWID
    21 INDEX BY BINARY_INTEGER;
    22 tab_no Number:=0;
    23 emp_rowid emp_type_rowid;
    24 r_cur sys_refcursor;
    25 v_start_time TIMESTAMP; /** Added for time calculation*/
    26 v_end_time TIMESTAMP; /** Added for time calculation*/
    27 string1 VARCHAR2 (1000) := 'SELECT b.empkey, b.ROWID rid, a.id id, a.dt dt FROM emp_base a,';
    28 string2 VARCHAR2 (1000) := ' b WHERE a.empkey = b.empkey';
    29 rowcnt Number;
    30BEGIN
    31 FOR c1 IN c
    32 LOOP
    33 tab_no:=tab_no+1;
    34 v_start_time := SYSTIMESTAMP; /** Added for time calculation*/
    35 BEGIN
    36 string_d := string1 || c1.tablename || string2;
    37
    38 OPEN r_cur FOR string_d;
    39
    40 LOOP
    41 FETCH r_cur
    42 BULK COLLECT INTO v_emp LIMIT 50000;
    43
    44 IF v_emp.COUNT > 0
    45 THEN
    46 FOR j IN v_emp.FIRST .. v_emp.LAST
    47 LOOP
    48 emp_rowid (j) := v_emp (j).rid;
    49 END LOOP;
    50
    51 upd_string := ' UPDATE ' || c1.tablename || ' SET id = ' || v_emp (1).ID || 'WHERE ROWID = :emp_rowid';
    52 FORALL i IN emp_rowid.FIRST .. emp_rowid.LAST
    53 EXECUTE IMMEDIATE upd_string
    54 USING emp_rowid (i);
    55 rowcnt := rowcnt + emp_rowid.COUNT;
    56 END IF;
    57
    58 EXIT WHEN v_emp.COUNT < 50000;
    59 v_emp.DELETE;
    60 emp_rowid.DELETE;
    61 END LOOP;
    62
    63 v_emp.DELETE;
    64 emp_rowid.DELETE;
    65
    66 CLOSE r_cur;
    67 EXCEPTION
    68 WHEN OTHERS
    69 THEN
    70 DBMS_OUTPUT.put_line (SQLERRM);
    71 END;
    72
    73 v_end_time := SYSTIMESTAMP; /** Added for time calculation*/
    74
    75 INSERT INTO exec_time
    76 VALUES (tab_no||' '||c1.tablename, v_start_time, v_end_time, v_end_time - v_start_time, rowcnt); /** Added for time calculation*/
    77
    78 COMMIT;
    79 v_start_time := NULL; /** Added for time calculation*/
    80 v_end_time := NULL; /** Added for time calculation*/
    81 rowcnt := 0;
    82 END LOOP;
    83END;
    Output :
    TableName: exec_time
    "TABLE_NAME"      "START_TIME"     "END_TIME"      "EXCUTION_TIME"      "NO_OF_RECORDS_PROCESSED"
    TAB7      5/29/2013 10:52:23.000000 AM      5/29/2013 10:52:24.000000 AM      +00 00:00:00.521707      773
    TAB5      5/29/2013 10:52:18.000000 AM      5/29/2013 10:52:15.000000 AM      -00 00:00:03.381468      56525
    TAB6      5/29/2013 10:52:15.000000 AM      5/29/2013 10:52:23.000000 AM      +00 00:00:08.624420      49078
    TAB2      5/29/2013 10:51:54.000000 AM      5/29/2013 10:51:42.000000 AM      -00 00:00:11.932558      529
    TAB4      5/29/2013 10:51:47.000000 AM      5/29/2013 10:52:18.000000 AM      +00 00:00:31.208966      308670
    TAB1      5/29/2013 10:51:45.000000 AM      5/29/2013 10:51:54.000000 AM      +00 00:00:09.124238      65921
    TAB3      5/29/2013 10:51:42.000000 AM      5/29/2013 10:51:47.000000 AM      +00 00:00:04.502432      12118
    Issue: I am getting execution time in negitive values because end_time<start_time coming.
    Please suggest me how to resolve this.
    Thanks.

    Welcome to the forum!!
    Please read {message:id=9360002} from the FAQ to know the list of details (WHAT and HOW) you need to specify when asking a question.
    I primarily hate 3 things in your code
    1. The way you have used BULK update which is totally unnecessary
    2. COMMIT inside LOOP
    3. The use of WHEN OTHERS exception.
    Your code can be simplified like this
    create or replace procedure my_proc
    is
       v_start_time timestamp;
       v_end_time   timestamp;
       v_rowcnt     integer;
    begin
       for c1 in (
                     select rownum tab_no
                          , tablename
                          , type
                       from table_list
       loop
          sql_string := q'[
                                  merge into #tablename# a
                                  using (
                                          select id, dt
                                            from emp_base
                                        ) b
                                     on (
                                          a.empkey = b.empkey
                                    when matched then
                                        update set a.id = b.id;
          sql_string := replace(sql_string, '#tablename#', c1.tablename);
          v_start_time := systimestamp;
          execute immediate sql_string;
          v_end_time   := systimestamp;
          v_rowcnt     := sql%rowcount;
          insert into exec_time
               values
                    c1.tab_no || ' ' || c1.tablename
                  , v_start_time
                  , v_end_time
                  , v_end_time - v_start_time
                  , v_rowcnt
       end loop;
       commit;
    end; In the INSERT statement on the table EXEC_TIME try to include the column list.
    NOTE: The above code is untested.

  • Spool request has been reused in mean time

    hi all,
    when i am going to open spool for completed job it is saying like " spool request has been reused in mean time".
    plz can any one guide me to solve this issue.
    regards
    subhani.

    Hi,
    This isn't the right forum for your question.
    Check the post below, see if helps your problem.
    spool problem
    Regards,
    Vishnu

  • How is Processing time calculated in Simulation

    Hi,
    How is processing time calculated for every simulation-relevant object?
    say for example,
    i have 2 objects of person type (p1 and p1)
    4 human tasks (T1, T2, T3, T4)
    T1 assigned to p1, processing time 2hrs
    T2 assigned to p1, processing time 2hrs
    T3 assigned to p2, processing time 2hrs
    T4 assigned to p2, processing time 2hrs
    start --&gt; T1(p1) --&gt; T2(p1) --&gt; T3(p2) --&gt; T4(p2) --&gt; end
    Have not set any other simualtion parameters. now,
    * Duration for simulation is set to 6hrs,
    T1, T2, and T3 are getting processes once, but start event is getting processed twice
    # Why is start event getting processed second time?
    # Will this take any processing time..
    * Duration for simulation set to 7hrs,
    start event and T1 gets processed 2 times, T2 and T3 once..
    and the total processing time becomes *8hrs*..
    # At wht point of time does the second processing of T1 start.
    # If it is not after after the completion of one full process cycle, in this case, why not the second processing start at the end # of 2nd hour, or 4th hour.
    Thanks,
    Vishnupriya

    Hi Vishnupriya,
    "Why is start event getting processed second time?"Can you check the "Frequency" attribute of your start event? There you can specify how often the process will be triggered.
    "At wht point of time does the second processing of T1 start."You should be able to check it in the Processes (det.). It provides an overview regarding the process instances started during the simulation run. Furthermore you can check the Events (det.) category.
    Best regards,
    Danilo

  • Scout: Too much time calculating dirty regions

    Hi All,
    Frist of all, sorry for my English.
    I have a problem with my AIR App, I'm developing for Android and iOS. In iOS works perfectly but on Android the performance is poor.
    I checked with Scout and this is what i see:
    I don't understand why it spends so much time calculating dirty regions but I didn't change anything on the DisplayList.
    Edit: AS you can see in the screen the frames are 13 but in the next frames is over 200 frames and that repeats.
    Can someone tell me how to interpret this results?
    Thanks a lot.
    Goratz
    Mensaje editado por: goratz

    The feature you are referring to exists in Logic but not in GarageBand (yet?). It is called the Marquee Tool that lets you drag a selection, and when hitting the delete key, that section of the Region(s) will be deleted, and the remaining part of the Region on the right will be moved to the left to close the gap (if you you have set the Drag Mode to "Shuffle L").
    Hope that helps
    Edgar Rothermich
    http://DingDingMusic.com/Manuals/
    'I may receive some form of compensation, financial or otherwise, from my recommendation or link.'

  • Warning Time calculation "Before Aggregation" is obsolete

    Hi,
    Recently in our project we have upgraded BW 3.0B to BI7.
    After upgrade to BI7,  when we run some of the reports we are getting a warning message as below -
    Warning Time calculation "Before Aggregation" is obsolete.
    Pls refer to the attachment.
    Any of our satyam colleagues encounter this warning, if so what was the solution you applied.
    Note : I found some notes in Forum like saying use ' Exception Aggregation' for the Before Aggregation.. etc etc., but my problem is in our project thre are many CKFs are there which are using 'Before Aggregation'.
    Please let me know if you have any other alternatives.
    Thanks !!!!!!!!!

    Hi,
    Try SAP notes 935903.
    Symptom
    Calculated Key Figures "Existance Indicator" with aggregation behaviour "Before Aggregation" will get now with NW 2004s warning popup "Time of calculation 'Before Aggregation' is obsolete" during execution.
    this may be helpful.
    thanks,
    JituK

  • Time Calculation Shell dimension is slow compared to hardcoded measure?

    Hi,
    I have a measuregroup with 200m+ rows with about 20 measures (sums). I've created a shell dimension to hold my time calculation members such as mtd, qtd, ytd, etc. My problem is that it performs REALLY poorly when using the time calculation dimension.
     My script looks like this:
    SCOPE
    Measuregroupmeasures("MyMeasureGroup");
    SCOPE
    [Time Calculation].[Calculation].&[None];
    THIS =
    [Measures].CurrentMember;
    END SCOPE;
    SCOPE
    [Time Calculation].[Calculation].&[MTD];
    THIS =
    Aggregate
    [Time Calculation].[Calculation].&[None]
    MTD([Date].[Calendar (YQMD)].CurrentMember)
    END SCOPE;
    SCOPE
    [Time Calculation].[Calculation].&[QTD];
    THIS =
    Aggregate
    [Time Calculation].[Calculation].&[None]
    QTD([Date].[Calendar (YQMD)].CurrentMember)
    END SCOPE;
    SCOPE
    [Time Calculation].[Calculation].&[YTD];
    THIS =
    Aggregate
    [Time Calculation].[Calculation].&[None]
    YTD([Date].[Calendar (YQMD)].CurrentMember)
    END SCOPE;
    END SCOPE;
    When I use my Calendar hierarchy and time calculation dimension as a background selection it takes forever. It never returns anything. A profiler trace shows that it's just pushing 1 and 21 events (cache data).
    If I create the following measure:
    CREATE
    MEMBER CURRENTCUBE.[Measures].[TestMTD] AS
    SUM(MTD([Date].[Calendar (YQMD)].CurrentMember), [Measures].[MyMeasure]),
    VISIBLE = 1 ;
    it works just fine but the whole point here is I want to avoid creating new measure for every time calculation.
    The measuregroup has been partitioned by month and I've set each partition slice to the corresponding month in the calendar hierarchy.
    Why doesn't my script perform - please advice :)
    Thanks.

    Hi Mortenbpost,
    According to your description, the issue was solved by change Aggregate() function to Sum() function, now you want to know why it behaves like that, right?
    In Aggregate function, if a numeric expression is not provided, this function aggregates each measure within the current query context by using the default aggregation operator that is specified for each measure. Here is a thread which discuss difference
    between AGGREGATE() and SUM()https://social.msdn.microsoft.com/Forums/sqlserver/en-US/ef4b2555-45f2-4871-9137-a12a637ce2f5/whats-the-difference-between-aggregate-and-sum?forum=sqlanalysisservices
    Besides, you can use SQL profiler to monitor what's the difference between using AGGREGATE() and using SUM().
    Regards,
    Charlie Liao
    TechNet Community Support

  • New iPhone 6 Plus battery standby time is 12 hrs

    I bought my iPhone 6 Plus directly from Verizon website about a month ago. Since than, I am having constant battery problems and it is practically burning during a charging process. ( I am using the charger that came with the phone). I checked the battery standby time today and it is less than 10 hrs when the battey is at 76%. (only used for 2 hrs and 46 min after last full charge).
    Iphone 6 plus suppose to have good battery time (10days standby time) while my brand new phone has standby time of 12 hrs. What should I do?
    http://imgur.com/42BneHc

    Maybe you should  contact Apple Support and talk to them. They can check the battery online.
    You can also visit this page to do that: iPhone - Contact Support - Apple Support
    Click on Apple Support, then on ->Battery, Power &Charging ->Battery questions and troubleshooting, and follow the instructions.

  • Transit time calculation through Route during Location Substitution

    Hi All,
          I have standard route determination set up in SD. I am picking up the route from Sales order and calculating the transit time in APO through condition technique TRAN.
         But when I do a location substitution , my transit time calculation is being done with the original route.
        EX: Original plant P1            Route: R1         Transit time: 24 hours
               Substituted Plant:   P2   Route : R2        Transit time :96 hours
              But my transit time in the substituted plant P2 is also 24 hours. Although I can see the new route R2 in the sales order item of the substituted item.
         Is there a user exit I can put?

    Hi ,
    Please try using Plant and Ship To combination, I saw it does not work with Route and shipping point.
    Thanks,
    Pavan Verma

  • What does the message mean time capsule already in use when it refueses to backup?

    What does the message mean time capsule already in use when it refueses to backup?

    Just the network is cranky..
    Simple first step.. restart the TC.. ie unplug the power cord.. count to 10.. plug it back in.
    Second step if that fails.. restart the network.. off everything.. restart in order.. modem.. TC.. clients 2min gap.
    Finally if you are prepared to fight you can load 5.6 utility onto Mountain Lion and do a disconnect all users.. or a few other ways.. turn off file sharing and turn it back on.
    The issue being TM did not dismount the sparsebundle correctly.
    C12 http://pondini.org/TM/Troubleshooting.html
    For more info.

  • 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

Maybe you are looking for

  • How to reference a Planning Application in Workspace

    Hello, I've developped several Planning applications. But when I open workspace / Applications / Planning, (with an admin user) I only see one Planning application. So I want to know how to reference a Planning application in Workspace ?? Thanks for

  • Create Report/Form region with button in header?

    For theme 16, how to create Report or Form region that will have HTML Template Alternative1 button in tile (in that gray part, and not under)? <br> THX in front! <br> P.S. <br> Have tried something, http://i11.tinypic.com/47dsuhv.png and http://i14.t

  • Approving records in part by part, urgant.

    Dear Friends, i am creating a simple workflow, that sends a groups of employee records in one batch to manager for approval when manager opens the screen (d2k from interface) he could see , all the records waiting for his approval for a batch. and he

  • Quick time v.7.1.3 play mpeg files without sound

    From day to an other day, I dont know why, but quick time stop to produce sound and it is affect too the player of Itunes. It is the same effect for all my mpeg files. My mpeg, codec MPEG1 muxed, files look ok because mplayer OSX play them correctly.

  • Authorisation roles and transaction codes for users(MTO--PPmodule)

    Hi !!! GURUS !!!!!!!! I am working here on live project for  make to order scenario. We are using only batch management. Could you give me transaction codes for users for authorisation roles. All codes from start to end scenario. Regards, Nitin