Dates needs to be set -30 days

Hi friends,
my requirement is below
1) i have two fields in my page 1)contract end date 2)contract expiry date(message style text) and save button.
2)first user will enter contract end date and save then as soon as it saved contract exepirydate date should display as
-30 days
example contract end date user eneter as jan -31-2013 then after save contract expiry date should display as jan-1-2013.
please help how to solve this issue
Thanks

Hi,
Try using this approach:
Here we have just get millis in 30 days and add those to the 'contract date'. I have not run this.. so if you get errors try debugging the same. However the approach is correct.
1) Catch the 'save' button event.
2) Get the date entered by the user in 'contract end date' in a variable like 'date' and convert it to dd-MM-yyyy format.
3) Add 30 days to that using below logic:
int MILLIS_IN_THIRTY_DAY = 1000 * 60 * 60 * 24 * 30 ;
String dateInString = pageContext.getParameter("contractDate");
SimpleDateFormat dateFormat1 = new SimpleDateFormat("dd-MM-yyyy");
String contrctDateStr = dateFormat1.format(dateInString);
java.util.Date contrctDate = dateFormat.parse(contrctDateStr);
oracle.jbo.domain.Date oracleDate = null;
try {
SimpleDateFormat dateFormat = new SimpleDateFormat("dd-MM-yyyy");
String expDateStr = dateFormat.format(contrctDate);
java.util.Date newdate = dateFormat.parse(expDateStr);
long javaMilliseconds = (long)(newdate.getTime()+ MILLIS_IN_DAY);
java.sql.Date javaSqlDate = new java.sql.Date(javaMilliseconds);
} catch(Exception e) {
e.printStackTrace();
--Sushant                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

Similar Messages

  • Validate Date if it falls within 30, 120 and 365 days of the audit date I enter on any given day

    PDF Forms in Acrobat 9 Pro
    When auditing a file, I enter the date I am auditing it.
    Example: 02/18/2015
    I then enter dates of when information was last verified. Some of these dates need to fall within 30 days of the audit date I enter on any give day and others need to fall within 120 days and another within 365 days. If they don't fall within the specified number of days for that field, I would like it to give an error message in that filled.
    Examples:
    College Grad Date 01/15/2015
    Certification Date  12/23/2015
    License Date  02/13/2014 - This is over 365 days so I do not want the date, I want it to display "Need to re-verify"
    I do not have any inkling of an idea of how to write this. Your help would be most appreciated.
    Thank you.

    Solved the problem- I contacted apple on their support line found on this page... http://www.apple.com/uk/support/mac/ and they were really helpful and talked me through what to do on the phone, I now have all three productivity apps. Hope this helps

  • Need to add number of days to users end date.

    Hi,
    I have a code where we are adding number of days(30) to current date and then updating user's end date in IDM DB.
    Now we have a requirement where we need to add number of days(30) to existing end date of user instead of adding to current date.
    *public String incrementDate(int daysToAdd)
         // Start date
         log.info("NotifyLastDayOfService::incrementDate(): Enter");
         SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd 00:00:00");
         Calendar c = Calendar.getInstance();
         c.add(Calendar.DATE, daysToAdd); // number of days to add
         String newDate = sdf.format(c.getTime());
         log.info("NotifyLastDayOfService::incrementDate(): Exit");
         return newDate;
    Have any body implemented this scenario?
    Please suggest.
    Thanks,
    Kalpana.

    Hi Nayan,
    Here is the code:
    System.out.println("----inside increment date method-----");     
              HashMap<String, String> hm = new HashMap<String, String>();
              HashMap<String,Date> modifyMap=new HashMap<String,Date>();
              SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd 00:00:00");
              tcResultSet usrList = null;
         String enddate = null;
         hm.put("Users.Key",usrKey );
         try {
         usrList = this.usrIntf.findUsers(hm);
         usrList.goToRow(0);
         Date endDate =usrList.getDate("Users.End Date");
         System.out.println("-----users end date-----"+endDate);
         String userEndDate=sdf.format(endDate);
         System.out.println("-----String value of users end date-----"+userEndDate);
         Calendar cal=null;
         System.out.println("-----Calender date-----"+cal);
         cal.setTime(endDate);
         System.out.println("-----end date-----"+endDate);
    cal.add(Calendar.DATE, Integer.parseInt(daysToAdd)); // number of days to add
    Date newEnddate = cal.getTime();
    System.out.println("-----new end date-----"+newEnddate);
    //usrList.setEndDate(Edate);
    modifyMap.put(userEndDate,newEnddate);
    usrIntf.updateUser(usrList, modifyMap);
    System.out.println("updated user's end date in OIM DB");
    //System.out.println("-----updated user's end date in OIM DB-----");
    logger.info("NotifyLastDayOfService::incrementDate(): Exit");
         System.out.println("-----new date-----");
         } catch (tcAPIException e) {
         logger.error("Error in finding end date for user" + e);
         } catch (tcColumnNotFoundException e) {
         logger.error("Error in finding end date for user" + e);
    In th log file, I can see that the code is not executing this line:
    cal.setTime(endDate);
    end date is of type Date and stores users end date from DB. Please help in resolving this issue.
    Thakns,
    Kalpana.

  • Set Basic finish date in serviceorder with today + 10 days

    Hi,
    when we create an service order (IW31) the Basic start date and Basic finish date has default
    value of today.
    I will set Basic final date as default with today + 10 days.
    I have search in SPRO but don't find any way.
    Is there an EXIT or BADI to do this?
    thanks.
    Regards, Dieter

    Hi Paul,
    thanks for your answer, i have tried it, but no effect.
    I have to clear what i really want to have (sorry that i havn't done it in the first thread.
    First we create an Service notification via IW51, and go direct via "create" button to "create order".
    A little popup is shown to insert order type, planning plant, main work center. After press enter
    we are in create Service order (with revenues) at this time i don't insert any value.
    Now the value of "Basic start date" and "Basic finish date" has a value of today, it seems that these
    value are set as default, priority is empty.
    Now i want that the 2 date-fields are set as default with today and today + 10 days.
    How can i do this?
    Regards, Dieter

  • Need to create a workflow after Date Modified is greater than 7 days

    I'm using SharePoint Deisnger 2010 and attempting to create a workflow to generate an email after the Date Modified is greater than 7 days. Checking to see if there is a way to create this workflow without creating a "calculated" field with a date.
    Have:
    If Current Item:Modified is greater than Today
    But would like to have 7 days not today or a set date.
    What's the best way to do this?

    Hello,
    In addition to Bistech, here is link to set date in WF context variable.
    http://stackoverflow.com/questions/17082455/sharepoint-designer-2010-set-variable-today-x-days
    Hemendra:Yesterday is just a memory,Tomorrow we may never see
    Please remember to mark the replies as answers if they help and unmark them if they provide no help

  • Using sprite for itemRenderer what other method than set data needs override

    I get the following error: 1020 Method Marked override must override another method. Complier marks the error at the start of my set data method:
    code is here:
    http://pastie.org/497786
    any input would be welcome.
    Thanks
    Jed

    I think Natasha said that you don't need the override on your set data() method.  You shouldn't need to implement IFactory either.  I think your code should look like this:
    <?xml version="1.0" encoding="utf-8"?>
    <mx:UIComponent
         xmlns:mx="http://www.adobe.com/2006/mxml"
         width="160"
         height="120"
         implements="mx.controls.listClasses.IListItemRenderer"
         >
         <mx:Style source="QtVideo.css"/>
         <mx:Script>
              <![CDATA[
                   private var repImageSource:String = "";
                   private var movieSource:String = "";
                   private var _data:Object;
                   public function get data():Object
                        return _data;
    setting data
                   public function set data(value:Object):void
                        _data = value;
                        repImageSource = value.representativeImage as String;
                        movieSource = value.source as String;
              ]]>
         </mx:Script>
         <mx:Image
              id="repImage"
              width="160"
              height="120"
              source = ""
              horizontalAlign="center"
              x="0"
              y="0"
              >     
         </mx:Image>
         <mx:Button styleName="playStopStyle"
              id="playBtn"
              x="{repImage.width/2 - 22.5}"
              y="{repImage.height/2 -22.5}"
              />
    </mx:UIComponent >
    Alex Harui
    Flex SDK Developer
    Adobe Systems Inc.
    Blog: http://blogs.adobe.com/aharui

  • SharePoint Service Accounts - Passwords have expiration date when they are set to never expire

    The managed accounts in my farm all have the Enable automatic password change
    unchecked.  Also these same accounts in AD have the Password never expires
    checked. 
    If I use get-spmanagedaccount to view the accounts, some passwords show as already expired or have a future expiration date.  The automatic change is set to False and nothing is listed under the Change Schedule. 
    The strange thing to me is that the passwords listed as expired are still valid and haven't been changed.  I even ran an iisreset just to check and there were no issues.  When I look in CA the next password change area is blank for all accounts.
    My question is why do the accounts list a password expiration date if it's set to
    not automatically change passwords.  If you do change the password through AD you will see a new expiration date set for 90 days later.  I'm just wondering how much I should worry about the service accounts that are listed
    as having expired passwords even though the passwords aren't expired.  My sites and services are running but I'm just curious if this could potentially cause other errors.
    Thoughts?  Prayers?  Condolences?
    Jennifer Knight (MCITP, MCPD)

    I checked the My farm as well, you are correct. Even you did not select the automatic password change still it showed 90 days as expiry. 
    You don't need to worry about it, it will not hurt, one of the dev farm having account which  expired almost 10 months ago. :)
    you can double check with in central admin and you will see no expiration set over their.
    Please remember to mark your question as answered &Vote helpful,if this solves/helps your problem. ****************************************************************************************** Thanks -WS MCITP(SharePoint 2010, 2013) Blog: http://wscheema.com/blog

  • Display data in r/3 set up tables

    how to display data in r/3 set up tables

    Hi,
    You have different TCodes in R/3 to fill up the setup tables for different areas. Like for Inventory for intializing the opening balance we use MCNB and for Movements we use 0LI1BW and for Revaluations you need to use OLIZBW. You have to follow a set of instructions while filling up the setup tables like there should be no postings going on while you are filling up the setup tables etc...
    Once you fillup the setup tables, then if you go to RSA3 and enter the data source name, you will be able to see the data for it. Unless you sill the setup tables, your data source wont give you any data. You can search for How to... documents which will be useful to you in understanding the concept.
    Hope it helps...

  • Crystal Report with text(csv) data file, can we set it as input parameter?

    Hi,
    I am a new user of Crystal Reports 2008.
    I have created a report with charts in it. The input data comes from a csv text file.
    Can I set the name of this text file as an input parameter?
    as I need to generate 44 similar reports with different text filenames(and data)?
    Thank you.
    Regards

    Brian,
    Thanks much.
    I did exactly what you said.
    Just to see any change, I first gave a bad report file name just to see if I am accidentally pointing to a different file,
    but I got an error saying report not found.
    Then I renamed my original datafile name and generated a report and it still generated one without giving an error.
    Then I also gave a junk name to the logoninfo and printed that name, the new name was assigned to logoninfo, but the code did not error out.
    It ended up generating the report.
    Now here is what I think is happening,
    1) The save data in report option seems to be still on even though I have turned it off in 2 locations
    a) file -> Report Options
    b) file -> Options -> Reporting tab.
    2) For some reason the logoninfo is getting ignored as well.
    Since I did not see any answers yesterday I posted a link to this thread on the .Net forum
    Crystal Report with text(csv) data file, can we set it as input param? C#
    and Ludek Uher says that I am connecting to the text file via a DAO database engine and so need to use the same code for changing the text file as for changing an Access database.
    But the link he gave me tells me to try the same thing that we have been trying..
    Here is my plan,
    1) I will first try and find out why my save data with report option is still on ( but it shows off in Crystal ).
    2) why is LogonInfo getting ignored.
    Meanwhile any suggestions from anyone are welcome.

  • Date field input help - changing first day of the week

    Hi,
    I need to change the starting day of the week  in a date field value help. I also need to change the days name in this calender.
    Thanks in Advance,
    Dekel.

    I found how to change the first day of the week, through BAdi calendar_definition.
    Can anyone help me locate the day names? (I checked - FM day_names_get dosen't get the names of the UI search help).
    Thanks,
    Dekel.
    Edited by: dekel31 on May 29, 2011 1:17 PM

  • Wls10.3.2: Why do we need to explicitly set -Duser.timezone

    Hi All,
    We are installed FMW 11g PS1 Weblogic 10.3.2 &Oracle Fusion Applicaton Runtime 11g on Oracle Linux 5.7 VM (running on Oracle Virutal Box / Host-only Network adapter) and created new weblogic domain using EM & JRF product templates and choose default options. (except choosing 'Production Mode')
    While deploying our application we are getting "Caused By: java.sql.SQLDataException: ORA-01882: timezone region not found" while performing data base operations (retrieve date from Oracle Database 11g R2 using eclipse link)
    Note:- DB schema have column with timezone set.
    So, Issue got resolve after updating setDomainEnv.sh file with "-Duser.timezone='-05:00'" (CDT) for EXTRA_JAVA_PROPERTIES.
    In general, we didn't the update this properties for our systems.
    Please let me know what want wrong with my setup (Linux installation - date & time settings/ Weblogic /Domain creation/Database time zone settings)?
    Thanks,
    Suresh

    Unfortunately, there are many ways how various OSes setup a configuration to indicate what timezone it is using. The JRE assumes a certain way of how this is done and on many systems it is able to get the necessary info it needs to determine what the timezone is, but of course, it also gets it wrong sometimes, or in your case, it did not find what it was expecting.
    To preempt your next question, what needs to be set? Well, I wish I knew the exact answer. I have several Solaris, Linux, Windows, etc.. systems, on most of them java is able to get the right timezone, but on some it is getting the wrong timezone, but as far as I can tell the timezone configuration on the ones that are wrong look just like the ones that are correct.

  • Problem with JFMERGE using the last set of data on all form sets

    b Here is the scenario...
    I have a file of data in character delimited format. Each record needs to produce the same set of forms. I used the Visual Transformation Editor to define the field nominated data file, including the ^form statements. The transformation agent processes the file of multiple records just fine. I get a file from JFTRANS that contains the set of data & form statements repeated for each record in the file.
    Great so far.
    b Here is the problem...
    Unfortunately, the print agent is repeating the same set of data on every copy of the set of forms that is printed. It uses the data from the last set of forms to be printed.
    b Additional information...
    For ease of building the field nominated file by our custom client program we have standardized on using GLOBAL fields. Therefore, our DAT files contain all the ^global declarations with all the necessary ^form statements at the end. I used the transformation editor to build the same type of file. Therefore the file going to the print agent looks like:
    ^global name1
    data1
    ^global name2
    data2
    ^form form1
    ^form form2
    ^global name1
    newdata1
    ^global name2
    newdata2
    ^form form1
    ^form form2
    The printed result puts "newdata1" & "newdata2" on both sets of form2. Strangely, the correct data values are showing up on both sets of form1.
    The only difference between the two forms is that form1 is not defined with the fields as global where form2 does define them as global. I removed the global flag from form2 but that didn't change anything.
    I think I know what is occurring. JFMERGE is putting the data elements into the global dictionary and when the same name is in the file the latest data value ends up in the dictionary (thus all the forms print using the last data put into the dictionary). I certainly didn't expect this. I thought it would load the dictionary and print the first set of forms, then reload the dictionary and print the next set of forms. At least that is the way I see it occuring based on the order of things in the DAT file. Based on what is occuring it appears that JFMERGE reads the whole DAT file, building the dictionaries and then processes all the ^form statements.
    b My request for help...
    Does anyone know what I can do (such as insert some command) to get the correct data on the forms?
    It looks like using a fixed record format might do the trick but that isn't an option at this time. As things are right now it looks like I'm going to have to take the data file apart, and make lots of files with one line of data per file.
    I have a time deadline to get this printed so if there isn't a way to make JFMERGE operate as I expected it looks like I'll be doing this by hand. Fortunately, there are only 250-300 data lines. Future jobs could have thousands of data lines so if there isn't a way to do it with a multi-line data file I'll have someone create a program for splitting the original file up (and adding the ^job line).

    We don't use subforms so some of what you suggest isn't effective for us. Our forms are a duplication of the paper forms and are not dynamic. We design each form separately and our custom filler software (that builds the DAT file) uses a database with the required forms for each print job defined within it.<br /><br />Since we don't have subforms, our simple method of printing is to declare as GLOBAL all the unique fields used on all the forms to be printed followed by the ^form commands. It was a simple & straightforward method for us to do better than 500 print jobs over that past couple of years. In addition, our custom filler software can easily build the DAT files.<br /><br />Because I need to manually declare all the ^form statements my experience with using ^field is that the form must be declared followed by the appropriate field commands (repeat for all the forms).<br /><br />i <many hours later I continue typing this post><br /><br />Taking the original Transformation Definition File and customizing it for how things need to be when using ^field commands was a time consuming experience (and a learning one). It did the job as I needed but it is an experience I don't want to repeat. There has got to be a better way of building the TDF properly. I'm definately leaning towards a program to split the file into multiple files.<br /><br />Here is what I went through...<br /><br />I did all the editting using Notepad. I changed all ^global to ^field. Then I had to remove the #comment lines. Next was to find any references to fields that had to be global to the top and chang ^field to ^global. Then it was moving the fields around so they were underneath the appropriate ^form statement. Then, since one of the forms was multi-page I had to add the ^page command and sort the fields so they were under the correct page. That was followed by duplicating fields that are used on multiple forms or multiple pages. Then I discovered that the print agent won't do ^page unless "inline processing" is turned off (I did not want to specify the page name as it could change over time) - so I added "^inline off" in front of every ^page. Finally it was removing unecessary field references so the log file would be clean.<br /><br />For those that are interested, the following is an example of my final file. <br /><br />^global nameA<br />data<br />^global nameB<br />data<br />^form nameX<br />^field name1<br />data<br />^field name2<br />data<br />^form nameY<br />^field name1<br />data<br />^field name3<br />data<br />^inline off<br />^page<br />^field name4<br />data<br />^field name1<br />^inline off<br />^page<br />^field name5<br />data<br />^field name6<br />data

  • Need to find the last day of the previous month

    hi folks,
    the code goes like this...
    data: xt247 type t247,
          monthn(30) type c,
          monthnumber type i,
          bforwardmonth type i.
    call function 'RP_LAST_DAY_OF_MONTHS'
      EXPORTING
        day_in            = s_date
      IMPORTING
        last_day_of_month = e_date.
    write: 'The last day of the month', e_date.
    select single * from t247 into xt247
            where spras = sy-langu
              and mnr = e_date+4(2).
    monthnumber = xt247-mnr.
    write:' The month number', monthnumber.
    determine the previous month.
    bforwardmonth = monthnumber - 1.
    From here I need to determine the last day of the previous month How can I do?
    Thanks for your help.
    Santhosh

    Hi all,
    here's the shortest solution:
    REPORT z123.
    PARAMETERS p_datum LIKE sy-datum DEFAULT sy-datum.
    DATA ultimo  LIKE sy-datum.
    <b>ultimo = p_datum - p_datum+6(2).</b>
    WRITE: / p_datum, 20 ultimo COLOR 2.
    it's not my solution :
    it's from <a href="http://www.abapforum.com/forum/viewtopic.php?t=1434&highlight=ultimo">Andrew_</a>
    regards Andreas

  • Data transfer of Selected sets (QS51) using Function modules

    Hi All,
    I am doing data migration of Selected sets (TCODE QS51) using function module. I have tried using BDC recording but it is not working in background.In foreground it is giving information error on second screen as field  RQSKT-AUSWAHLMGE is not present on screen 1000..  In foreground I am pressing enter after this error its working fine but in background the execution stops there. So I am trying function modules QPAM_SELSET_CODE_CREATE  and QPAM_SELECTED_SET_CREATE
    The fields in template I have are KATALOGART(Catalog), WERKS(Plant),AUSWAHLMGE(Selected set) ,KTX01(short text), STATUS(status),CODEGRUPPE(code group), CODE (code), KURZTEXT (short text for codegroup),BEWERTUNG(Valuation code), FEHLKLASSE(Defect class)
    QPAM_SELSET_CODE_CREATE contains fields  KATALOGART, WERKS,AUSWAHLMGE ,CODEGRUPPE,CODE which I need and While stand alone testing of this function module I am geting error as follows with the data filled :
    Runtime:        6.496 Microseconds
    Exception       WRONG_KEY
    Message ID:          QS                         Message number:           299
    Message:
    No entries were found in catalog 1
    MAN WERK K AUSWAHLM CODEGRUP CODE
    300 WI10 1 DDTEST   THREADS  1
    QPAM_SELECTED_SET_CREATE contains KATALOGART , WERKS,AUSWAHLMGE , KTX01 which I need and it requires Language key fiels KSP01. I specified it it executes successfully but in transaction it is not there. some FMs contain some fields and not all fields so I want to know which one to use ? Can anyone give me sample code how to use these FMs?

    Note 381286 - Code grps + selectd sets:Transport request requestd
    Note 592418 - Composite SAP note: Transport of code groups and codes
    But I do not recommend a modification because the system does not generate request for that in the production system.
    This means you can maintain catalog directly without transport in the production system.
    Only development or test system ask you a request number.
    Regards
    Luke

  • Ms Project 2013 report for resource name, tasks less than 100% complete within a date range I can set each time

    I have seen I can create a report for a resource name with a specified date range, and one that can show me for a resource name any incomplete tasks, but I want to do the following and cant work out how to state it in the report constructor:
    resource name equals - {I want to set a given resource in here}
    % complete is less than 100%
    start - date range is between [today -7 days] and [today +7 days]
    Please can someone show me how this is possible, I know it will be and it is me that has been defeated!!

    workspacedesign,
    Oops, my bad. I missed the point that the Name field for assignment rows will be the task name and that's not what you want. There is also a glitch in the date range filter. So, here's how to fix that.
    First, in the Resource Usage view, copy the Name field to Text1. Now select the resource line and do a fill down for all assignments under that resource. Do that for each resource. This could be automated with VBA, but for now, a manual setup should work
    fine.
    Second, instead of testing for the Name field in the filter, test for the Text1 field.
    Third, change the Finish test to be "less than or equal to".
    Now when you apply that filter, enter beginning date of your range and then the ending date of your range followed by the resource name. You should get the data you want.
    Unfortunately formulas in custom fields are not as flexible in Project as they are in Excel. For example, in Project a formula can only operate on data for that row. Further, even if you use the formula Today() +7 for your filter criteria, the first time
    the filter is used, Project will hard code today's date into the filter. The normal way around both of these shortcomings is to use VBA.
    Hope this helps.
    John

Maybe you are looking for