How to calculate delivery date

Hello,
I'm trying to use a formatted search in a Sales Order to calculate the delivery date per row.
I found the following that could be my answer, but not sure how to proceed:
DATEADD (datepart, number, date)
Based on the item information on tab 'Planning' field Lead Time (OITM.LeadTime) I want to calculate the document date plus the Lead Time (or should I create a UDF?).
I did created the following query:
DATEADD(day, $[OITM.LeadTime], $[$10.0.DATE])
When running the query I get the following:
DATEADD(day, N'', CONVERT(DATETIME, '20080325', 112))
As you can see it didn't fill the 'number' with the leadtime information (which is 3 in my case).
And I receive the following error:
1). [Microsoft][SQL Native Client][SQL Server] Incorrect syntax near 'day'. 2).[Microsoft][SQL Native Client][SQL Server] Statement 'User-Defined Values'(CSHS) (s) could not be prepared.
How can I my result?
Regards,
Petronella

This seems to work.
SELECT DATEADD(day, (SELECT LeadTime FROM OITM WHERE ItemCode = $[$38.1.0]), $[$10.0.DATE])
Regards,
Douglas

Similar Messages

  • How to calculate delivery date of PR

    Dear experts,
    I want to calculate the delivery date of purchase requisition item in the program which is proposed in PR creation. Anyone can give me the function module or subroutine for this?
    Many Thanks,
    Tony.

    Hi,
         It includes "processing time for purchasing + planned delivery time + GR processing time".
    Processing time for purchasing in tcode OPPQ (process time for purchase)
    Planned delivery time in mrp 2 view (Time taken for deliver)
    Goods receipt processing time mrp 2 view.(Inspectoin and Storage)
    Regards,
    Dharma

  • How to calculate first date and end date of this year in Query

    Hi Expert
    I want to calculate following dates with inputted date in query.
    I have no knowledge on ABAP and I just can create a query with simple logic.
    Could you teach me how to calculate following date?
    (If inputted date is April 12 2009)
    - First date of this year (Ex January 1 2009)
    - End date  of this year (Ex December 31 2009)
    - First date of last year (Ex January 1 2008)
    - End date of last year  (Ex December 31 2008)
    - First date of this month (Ex April 1 2009)
    Thank you!
    Take

    HR_JP_MONTH_BEGIN_END_DATE   use this FM to get the begin and end date of the Date you are passing. eg when u give input as 04/12/2009, it will return
    04/01/2009 as begin date
    04/30/2009 as end date
    pass the Year in this FM HR_E_GET_FISC_YEAR_DATES, you will get the Fiscal year Begin and End Dates
    Abh

  • Sales Order - How to make Delivery Date default to Lead Time?

    My scenario is this:
    - We have items that go thru several production stages before it is a finished item that can be sold.
    - Each production item has its lead time loaded.
    - I would like the delivery date of a finished item to equal the sum of the productions items lead times.
    I dont want my sales people to have to look at calendars are calculate how long until something is ready for delivery.
    I would like my sales orders delivery date to default to a date that sales people can use.
    Is this possible? I would think this would be part of core functionality but I do not see this.
    Thank you,
    John Sefton

    John,
    Knowing what Items are added to the Sales Order at the time of entry would not be possible without SDK since the line level details are stored internally in temp location.
    Only on Submitting the Sales Order would it be possible to calculate the date.
    Let me know how you would want to move on this
    Suda

  • How system determine delivery date in sales order

    Hi, sap gurus
    I am new to sdn forum please help me regarding my question
    1) how the system will determine delivery date in sales order
    2) what are factors effects to conform sales order stock
    3) what is different between static check and damanic check in credit mgt
    Thanks and regards
    nishad

    hi,
    Reg question:1 - System determines the Requested Delivery Date based on the Scheduline assigned to the item category of the item in sales order.the schedule line in the order transfers the requirements trhu MRP (can be individual or collective) . If its ruch order , you configure the order type "Deliver Immediately".
    In Detail:
    The TOR depends on the Requirement Type (MMR), Requirement Class(MMR), Checking group(MMR) and the Sc line category (Line Item). For the TOR to happen u need Plant at line item, scheduline category markd for TOR, Requirement Class marked for TOR and Checking group in MMR (Availability check)
    What all stocks need to be checked during Availability check is controlled by using the checking rule.. for example for AV -02 Ind Requirements a checking rule will be assigned and this checking rule- and then what all stocks need to be considered to determine the delivery can be maintained here.
    Rgds
    Sai

  • How to change delivery date (LFDAT) in  me57 item data

    hi ,
    While  Creating purchase order  (me57)  . on the basis  of info rec   . i want to change  delivery date  by
    passing  info rec to table eine and get field aplfz  .
    then adding  aplfz to sysdate    and pass it to 
    Delivery date   .
    i have done this using USER EXIT  EXIT_SAPMM06E_016
    and modified table  teket  with field eindt   but still in screen fields  it shows  old date value   .
    After Debugging i found that  that  it passes value from internal table ETT[] .
    how to modify internal table ETT[]  which is used to display data on screen   .
    regards
    Deepak.
    Edited by: Deepak Dhamat on Jun 8, 2011 8:32 AM
    Edited by: Deepak Dhamat on Jun 8, 2011 10:35 AM

    hi ,
    i have  implemented BAdi  me_process_po_cust
    for changing Delivery date   .
    method if_ex_me_process_po_cust~process_item .
    data : eeind_dt type eket-eindt ,
             t_aplfz type eine-aplfz ,
             delivery_dt(10) type c.
      ls_item = im_item->get_data( ) .
    if sy-tcode = 'ME21N' .
        select single aplfz into t_aplfz  from eine
          where infnr  = ls_item-infnr .
        if sy-subrc = 0 .
          if t_aplfz is  not initial  .
            eeind_dt  = sy-datum  + t_aplfz  .
            concatenate  eeind_dt6(2) eeind_dt4(2)  eeind_dt+0(4) into delivery_dt .
          endif.
        endif.
        ls_item-eeind = delivery_dt .
        call method im_item->set_data
          exporting
            im_data = ls_item.
        clear : delivery_dt  ,t_aplfz  ,eeind_dt .
      endif.
    regards
    Deepak.

  • How to show delivery date in Bex Analyzer

    Hi Gurus!
    I have to create a report in logistic scenario and my client wants that the report shows a column with the "Scheduled delivery date". I don't know how to show it in a column because in my KF structure, I can't put just this time characteristic.
    Does anybody know how can I solve it?
    Many thanks!

    Hi,
    Create a Formula Variable on Scheduled  DeliveryDate with processing as replacement path, replace variable with InfoObject, replace with Key and use it in the new formula in the columns.
    in this way query designer will accept you to use the char as in column,
    hope it helps you.
    Regards
    Reddy A

  • How to Change delivery date of Purchase Requisition created from PM  module

    Hi all,
         We are creating service PR from PM module. There is a need that user should be able to change the
    Delivery Date of the PR. When we use ME52N , the field is grayed out.
    If the PR is created with same data manually with ME51N, we are able to change the delivery date.
    Please suggest how to do this.
    Thanks

    I´m sorry, but my english, is not better.
    Why in the Scheduling for External Procurement, the Purchase Requisition take (or picks up) as Delivery date, the Basic End Date of the Maintenance Order (PM). 
    What must I do in the customizing so that the Purchase Requisition takes (or picks up) the delivery date as the Basic End Date of the Maintenance Order.
    Please, helpme..
    Cristian Torres

  • HOW TO KNOW DELIVERY DATE FROM SALES DOCUMENT NO...?

    HI all.
          i have sales document no..
    how can i have the delivery date of that sales order...?

    Dear Shashank,
    against any sales Document no. VBELN ...
    u will find it's Delivery date in LIKP  :Delivery Header Table
    in LFDAT "Delivery Date.
    Hope it helps u...!!!
    Pls reward if Helpful...!!!

  • How to calculate Deadline Date and Time

    A support desk message has been created and support team has to respond in fixed time duration.
    Creation time of message and duration of response are available.
    How to calculate the exact time and date where this deadline expires using the factory calendar.

    java.util.Date date = java.util.Calendar.getInstance().getTime(); //retrieve a date object
    java.text.SimpleDateFormat df = new java.text.SimpleDateFormat(dd-MMM-yyyy);
    String s = df.format(date); //10-Aug-2001
    String t = "15042001";
    df.applyPattern("ddMMyyyy");
    d = df.parse(t);
    df.applyPattern("dd-MMM-yyyy");
    t = df.format(d); //15-Apr-2001Hey it's Friday, I'm bored

  • Re-calculate delivery date in Stock transfer order ( STO UB ), V_V2

    Hi, running the transaction v_v2 only Sto (Stock Transfer Order) At item level.
    Scenario:
             Sales order in Plant 2.
             Sto ,  Plant 1 to Plant 2.
             Purchase Order To Vendor in Plant 1.
    When I run V_V2 in Plant 1, the First execute transaction V_V2 is OK, This system availavility check the STO and confirm the delivery date and the quantity.
    Now I change the delivery date in Purchase Order but the transaction V_v2 in plant 1 don´t  make any change in the STOCK TRANSFER ORDER (STO) in the Delivery Date field.
    Why the systen don´t change the delivery date in STO automaticaly, Becuase I can change manualy in ME22N transaction, and the sytem confirm the quantity and  the confirm date.
    Other Example.
    I have good issu the Purchae Order in Plant 1 and execute V_V2, the sytem do not re-calculate the delivery date in STO, Why ?.
    Thanks.

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

  • How to pass delivery date through BAPI while creating a sale order

    Dear frndz,
         I am using 'BAPI_SALESORDER_CREATEFROMDAT1'
    to create a sale order .
        I don't have any problem..
        But I have to pass schedule line delivery date through this bapi .
       I used REQ_DATE in structure BAPISCHDL.
       But I can' t get it.
       Through which parameter can i meet this..
       The sale order should be created line item wise along with my delivery date..
      Any suggestions...
    regards.
    siva

    Dear frnd,
        Danq for your response..I can't use DLV_DATE for this requirement..
        But I used REQ_DATE in the structure BAPISCHEDULE .
       I came to know that the problem i faced previously  was only
    internal data conversion.
        Now am able to pass my delivery date..
        so I am closing the thread..
    Regards.
    siva

  • How to Change delivery  date in Sales Order????

    Hi Guru
    If i creating Sales order (OR) for eg date 29/11/2007, for delivery date it will 6/11/2007, If i change Mannualy for delivery date, it will getting some error, i need delivery date should be one or two days delay only.
    regards
    [email protected]

    Hi Mohammed,
    In the sales document type configuration screen you have the field for Delivery Date Proposal. Use the appropriate value that is required. Also confirm the order date in your question is later than the delivery date maybe that is the reason why the system is giving you an error.
    Regards
    Nadarajah Pratheb

  • How to change delivery date in confirmation tab in item overview in PO

    Hi,
    I am using ME_CONFIRMATION_UPDATE to add delivery date into the confirmation tab in item level.It is adding new line item.
    It is even updating the table EKES.
    Now my requirement is to change the delivery date from the above PO. Is there any function module for the same.
    PLEASE GUIDE ME.
    Thanks,
    Vengal Rao.

    Hi,
    Our client is into Apparel business and using SAP-AFS.  Some time at the last moment the due to change in customer delivery date there is a requirment to change the delivery date in confirmation tab also..
    Thanks,
    Vengal Rao.

  • How to calculate start date of the week based on week number ?

    i need to get week number of the current date and based on that i need to calculate start date falling in the same week for last year.
    Eg. today is 31st week of year and 31st july date. so what will be the date on the 31st week of last year. i need the start date of that week.
    we can calculate the week number by select to_char(sysdate,'ww') from dual.
    DO we have a single line query for that or will it require writing a pl/sql block ?

    you can try following query
    it can be as inline but for more clean look and create it as select with include select
    with t as
    (select sysdate as dt from dual)
    select to_char(prev_year_dt - to_char(prev_year_dt, 'D') + 1, 'DD.MM.YYYY') as start_of_week from (select
    -- get day from prev year with the same week number
        case
               when to_number(to_char(add_months(dt, -12), 'WW')) > to_number(to_char(dt, 'WW')) then
                dt - (to_number(to_char(add_months(dt, -12), 'WW')) - to_number(to_char(dt, 'WW'))) * 7
               when to_number(to_char(add_months(dt, -12), 'WW')) < to_number(to_char(dt, 'WW')) then
                dt + (to_number(to_char(dt, 'WW')) - to_number(to_char(add_months(dt, -12), 'WW'))) * 7
               else
                add_months(dt, -12)
           end as prev_year_dt
      from t) t1good luck
    Sergii
    'Monday' is not first day of week in 100% ;)
    Edited by: Galbarad on Jul 30, 2012 11:00 PM

