Date addition

I would like to display a date in the future based off of a date a user enters in a date field as well as a choice they make out of a drop list.
Drop List (dl1) allows the user to select choices “1 week, 2 weeks, 3 weeks, 4 weeks” etc up to “9 weeks”.  They have a date field (date1) that they input a date.  I would like to place in a calculated read only date field that adds date1 + the result of dl1 – call this calc1 (set as a date field).
All the date codes I have found in searches always use the Date() function to call the current date – this will not work for me as I need to compare against a date the user enters into the form, not the current systems date.
I have placed a CALCULATE code in the calc1 that looks like this:
switch (dl1.rawValue)
                case “1”:
                this.rawValue = date1.rawValue + 7;
                break;
   case “2”:
   this.rawValue = date1.rawValue + 14;
   break;
And it would go on for all possible values in dl1.  But of course this just appends the number 7 or 14 at the end of the date (if the date1 field was set to August 2, 2011 then the result I get is 2011-08-027 or 2011-08-0214).
Do I need to parse out the year, month, day out of date1 and do some manipulating that way?  Or is there a handy date function already that can read a date value and add days into it?
Thanks!

I would use FormCalc for date operations rather than JS....
here is simple and similar example...
var  
dSelected
var  
wSelected
var  
dResultdSelected
= Date2Num(DateSelect.rawValue, "YYYY-MM-DD")wSelected
= WeekSelect.rawValuedResult
= dSelected + (7 * wSelected)DateResult.rawValue
= Num2Date(dResult, "YYYY-MM-DD")
and for the Dropdown I chose Specify Item Values in Object>>>Binding tab and I chose 1 for 1 week, 2 for 2 weeks.....
try this and let us know....
Good Luck,

