Date diff calculations

I want to calculate the date diff for delivery date(eg;-sep-24 ,2007) and scheduled date(eg:-sep-17,2007)there the result should be 7 but i dont no how to write query can we use routines in this kind of situations...

hai
use replacement path for both dates and create a new formula by subtracting from(delivery date -scheduled date)
below is the best example
http://www.sd-solutions.com/documents/SDS_BW_Replacement%20Path%20Variables.html
chk these links would help u more,
http://help.sap.com/saphelp_nw04/helpdata/en/3f/89533e5ff4d064e10000000a114084/content.htm
http://help.sap.com/saphelp_nw04/helpdata/en/2c/78a03c1178ad2ce10000000a114084/content.htm
http://help.sap.com/saphelp_nw04/helpdata/en/af/809528939d5b4fbff7e16a5bdc0d85/content.htm
http://help.sap.com/search/highlightContent.jsp
http://help.sap.com/saphelp_nw04s/helpdata/en/e3/e60138fede083de10000009b38f8cf/frameset.htm
http://help.sap.com/saphelp_nw04s/helpdata/en/e3/e60138fede083de10000009b38f8cf/frameset.htm
http://help.sap.com/saphelp_nw04s/helpdata/en/e3/e60138fede083de10000009b38f8cf/frameset.htm
http://help.sap.com/saphelp_nw04s/helpdata/en/e3/e60138fede083de10000009b38f8cf/frameset.htm

