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.

Similar Messages

  • Is it possible to add number of days to date?

    I am working on a form where I need to add number of days to a date and come up with a date.
    Header 1
    Header 2
    example date:  March 1, 2013
    + 30
    = march 31 2013                
    1. is this possible? Header1/cell 1 is a date field. Header 2/cell 1 is a dropdown field (30, 60, 90,120, custom),.
    Header2 cell2 not sure what field to use date or text?
    thank you

    Never mind I figured it out. Thanks

  • Number of days before user needs to change password

    If I enter a value for "Number of days before user needs to change password" will that effect both user and supervisor accounts or just user accounts? I have a supervisor account that we use for a lot of processes and do not want it to expire. However, our corporate security policy is to have user passwords expire at least every 90 days. Has anyone faced this before?<BR><BR>Thanks,<BR><BR>Mburkett

    mburkett,<BR><BR>Version 7.X has the external authentication option. The integration with active directory is very easy and can be configured in a few minutes. However, if your Essbase user names are different than MSAD user names, you would have to replace all Essbase users with their domain ID in order to use external authentication. If the user names are the same, it is only a matter of changing the flag to use the external AD password, rather then the Essbase password. <BR><BR>If you are not using Hyperion HUB, you should install it prior to implementing External Authentication.<BR><BR>I don't know the details of your custom job scheduler, but if it is based on ESSCMD, I dont see why it would not continue to work with an upgraded version.<BR><BR>Good Luck,<BR><BR>Chris

  • FM which gives the date if we add 'x' number of days to the current date.

    Hi all,
    can you plz tell me the FM which will give me the exact date if i add some ' X ' number of days to the present date.
    in detail -->my inputs would be    1)DATE
                                                    2)no of days
    i need--> the exact date which comes after those days get added to the given date.
    PLZ HELP ASAP.
    Rgds,
    REDDY.

    Hi,
    You can use FM RP_CALC_DATE_IN_INTERVAL.
    data: wa_date  like sy-datum.
    *Add 21 days to current date.
    call function 'RP_CALC_DATE_IN_INTERVAL'
             exporting
                  date      = sy-datum
                  days      = 21
                  months    = 0
                  signum    = '+'
                  years     = 0
             importing
                  calc_date = wa_date.
    write: / wa_date.
    Regards,
    Ferry Lianto

  • Need to add Standard transaction code to User Menu.

    Hi All,
    I need to add Standard transaction code to User Menu. How this can be accomplished?
    Thanks

    Your Security and/or Basis team probably have control of the user menu settings.  On the other hand, if this is for YOUR user menu, you could choose to simply adjust your favorites.

  • Number of days before user must change password.

    Hi,
    I understand how does this Essbase server setting work:
    Essbase Server Properties - Security Tab
    "Number of days before user must change password"
    But my question is:
    Does anyone know how "to mark" certain group of Users (mainly system admin accounts) - that this setting will not force periodical passoword change for "marked" users ?
    Any ideas ?
    Br, ripasso

    There are a couple of things you could do to circumnavigate this all or nothing option.
    You could write a maxl statement that would update the user profile to force the user to change their password e.g.
    alter user Fiona set password_reset_days immediate;
    I would write a program using the API that lists all users in the group and then dynamically create the maxl script that uses the statement above.
    If you can not use the API then I guess you could do a maxl only solution (using display user command) and do some text file manipulation in perl (or another scripting language).
    There are probably more solutions/ideas out there.

  • How do you work out the number of days difference between two dates?

    I'm running Crystal v12.
    We use a date field in our SQL database that we use to store the client's year end date.
    As the year end date (date and month) doesn't change for a client, the year end date field in all of our reports is set to just show the DD/MM part. Over the years as new clients are set up we just enter the date and month - the year part is irrelevant although as in all date fields the year is automatically entered.
    Doing it this way means that we don't have to adjust the year end year part each year. We just use the DD/MM part.
    I need to create a formula that works out the number of days there have been (i.e. the difference) from the current date to the year end date. It MUST EXCLUDE the year however.
    For example:
    Year End Date = 30/04/03
    Current Date = 25/05/10
    Days Difference (EXCLUDING year) = 25
    Days Difference (including year) = 2582
    Year End Date = 31/03/09
    Current Date = 25/05/09
    Days Difference (EXCLUDING year) = 55
    Days Difference (including year) = 420
    If you include the year part then working out day difference is simply a case of creating a formula that subtracts the year end date from the current date (CurrentDate - {tblClient.YearEnd}.
    HOWEVER I need to exclude the year part.
    Can anyone tell me the formula or best way to do this?
    Thanks in advance.
    Edited by: BadBoy House on May 25, 2010 3:15 PM
    Edited by: BadBoy House on May 25, 2010 3:15 PM

    Hi
    You can try this
    datevar e := date(year(currentdate),month({tblClient.YearEnd}),day({tblClient.YearEnd}));
    numbervar num_days := datediff("d",currentdate,e)
    Create a datevar called e that uses the original month and day numbers for {tblClient.YearEnd} but uses the year of the current date
    Then just datediff on e to get the number of days between the two dates
    I hope i understand your problem and that this helps
    Best regards
    Patrick

  • Calculate number of days between two festival dates in payroll schema

    Hi Experts,
    According to my company policy:
    If an empl termination happens before Eid festival of the current year, then the pro-rated Eid bonus (yearly) is based on:
    (The duration between Eid Festival date of previous year - Eid festival date of current year.)/350 days
    Time Evaluation is not implemented in the system. Only payroll is implemented.
    My question: How can I capture the number of days between (Eid Festival date of previous year - Eid festival date of current year) in the payroll schema ?
    Regards,
    Somdeb.

    Hi,
    You can try using date specification. If you update last year eed holiday date for the employee then you can use the operand F along with NUM to get days between last eed holiday and current payroll period last day.
    i.e NUM=FaaT 0
    F is operand to query date specification.
    aa is the date specification.
    T is for unit and it gives number of days
    next space is for current payroll period last day and 0 will reset alternate date to zero if no date specification is mentioned.
    Basically this will give number of days from date mentioned in date type aa to current period last day. For more info you can go through documentation on operand F for NUM.
    Let us know if this helps.
    Regards,
    Poorvi.

  • Problem in setting user end date from oim to account expiry date in AD process form

    Hi all,
    i am updating the user end date from oim to user account expiry date in ad process form using oim api.
    i am able to get the end date value from oim but when i am setting it using api it through exception but all other attribute i am able to update in process form.
    i am facing the problem only with end date field because of different date format in OIM and  AD .
    so please suggest me what are date format in Active Directory and how can i change the oim date format to Active directory time format in in my java code.

    Thanks for the reply.
    But all iplanet users need not contain end date attribute, and its an update on existing user.
    Can you please ellaborate more on Transformation class..?? example should be helpful.

  • Convert number of dayes per year to data

    Please i need help in Convert number of dayes to date
    I have ID's like id
    FT*09025*0000000001 date=20090125
    FT*01171*0000000002 date=20100620
    so should convert first five number after FT to date
    example *09025*
    09 map to 2009
    025 number of dayes per year map to 25 jan
    example *01171*
    01 map to 2010
    171 number of dayes per year map to 20 jun
    (jan+feb+mar+apr+may)=(31+28+31+30+31)=151
    171-151=20 for the next month
    Please need help so will added filter to informatica map with date
    Edited by: user8929623 on Jul 4, 2010 7:04 PM

    Well, I do not follow why when 09 maps into 2009, 01 maps into 2010, not into 2001. Assuming it should be 2001, use YYDDD format:
    SQL> with t as (
      2             select 'FT*09025*0000000001' id from dual union all
      3             select 'FT*01171*0000000002' from dual
      4            )
      5  select  to_date(substr(id,4,5),'yyddd') dt
      6    from  t
      7  /
    DT
    20090125
    20010620
    SQL> SY.

  • Calculate number of days based on System Date and a date column!

    Hi everyone,
    I have a query to run a report where the results has a column named “Due Date” which holds a date value based on the project submission date.
    Now, I need to add 4 columns named, “45 Days Expectant”, “30 Days Overdue”, “60 Days Overdue” and “90 Days Overdue”.
    I need to do a calculation based on the “Due Date” and “System (I mean default computer date) Date” that if “System Date” is 45 days+ to “Due Date” than put “Yes” in “45 Days Expectant” row.
    Also, if “Due Date” is less than or equal to system date by 30 days, put “Yes” in “30 Days Overdue” and same for the 60 and 90 days.
    For example the output should be like:
    Is this possible? Can someone help me how to write this Case Statement please? I have some answers how to do it in SSRS (Report Designer) but I want to get the results using T-SQL...Thanks heaps...cheers...
    artistdedigital

    Hi Jay,
    Thanks but those dates are just a reference. The actual table contains hundreds of date rows... so I guess this technique will not work (not sure though)...
    I am quite cool with this bit:
    select duedate,
    case when days > -45 and days < 0 then 'YES' else '' end as '45 Days Expectant',
    case when days between 30 and 60 then 'YES' else '' end as '30 Days overdue',
    case when days between 60 and 90 then 'YES' else '' end as '60 Days overdue',
    case when days > 90 then 'YES' else '' end as '90 Days overdue'
    from cte--------------------------------------------------------------------------------------------------But can you please explain this bit a more? Thanks for being so prompt though : )declare @tab table (duedate datetime)
    insert @tab select '04/25/2014'
    insert @tab select '02/10/2014'
    insert @tab select '01/10/2014'
    insert @tab select '12/10/2013'
    ;with cte
    as
    select duedate,datediff(dd,duedate,getdate()) as days
    from @tab
    artistdedigital

  • How to find end of the Page in Crystal ? or I need to add one Horizontal line at the end of the page.--- URGENT HELP NEEDED

    Hi friends,
    I need to add one horizontal line  for the detail section at the end of the page.
    I tried to put that line in page footer and i tried with Box also. Both are not properly working. Some space problem is coming.
    Is there any feature to find end of the Page.
    I want report format like this.
    set id  |  set name |  date  Name
      1         x           dddd   vijay
                            dddd   sarathi
                            dddd    reddy
    (End of the page)
    Thanks in advance...
    vijay.

    Do you know how many detail records are showing up per page?
    If you do - you could create a Details B section that is suppressed except for on Record N (where N is a counter, and N is the last Detail record that will show up on a page).
    The Page footer is indeed built so that it will be rendered at the bottom of your physical page of paper.

  • Need to add a new row at the end of the table

    Experts,
    working jdev 11.1.1.3.0
    i am adding row programetically, my requirement need to add the row at after last row.
    i tried different ways.
    Row newLastRow = getPWBBidLaneVO().last();
    int lastRowIndex = getPWBBidLaneVO().getRangeIndexOf(newLastRow);
    getPWBBidLaneVO().insertRowAtRangeIndex(lastRowIndex - 1,
    laneRow);
    this is giving --- java.lang.ArrayIndexOutOfBoundsException: 0
    and
    http://kohlivikram.blogspot.com/2008/10/add-new-row-in-adf-table-on-button.html --- its giving index out of bound because vo.getRangeSize() is 25. We set this value at vo for performance improment suggestions.
    is there a way to add a new row at the end of the table?

    Add this to the view row impl class
           public void insertRow(Row row) {
               //go to the end of Rowset if it has rows
               Row lastRow = this.last();
               if (lastRow !=null){
                    //insert new row at the end and make it current
                   int indx = this.getRangeIndexOf(lastRow)+1;
                   this.insertRowAtRangeIndex(indx,row);
                   this.setCurrentRow(row);
               }else { // empty Rowset
               super.insertRow(row);
               }

  • Number of Days from a given Date

    How can one calculate the number of days in a month from a given date?
    Ex: If I pass 07/12/2008 it should return 31

    But your example doesn't meet the OP request. The OP wanted the number of days in a month where the month is determined by a specified date (paraprhased).
    DimaCit gave two credible solutions that met that requirement. Yours just counts the number of days between two apparently arbitrary dates.

  • How to get the number of days between 2 given dates

    Hi all,
    How can I find the number of days between any 2 given dates.
    Thanks

    Hi
    Here's a dirty way:
    If you've got two Date objects in Java, call getTime() on each one (which gives you a value in milliseconds), then subtract the two millisecond values, and divide the result by the number of milliseconds in a day (24 * 60 * 60 * 1000). There's more `elegant' ways to do this, but this method only requires one line of Java.
    Best wishes
    Kevin

Maybe you are looking for

  • I Cant Open my iTunes all together error 7 (windows error 998)

    hello, i cant get my itunes to open i don't know what i did i might have deleted something i shouldn't have and this happend, when i try to open itunes it says: _*itunes was not installed correctly. please reinstall itunes. Error 7 (windows error 998

  • Vendor evaluation - General Service and support

    Hi What are the subcriteria that can be under General Service and support? How the scores are calculated for this?\ If manual where can we enter the scores for these? Regards Soumen

  • Dual Head - Window managers / Desktop enviroments Issues

    Hi. Grasping how Xorg, KDM/GDM, and the many DE:s / WM:s handle Dual head and the likes is not a walk in the park. This is really not really helpful towards newbies, setting up tv-out and such... Xinerama - cons: No DRI / openGL Not all apps are xine

  • Trouble fetching record from Internal table

    Hi all, I am using a binary search read for retrieving data from an internal table, but i am not able to fetch a particular record even while it is present in the internal table.

  • Can't load my adobe 6.0 program on my new windows 7

    I have recently purchased a windows 7 pc.  I own adobe 6.0 as I cannot  yet afford the new adobe.  My program will not load  for me.  I have downloaded Adobe reader - active x and acrobat I am not pc technical savey only graphics ,etc.  Why will my o