Similar Messages

  • XD01 Customer data Additional Screen

    Hi,
    I have created a BADI implementation for XD01/02/03 to add custom screen with additional customer fields using BADI CUSTOMER_ADD_DATA and CUSTOMER_ADD_DATA_CS. Works well, customer master now has a new button that brings me to a screen I defined.
    Now I have a requirement to only show this additional screen button for certain Sales Area and I cannot find a way to do it.
    I can hide tabs on custom screen by Sales Organization, but activating whole button+screen functionality looks to only be possible before Sales Area data is known during IF_EX_CUSTOMER_ADD_DATA~CHECK_ADD_ON_ACTIVE
    Is there something I am missing?
    Jurijs

    Hi Jurijs,
    Have you checked the method 'SUPPRESS_TAXI_TABSTRIPS' for the BADI definition 'CUSTOMER_ADD_DATA_CS'?  It looks like maybe you can use this to suppress the tabs based on your sales area requirement.
    Regards,
    Ryan Crosby

  • Item Master Data Addition

    Hi Experts,
    Here I'm facing a problem regarding Addtion of Item Master Record from B1 Client . I have to insert an Item Master record with Item Code 'RR315A' . But B1 restricts and Warns that 'this ItemCode Already Exists' . I have carefully checked and gone throught the complete database and have confirmed whether this item is already over there or not. But No such record was found already in database. From frontend too , I used the FIND feature to find if there is an item with the same code , but no such item was found .
    Im confused about this issue . Plz guide me with some suggestions to resolve this issue.

    Hi Pooja,
                 you can use the perform data check functionality, i.e.
    Administration> System Initialisation> General settings> Services> Perform Data check
                                    Check this box and refresh the database and log in again. Once the data check is done, add the item. Hope this will resolve your issue.
    Thanks,
    Joseph Antony

  • Service entry without an entry date/not linked to goods receipt/invoice?

    Dear Gurus,
    I created a service entry against line 10 of PO. When viewing the service entryu2019s u201CAccept. Datau201D tab, there is a document date and a posting date.
    When viewing the u201CHistory tab,u201D the created dated is 01/12/11...
    When viewing the POu2019s u201CPurchase Order Historyu201D tab, the Service Entry does not have an entry date Additionally, when I go to the u201CGR/IR Assgtu201D view, the service entry is at the very top of the view But the goods receipt and invoice processing document are at the bottom, grouped together, but without the service entry.
    Please help as why is it happeing like this?

    Dear Gurus,
    I m creating service PO and later on doing service entry sheet w.r.t the PO...in service entry sheet, i m entring entry date, posting date and all other relevant informations...and saving the SES and later on releasing it...
    after this, I am going to PO history tab, there i m seeing the SES number but entry date field is missing...
    May i know the reason?
    Pls help...

  • Calendar date & net due date (FI) PAYMENT TERMS - OBB8 Vendor Invoice

    I read many posts on SDN forum about the topic.
    Anyway, I didn't find a simple solution for that.
    My aim is is to calculate a net due date based on working days.
    So, If I've got a 30 days document days payment term  ("Deafult for baseline date" = Document date ; Additional Months = '2'), a Vendor Invoice (document date = 12.05.2011), by standard net due date will be 12.06.2011.
    FROM 12.05.2011 to 12.06.2011 =
    32 CALENDAR  DAYS         
    22 WORKDAYS (32 minus  10 holyday - 2 weekends)
    WORKDAYS PAYMENT TERMS  Within 30 workdays Due net
    Vendor Invoice  document date = 12.05.2011
    plus   30 workdays   =  DUE DATE  22.06.2011  (and not 12.06.2011)
    Can I obtain that with a standard functionality?
    Edited by: Roberto Buono on Jul 1, 2011 2:29 PM

    Hi,
    Sadly this is not available as standard.  As per your need the Net due date should be worked out by using a factory calendar; but what this does is it delinks the direct correlation between the number of days in the payment terms with the difference between the due date and baseline date.  I hope you are aware that Net Due date is not stored but is a variable calculated during run time in reports.
    There are four things you can try:
    1.  The simplest to do is: As the number of weekends are fixed; and if the intention is to give a 30 working day term, then add on the number of weekends and make the payment term effectively for say 40 days.  There will be marginal variations over what you want. Best part here is that config remains standard.
    2. All the receivable reports will use a function module (usually the same one) to calculate the net due date; enhance the FM and make it consider a factory calendar for calculating due date.
    3. Enhance the accounting interface, and in runtime; modify the days that are coming from the payment term; based on a factory calendar, and update the accounting document. This delinks the days mentioned in the payment term and the accounting document and may not be palatable.
    4. Enhance the accounting interface, and in runtime; calculate the due date and update the baseline date with it and make the payment term as "Immediate" yielding the desired due date. Not very elegant.  Alternatively add to the baseline date days equivalent to holidays and weekends and keep the days from payment terms constant and update the accounting document. Better...
    All four options have somes pros and cons.  I do not see any other means of acheiving what you want.  Maybe you could restrict users to a custom receivables/due date/ageing report which delivers what you want and lock the standard reports.
    Cheers..

  • Payment F110 - No data records found for these selection criteria, FZ208

    Hi all,
    I have done all configuration for payment medium for a customer in Norway. We use Telapay and program RFFONO_T. We have not activated the new general ledger but we have ECC 6.0 so I do not see why it should not work.
    The invoices got paid with payment order but when I should download the file in Environment > Payment medium > DME Administration I got the following error message:
    "No data records found for these selection criteria
    Message no. FZ208
    Diagnosis
    No data could be accessed for this selection.
    Possible causes are:
    No data exists for the activated selection.
    You have no authorization to display or edit data from this selection.
    Procedure
    First check whether your selection criteria are correct.  You may need to expand the criteria to include a larger search area to check whether data exists in the system.
    Make sure you have the proper authorizations for displaying and editing data.  Read the Release note for DME management for further information on the authorization objects.
    Proceed"
    I have tried with different variants but that doesn´t matter. When I look at the payment run log I can see following:
    "Additional parameter specifications 1400 SAPO02 are missing
    Message no. FR193
    Diagnosis
    Entry 1400 $V2& is missing from the additional company code parameter table.
    System Response
    Processing was terminated.
    Procedure
    Maintain the entry according to the instructions in the program documentation."
    I suppose that´s why I can´t get a file. Do any one of you know why I can´t get the file created. Please help.
    Best regards Lisa

    Hi Lisa,
    I have a similar problem with program RFFONO_T and Telepay format for a Norwegian customer. Payment medium is not created. In the payment run log is the following message: "Additional parameter specifications XXXX SAPO02 are missing
    Message no. FR193.Entry XXXX $V2& is missing from the additional company code parameter table."
    According the program documentation for RFFONO_T, a company number (11 digits) has to be maintained under company code global data, additional details. The legal org.number with 9 digits is already entered but I do not understand where to enter a 11 digits company number? A user number (10 digits) is also entered in trans OB94  but the problem remains.
    Did you find a solution to your problem?
    Regards,
    Agneta

  • Function Modules for Date

    Hi ALL,
    I would like to know the various function modules that can be used for calculating dates.Like first day of month,last day.....etc etc.
    Please give me a list of the FM's and not the F4 help option info.
    Cheers

    Hi ,
    Here are a few FM used for date manipulation
    <b>DATE_IN_FUTURE  </b>                   Add / Substract days from a given date
    <b>HR_SGPBS_ADD_TIME_TO_DATE</b>     Find the next date based on input date , addition / sub and month , year ,date
    <b>CONVERT_DATE_TO_EXTERNAL</b>     Convert date to External format
    <b>SG_PS_ADD_MONTH_TO_DATE</b>     Find the next date based on input date , addition / sub and month , year ,date
    <b>DATE_COMPUTE_DATE</b>     For a input date gives the day of the week
    <b>DATE_GET_WEEK</b>For an input date ,gives the week as output
    <b>WEEK_GET_FIRST_DAY</b>     Input year and week output is the first day of the week
    <b>WEEKDAY_GET</b>     Gives the day range , Monday , Tuesday ,…..
    <b>RP_CALC_DATE_IN_INTERVAL</b>     Calculate Future Date
    <b>CALCULATE_DATE</b>     Calculate Future Date
    <b>FIMA_DAYS_AND_MONTHS_AND_YEARS</b>     Difference between two dates
    <b>CONVERSION_EXIT_PDATE_INPUT</b>     It checks if the date is in future , if yes an error is displayed
    Reagrds
    Arun

  • Labview Date to SQL Server DateTime Conversion

    I have inherited a database of legacy data (created by Labview software) and I need to import that data into a SQL Server 2000 database.
    One of the fields I'm importing includes a string of numbers which respresents a datetime field - in the following format:
    3172089659
    which represents the number of SECONDS since Jan 1 1904 12:00 am Universal Time
    (Was that a significate date in history ?)
    Is there a built in function within SQL that can help be convert this into a standard SQL Server DateTime format during import?
    Thank you
    Devon Kyle

    Devon,
    This can be somewhat database dependent. I don't know how the standard SQL Server handles date addition. However,most have it. One which I uses has the following:
    SECONDS( datetime-expr, integer-expr ) Add integer-expr seconds to the given date/time. If the integer-expr is negative, the appropriate number of seconds are subtracted from the date/time.
    Since you know the start date, this would easily calculate the date you are wanting.
    Hope this helps.
    Russ

  • PR date is after PO Date

    Hi all ,
    System should not allow to add a PR which creation date is after PO creation date.
    System gives an error " PR date is after PO Date , addition not allowed "
    Thanks in advance

    Hi Shiva,
                  In the as per the given requirement why do you need this.
    as in the industry, generally all the PR's are coming from the different Department and if PO has been created and after that another PR is being generated for the same material, why shouldnt the Purchasing person add the new PR in the old PO, as per the requirement the company can strike a better deal with the purchsing as they are procuring more items.
    regards,
    yawar Khan

  • Todays date plus a set number of days

    I know I'm just having a brain fart here, this has got to be
    easier than I'm making it.
    Essentially, I have a variable bit of text that I need to
    display todays date + 10 days.
    Getting todays date and formatting it are simple I know:
    var today_date:Date = new Date();
    // place date into US date format
    var date_str:String =
    (today_date.getMonth()+1)+"/"+(today_date.getDate()+"/"+today_date.getFullYear());
    // display current date
    trace(date_str);
    The problem lies in making todays date plus 10 days..... any
    ideas anyone?
    ~Chuck Moulton

    Do your date additions with the Date object then extract the
    data to do the formatting afterwards...
    var today:Date = new Date();
    trace(today); //today
    var addAWeek:Number =7; //days
    today.setDate(today.getDate()+addAWeek)
    trace(today); //its not today anymore its a week from today
    //extract the portions and format now

  • Query regarding previous data....

    Hi BCS experts,
    My client went live on sem bcs 2007/AUG by executing monitor. But due to some reasons they stopped using sem bcs for the following months till date. Now I am working on project and I would like to make the system to run in production in 2008/Nov with new requirements.
    By changing the consolidation group with current month of production and newly uploading Trail Balances into production I want to run the monitor as I am going live on 2008/Nov.
    If I run cons monitor I have a doubt that system prompts for last year data and carry forwards of old data.
    But I want to delete the old data and clean the system for not prompting it while running the tasks at Nov/2008 and making the system as it I am going live in nov/2008.
    Any one can assist.

    Hi and welcome to SDN!
    There some ways to clean up your database:
    1. Use inversion in the Cons monitor - you have to do it in each period - low risk - much work - big database after cleanup because of keeping all original and inversing documents.
    2. Use the Cons workbench -- there is an option to delete reported (uploaded) data, additional financial data and documents - low risk- much work - big database after cleanup because of keeping all original and inversing documents.
    3. Delete data from the totals cube and the Document ODS/DSO (in BW - RSA1 t-code) - risky (if you are not friend to BW it's better to invite the BW's friend to do it) - the minimal work - absolutely empty database -- Probably you'll have to delete also data from all cubes and ODS/DSO in your db.

  • How to add minutes to date in java

    I have date in string variable, i have to add/subtract minutes from it, please adivce , how i could do in java 1.5
    sample data
    String olddate = "12/16/2010 4:58:29 PM"
    String minutes1 = "300"
    i would like to get value as below for above data
    String newdate ="12/16/2010 9:58:29 PM"

    Use SimpleDateFormat to convert the date object to string. Once the string object converted to date object use the getTime() method to get the date in milliseconds.
    Now you can easily adds/substract the date object.
    Remember, the resulting long value from getTime() method is in milliseconds, to get the value in minutes you need to multiply it by 1000 and by seconds in a minutes, that is 60.
    When your subtraction/adds done convert it back to date object.
    This is the codes:
    import java.text.SimpleDateFormat;
    import java.text.ParseException;
    import java.util.Date;
    public class DateCalculator {
         public static void main(String[] args) throws ParseException {
              String olddate = "12/16/2010 4:58:29 PM";
              System.out.println("old Date: "+olddate);
              SimpleDateFormat formatter = new SimpleDateFormat("MM/dd/yyyy h:mm:ss a");
              long oldDateInMillis = formatter.parse(olddate).getTime();
              String minutes1 = "300";
              String newDateAdds = formatter.format(new Date(oldDateInMillis + Long.valueOf(minutes1)*1000*60 ));
              String newDateSubstract = formatter.format(new Date(oldDateInMillis - Long.valueOf(minutes1)*1000*60 ));
              System.out.println("new Date [Additions] : "+newDateAdds);
              System.out.println("new Date [Substraction] : "+newDateSubstract);
    }

  • Satellite P200-1EE - is the Data (E:) drive physically seperate from C:?

    Want to format and re-install everything on the laptop as it's playing up during operation. However need to confirm if the drives are actually seperate and not virtual, so I know to backup on an external drive instead of losing everything!
    Thanks for your advice people!

    I agree with Barrie. When you use the Toshiba recovery disk, the HDD will be formatted and you will lose your data.
    If you use a Microsoft Disk, you can choose on which partition the OS (operating system) should be installed. So must not backup your data.
    By the way, I save my data additional on an external HDD.

  • Segment not activate in profit center master data

    Dear all,
    I activated all the profit centers using KEOA2, but the segment field in profit center master data is still greyed out ? is there any process to activate the segment as well? Your input will be appreciated.

    SPRO>Financial Accounting(new)>GL Accounting (New)>Preparation for productive start>Migration of existing SAP Data>Additional Activities>Make settings for segment and segment derivation.
    Maintain Segment.
    Indicator is set('X')
    You can edit the segment in the profit center master data before New
    General Ledger Accounting is activated.

  • How to hide field in profit center masted data?

    Hi,
    I would like to know how to hide the field segment in profit
    center master data
    Alternatively I would like to know which user exit used
    to prevent the feeding of the field segment in profit center
    master data.
    Thanks in advance,
    Osvaldo
    Edited by: Osvaldo Cavagnero on Mar 4, 2010 1:43 PM

    Dear,
    Try de-activating the indicator through
    SPRO>Financial Accounting(new)>GL Accounting (New)>Preparation for productive start>Migration of existing SAP Data>Additional Activities>Make settings for segment and segment derivation.
    Maintain Segment.
    Hopefully it has to work.
    Regards,
    Syed Hussain.

Maybe you are looking for

  • WL6.1 + IIS, request.getInputStream is not working. Please help.

    I'm running IIS + WL 6.1 and in my servlet code, when I use request.getInputStream(), it has nothing in the input stream for e.x. InputStream istream = request.getInputStream(); BufferedInputStream buf = new BufferedInputStream(istream); byte[] b = n

  • ITunes No Longer Imports!

    Help! whenever I try to drag and drop files into itunes is freezes and I have to close it via the taskmanager. Also happens when I use the option inside itunes to add files from folder. I have the most updated version of iTunes and all of a sudden it

  • User Settings keep resetting

    I have an I-Mac. I keep using the get Info to set my preferance for opening photos and other items. I find that the computer keeps resetting them to the default settings. For example I want my .jpeg files to open with Adobe Photoshop but they keep re

  • How to get back my Canvas and Timeline?

    I closed the canvas and timeline and then saved the project. Now i don't know how to get them back.

  • How do I get iPhone photos to re-appear in "Import" window?  I had "Automatically Import" turned on in Aperture prefs.

    How do I get photos to re-appear in the "Import" window?  I had "Automatically Import" turned on in Aperture prefs.  Now I cannot see the photos in my import dialog that are still on my phone.  I normally import without Photostream into specific fold