Similar Messages

  • Date difference calculation - help!

    hey people, i've got the below method, i'm trying to calculate the difference between two dates. the calculation is wrong as it is outputing the wrong duration... can anyone help?
    public int getDuration(Date startDate,Date endDate)
    GregorianCalendar start = new GregorianCalendar();
    start.setTime(startDate);
    GregorianCalendar end = new GregorianCalendar();
    start.setTime(endDate);
    long diff = 0L;
    if(start.getTime().before(end.getTime()) == true)
    diff = end.getTimeInMillis() - start.getTimeInMillis();
    diff = diff/(24*60*60*1000);
    Long L = new Long(diff);
    return L.intValue();
    THanks, Ian

    In the mean time, a couple of stylisitc suggestions:
    if(start.getTime().before(end.getTime()) == true)
    // == true is redundant and cluttersome
    if(start.getTime().before(end.getTime()))
    Long L = new Long(diff);
    return L.intValue();I'd suggest returning a long, rather than an int. If you insist on returning an int, because you're sure that the number of days will never be more than Integer.MAX_VALUE, then add an assertion that its not.
    assert diff <= Integer.MAX_VALUE : diff + " too big";The Long is overkill. If you do have a small enough value, just do return (int)diff;

  • Delivery date getting calculated wrongly in delivery created via VL10D

    Hi Gurus,
    We have a strange issue, where in delivery date is getting calculated wrongly for replenishment delivery created via VL10D.
    When we are creating via VL10D , delivery date is getting the additional 30 days from MaxDlvCrteDate . With initial investigation i see that VL10D has delivery creation profile 0101 for which no of days maintained in max delv creation date is 30 .
    I assume that the delivery date is getting the additional days from delivery creation profile felid no of max delv creation date .
    I have created the delivery on 24.03.2011, as per the route no of TL time is 9 days , So Ideally the delivery date should be 04.04.2011 , however system has calculated it as 23.04.2011
    Delivery no             No of days in MaxDlvCrteDate                        Delivery  date
    213443158                           30                                                       23.04.2011
    If I create the delivery for the same PO using t-code VL10B, then delivery date is calculating correctly.
    Not sure why system behavior is strange.
    Please help me with your inputs to resolve the issue..
    Thanks in advance

    Please request one Abaper  to solve this problem.
    You cannot due nothing as the problem is in Code.
    Regards
    William

  • Date Diff Issues

    1. Subscriber – Employee Details has these three records
    2. Call Details  has these two records
    My main goal is to populate date diff in table 1 as 1 if "work order check in date" >= 3 of Aspect calender date from the 2nd table.
    The Problem i am facing is that the date diff in table 1 does not populate. I have come to an understanding that the issue is because of many t many relationship between table 1 and table 2. Is there a way to work around this?
    Date Diff formula - If(DaysBetween([Work Order Check In Date];[Base2]) >=3 ;1;0)

    Hi Akshay
    Did you try removing If condition and able to see the date difference result,if so is it working fine or not? If it is working fine use this result and define another variable for If-else and validate the condition
    Regards
    Bose

  • How and where does Delivery Date get calculated in ME51N

    Hi,
    Can anyone please let me know the point where the delivery date is calculated in ME51N ?
    i enter the Material and Plant and press enter and Delivery Date ( = Current Date ) gets populated automatically. I need to find out where it happens.
    Because there is a requirement that the Delivery Date should be equal to the Current Date + some Lead Time, instead of the current Date. So, I need to find a BADI or exit.
    For the transaction ME51N, there is only one Customer Exit - MEREQ001. And if I put a break-point at the compnents of this exit, the control doesnt go to these exits when I press Enter.
    And there is a BADI 'ME_REQ_POSTED', which gets triggered when we save ME51N, but it should be triggered even when we press enter.
    Please help me with all the above details.

    Hi Dagny,
    This is related to PO stuff. Probably the logic may be useful for you.
    You can try out enhancements:
    LMEKO001
    LMEKO002
    And you try out below code.
    FIELD-SYMBOLS: <beket> TYPE ANY TABLE.
    DATA: l_date        TYPE d
         l_ebelp       TYPE ebelp,
         w_beket       TYPE beket,
         t_beket       TYPE STANDARD TABLE OF beket,
         w_data        TYPE ty_data.
    * Get the item number in the correct format.
    l_ebelp = komp-kposn+1(5).
    * Get the tabe with Delivery Schedule data.
    ASSIGN ('(SAPLMEPO)ETT[]') TO <beket>.
    t_beket[] = <beket>[].
    READ TABLE t_beket INTO w_beket WITH KEY ebelp = l_ebelp.
    *l_data = w_beket-eindt.*
    Here l_data has the delivey date field you can even modify this data and update what ever u want.
    Thanks,
    Raj
    Edited by: Raja gurrala on Jul 23, 2009 3:24 PM

  • Results analysis data is calculated through sales order

    Hi All,
    I m trying to calculate WIP of one process Order through KKAX. But I am getting the below error
    Results analysis data is calculated through sales order 300002423 001000
    Message no. KJ112
    Diagnosis
    The order you selected for WIP calculation or results analysis is assigned to a sales order. A results analysis key was entered for this sales order.
    System Response
    The system determines results analysis data for orders assigned to sales order items through the results analysis for the sales order.
    Procedure
    Carry out results analyis on sales order 300002423 001000.
    This process Order is related to Sales Order and I have checked the Result Analysis key is attached to Sales Order.
    Please help me out in this issue.
    Thanks!
    Regards,
    Vivek

    Hi,
    I was getting the above error because a RA key was selected ar Sales Order, Now what I have done is I have removed the RA Key from Sales Order, there is already a RA key attached to Process Order. Now When i am calculating KKAX (WIP) I am getting below message
    The order is not a WIP element
    Message no. KJ148
    I have done this because my client is not using KKA3(RA fro Sales Order)
    Please help!!!!!!!!!
    Thanks!
    Regards,
    Vivek Srivastava

  • Delivery Date Re-Calculation in Stock Transfer Order PO

    Hi All,
    We have Transportation scheduling activated and maintain 'Transit Duration Times' in our Routes (Populated 'TransitDur' field in Route <0VTC>) R/3 46c
    When we create a stock transfer order the 'Delivery Date' in the STO PO is determined by the 'TransitDur' (Transit Duration) value maintained in the route between the 'Supplying and 'Receiving' plants.
    After creating the STO PO, if the delivery is delayed and we need to reflect this change in the STO, when we attempt to change the delivery date - the system re-calculates the delivery date using the date on which the changes are made as the starting point and extending out the full length of time based on the value in the 'TransitDur' field in the Route.
    This means we are not able to change the delivery date in the STO PO to a date that is later than the original delivery date but still earlier than the date re-calculated by the system using the date on which the changes are made as the starting point.
    Is anyone aware of any functionality/config which allows you to manually change the delivery date in the STO PO - but not be restricted to changing the date by the value in the 'TransitDur' field of the Route, when it is a subsequent change to the PO and greater than the original date determined by the system?
    Thanks,
    Ravelle

    A solution has not been identified for this issue...query closed.

  • Explain How delivery date is calculated using backward and forward schedul

    How can anyone please explain how delivery date is calculated using forward and backward scheduling
    I want to have it broken down into the following steps
    for eg for delivery date calculation following dates are used
    Material Availabilty Date
    Material Staging Date
    Pick/pack time
    Transportation PLanning date
    Loading date
    Goods issue date
    Transit Date
    Delivery Date
    Can some one please give me an example and explain wht these dates are
    for eg customer needs delivery date on  11/20/2008
    how would the system cacluate whether it can meet the delivery date using backward scheduling
    and if it doesnt meet how does the system do the forward scheduling
    also i am not clear with the following dates
    material avaialibilty date
    material staging date
    transportation date
    can some one please explain me all this in detail
    Thanks

    Hi,
    Basically this is the CRSD(Customer requested ship date logic)logic in which system calculates the ship date depends upon the material availability. If material is available system calculates ship date on the basis of master data maintained in customisation.Master data is maintained in the  following link.
    If material is not available then system takes into consideration vendor delivery date & then calculate customer ship date.
    Please go through the link in SPRO
    LE-Shipping -Basic shipping functions-Scheduling -Delivery scheduling & Transportation scheduling-Maintain duration.
    In customisation following data is maintained
    Material Availabilty Date
    Material Staging Date
    Pick/pack time
    Transportation PLanning date
    Loading date
    Goods issue date
    Transit Date
    Delivery Date
    Hope you got the idea of CRSD calculation
    Regards,
    Prashant.

  • Basic / Scheduling dates are calculated for both main orders and Collective

    How the Basic / Scheduling dates are calculated for both main orders and Collective orders?
    when in master data we have given different value of in house production time for both the orders.

    Hi,
    The basic dates are calculated from the data mentioned in the Material Master - In-house production time days, either lot size dependent or lot size independent.
    The scheduled dates are calculated from the timings maintained in the routing.
    In the configuration for Scheduling parameters for the order type - Adjust scheduling - the dates can be adjusted.
    Kindly revert back if you need any further clarifications.
    Warm regards,
    Umesh Poojari

  • Date Based Calculations

    We have the following requirements:
    1.     In terms of minutes provide the difference between the expected time and actual time of arrival
    2.     With a tolerance level of 5 minutes compare expected and actual time dates providing an On time value
    Are these date based calculations straight forward as part of the data model (not at query level) in BW and if so how is this done?  Thanks
    We will create Key Figure DAT InfoObjects

    Thanks for that.  I have had a look at the FM and the input values are:
    Date 1
    Time 1
    Date 2
    Time 2
    I am aware that I can get say right set of numbers.  However is the time part stored in BW?
    Thanks very much guys have checked.  Oscar TIMS is available in BW.  Have awarded points
    Message was edited by:
            Niten Shah

  • Use Date() for calculation

    Dear sir,
    I want to know how to use Date() for calculation.
    For example:
    int rentday = 7;
    today = new Date();
    I want to add today and rentday to get dueday. I've try to use "dueday=today + rentday", but error.
    Pls help!!! Thanks!!!

    Hi "acos3ltd",
    I think, perhaps, that the "java.util.GregorianCalendar" class may be what you require:
    http://java.sun.com/j2se/1.4.1/docs/api/java/util/GregorianCalendar.html
    and this Web page may also be of help:
    http://java.sun.com/people/linden/faq_b2.html#Date
    Hope it helps.
    Good Luck,
    Avi.

  • Date diff

    Hi,
    I went through a lot of date related post and was able to write a script(with alps help-Re: Days behaviour between two dates Now iam using 11.1.2.1 planning on top of essbase. While my end date is saved as a sub var with value 20131231. the beginning date is a user input in data forms in planning. I used the member that hold this date value in the script but it doesnt do the calculation. No value is getting populated as output. the script is working , as ive tested it with two sub vars instead of user input.
    But i came across posts that spoke about difference in format that dates gets saved for essbase and planning. the date that i enter in planning reflects as "2.0130405E7" in essbase when i retrieve .
    Please do help.
    thanks

    Hi Alp,
    Am sorry for replying late. Here s waht my situation. The Year end date wd be saved as subvar in essbase, value =20131231. Project end date would be a date value fed from planning data forms to a account member of type date. Ive took help from one of your post and just inputted my values as you can see below.
    var y1, y2, m1, m2, d1, d2, difx1, difx2,diff,a,b,x;
    SET CREATENONMISSINGBLK ON;
    SET CACHE HIGH;
    Fix(&Curr_Year,"Actual","HSP_InputValue","No Employee","No Product","1st Pass","GL_Load","No Line Item","No Asset","No_Custom1","Jan")
    Fix("50")
    FIX("01-03-390")
    "Depreciation-IT HW"
    y1=@ROUND("Project End Date"/10000,0);
    y2=@ROUND(&YearEnd/10000,0);
    m1=@ROUND(("Project End Date"-y1*10000)/100,0);
    m2=@ROUND((&YearEnd-y2*10000)/100,0);
    d1="Project End Date"-(y1*10000+m1*100);
    d2=&YearEnd-(y2*10000+m2*100);
    difx1=@TODATEEX("mm/dd/yyyy",@JconcatStrings(@LIST(@JgetStringFromDouble(m2),"/",@JgetStringFromDouble(d2),"/",@JgetStringFromDouble(y2))));
    difx2=@TODATEEX("mm/dd/yyyy",@JconcatStrings(@LIST(@JgetStringFromDouble(m1),"/",@JgetStringFromDouble(d1),"/",@JgetStringFromDouble(y1))));
    diff=@datediff(difx2,difx1,DP_DAY);
    "Depreciation-IT HW"=@ROUND(diff*("165012"/1095),0);
    "Total Budget required"
    "Total Budget required"="Fit Out Cost"+"165012"+"165007"+"165017";
    endfix;
    endfix;
    endfix;
    The rule started working fine, for dates i inputed through the data form, taking value of Project End date. But since it was just under testing i had Fixed it for Jan alone. Then when i included other months it started to fail saying Error in date formatting. And then a few times i went back and saw the rule run for Jan but later it stopped for all.
    the value of project end date gets saved in essbase as 2.0130131E7. But in planning when i check for raw data it shows 20130131, so i thought the rule was logically fine.
    please do direct me in the right way.
    thanks,

  • Due date not calculated in F-28

    Hello,
    Can anyone tell me if in standard SAP, in F-28 (incoming payment) why the due date (or payment date) is not calculated ?
    I fulfilled posting date and document date (both 01/09/2009) and payment terms also (Z100 - 90 days end of month), but after saving the document and when i check it in FB03, i found that payment date (or due date) still 01/09/2009 and not 30/11/2009.
    Can someone explain why and in which cases SAP dosn't calculate the due date ?
    In advance, thank you for help

    Hi,
    The transaction F-28 - Incoming payment, in general it is used for receiving payments.  Then what is your requirement to calculate due data from posting date of this document.  Are you referring to value date in the bank item?  The due date will be calculated from baseline date in invoice, in this case you need to check the baseline date in the invoice (open item), right?
    Correct me, if my understanding on your requirement is wrong.
    thanks,
    Kumar

  • SSAS data source calculating from two data source

    Hi There,
    I have SSAS cube and use SSRS 2008R2. Basically I have cube A for current month income statement, cube B from previous month, they have shared the same dimensions. I want to create  report to show
                      current month  previous Month            Calculation
       Account               Amount A         Amount B            Amount A - Amount
    B
    Revenue                 Amount A         Amount B            Amount B
       Expense              ,,,,,,
    Net Income
    Any advice?
    Thanks
    Don

    Hi Dz0001,
    According to your description, you want to combine the data from two cube into one tablix. Right?
    In this scenario, since your two cube share same dimensions, we can use lookup() function to retrieve the income from another dataset based on the data field for dimension rows.
    For example, let's say you have DataSet1 retrieves data from cube A with data fields
    Account and Income, DataSet2 retrieves data from cube B with data fields
    Account and PreIncome. When rendering the data field from DataSet1 in a table, you can use the expression below in detail row.
    =Lookup(Fields!Account.Value,Fields!Account.Value,Fields!PreIncome.Value,"DataSet2")
    Reference:
    Lookup Function (Report Builder and SSRS)
    If you have any question, please feel free to ask.
    Best Regards,
    Simon Hou
    TechNet Community Support

  • Basic and scheduling  dates & time calculation in process order creation

    Hi guru's,
    i have one requirement, i need to calculate and display the basic and scheduled dates & times based on the given input i.e material , plant , process order type , quantity , UOM and scheduling type ( for corresponding scheduling type user will provide either start date or finish date ) using RFC. can  u plz provide any function module for this purpose or logic for calculating the same  , as i am working on version 4.7ee .
    Awaiting for a quick response.
    Regards,
    Madan

    Dear Rohan,
    1.Check the length of break timings defined in the resource that is assigned in the phase.
    2.Check in OPUZ whether for the process order type and plant combination whether scheduling is to include the break time also
    (whether the check box for scheduling with breaks) is included.
    Check and revert back.
    Regards
    Mangalraj.S

Maybe you are looking for

  • How do i print a photo with the file name

    This seem stupid simple but I cannot find an answer anywhere. I want to print out hardcopies of phots with the file name printed with the photo. In Windows there is a program called Picture Manager (which has been eliminated in Office 2013) where you

  • My iPhone 5 is suddenly having audio issues through the headphone jack.

    So this is a strange situation, and I'll try to explain in depth so that someone might be able to suggest a solution. As reference, I have an iPhone 5 that I purchased in late-February. I've had every other model of iPhone except for the first iPhone

  • Calculating Average on a Pivot table- Not calculating correct

    Hello All BI Techie's, I have a requirrement, which is calculating the average out of a column , this column is aggreated by sum in the rpd. Month Year      Associate Headcount      Involuntary Termination Count (Associates) 2012 / 07      18878.0   

  • AME Crashing at Startup wiht WatchFolder.dll

    When starting my AME it crashes at Startup. Any idea on what I can do to resolve this? I'm using Windows 7-64-bit. It was working well before. Application: Adobe Media Encoder.exe Framework Version: v4.0.30319 Description: The process was terminated

  • Production Order  Start Date

    Hello All, I am facing a problem in a Production order.When I am trying to change the  Production order Start date  and saving the changes I am getting a termination error (program termination). The error message is as below Nested call of PERFORM ON