Maybe you are looking for

  • Yet again connection drops !!!

    after the last fix speed was ok for a few months but now gone back to the same old **bleep**. Speed dropping to around 0.06mb having to restart modem cant do anything with broadband at all ! ADSL Settings VPI/VCI: 0/38 Type: PPPoA Modulation: G.992.1

  • IPad programming - listing class/object variables

    Hey there, Im stuck with a little thing, I think i'm confused with value or object coding, anyways heres the deal: I've made and declared an object which consists of some information (ID, name, etc) and I want to parse XML results into this object. T

  • Splitting data packages in CMOD

    Hello All, We am currently using a standard delivered SAP extractor.  However, we have written additional logic in CMOD for this extractor.  As a result of the CMOD there is a potential of 1 record expanding into hundreds of records which increases t

  • Fresh Lion install, but App Store says some programs installed

    I've just done a complete wipe and reinstall of Lion on my Mac Mini (don't ask!), When I first loaded up App Store it said that two of my Apps were already installed! How can that be?! And can I do anything about it? I've tried loggin out and back in

  • Can't install ; i need administrator rights that i have

    Hello, I tried many time to install Air but I always failed... They keep telling me that I need administrator rights, but I have and i launch the installation with them. I tried many ways (like using this as told : http://support.microsoft.com/mats/P