Retirement Date Calculation based on Date Of Birth

Hi All,
We have 11.1.2.2 PSPB Application where we have requirement to calculate "Retirement date" (in the format dd/mm/yyyy) based on employee's "Date Of Birth", for which i tried with @DateRoll function, but no luck. For time being we tried "Retirement Year" which was successful.
"Retirement Year"=@INT ("Date Of Birth"/10000)+60;
For Example: If Employee's Date of Birth is 7/11/1946 thru above script i got 2006 as his "Retirement Year", now i need "Retirement Date" as 6/11/2006 which im not getting. I tried in all ways like:
1) "Retirement Date"=@DateRoll ("Date Of Birth",DP_YEAR,1); got output as 31/03/5127 for "Date Of Birth" 01/01/1975
2)"Retirement Date"= @FORMATDATE ("yyyyddmm",@DateRoll ("Date Of Birth",DP_YEAR,1)); no luck.
3)"Retirement Date"=@DATEDIFF (@Today(),"Date Of Birth",DP_YEAR)); no luck.
Also all the Date functions like @DateRoll,@FromatDate,@DateDiff etc returns number representing the date between January 1, 1970 and Dec 31, 2037, is that true? If yes, what functions needs to be used for  "Date of Birth" above the range.
Please suggest ASAP.
Thanks in advance.
Regards,
Sahi

If anyone's interested, I found a solution
if (DropDownGuarantee.rawValue eq "1" and DteStart.rawValue ne null) then
Num2Date(Date2Num(DteStart.formattedValue, "M/D/YYYY") + 30, "M/D/YYYY")else
if (DropDownGuarantee.rawValue eq "2" and DteStart.rawValue ne null) then
Num2Date(Date2Num(DteStart.formattedValue, "M/D/YYYY") + 30, "M/D/YYYY")else
if (DropDownGuarantee.rawValue eq "3" and DteStart.rawValue ne null) then
Num2Date(Date2Num(DteStart.formattedValue, "M/D/YYYY") + 60, "M/D/YYYY")else
if (DropDownGuarantee.rawValue eq "4" and DteStart.rawValue ne null) then
Num2Date(Date2Num(DteStart.formattedValue, "M/D/YYYY") + 60, "M/D/YYYY")else
if (DropDownGuarantee.rawValue eq "5" and DteStart.rawValue ne null) then
Num2Date(Date2Num(DteStart.formattedValue, "M/D/YYYY") + 60, "M/D/YYYY")else
if (DropDownGuarantee.rawValue eq "6" and DteStart.rawValue ne null) then
Num2Date(Date2Num(DteStart.formattedValue, "M/D/YYYY") + 90, "M/D/YYYY")else
if (DropDownGuarantee.rawValue eq "7" and DteStart.rawValue ne null) then
Num2Date(Date2Num(DteStart.formattedValue, "M/D/YYYY") + 90, "M/D/YYYY")else
if (DropDownGuarantee.rawValue eq "8" and DteStart.rawValue ne null) then
Num2Date(Date2Num(DteStart.formattedValue, "M/D/YYYY") + 90, "M/D/YYYY")else
if (DropDownGuarantee.rawValue eq "0" and DteStart.rawValue ne null) then
Num2Date(Date2Num(DteStart.formattedValue, "M/D/YYYY"), "M/D/YYYY")else
if (DropDownGuarantee.rawValue eq "9" and DteStart.rawValue ne null) then
"enter expiration date"
Marlene

Similar Messages

  • Calculation based on date key figures in BEx

    Hi Friends,
    Hi Friends,
    I need to creat report for sales order data, which involved the calculation based on dates.
    In my cune iam having the data at the granual level with the dates as key figures. the calculation that i need to do is VTW = Actual PGI date - Customer want date.
    1) whn i run the report at the granual level my VTW is working correctly. No issues.
    2) when i run the report at higher levels the date fields are updated with X, as the system is unable to aggrigate the dates. The dates are at the material level in  a sales order. I need to show the VTW at the sales order level (each one of the two dates are same for all the materials). So, when i run the report with out mataril at the sales order level...i wanto sea the bothe date fields in a single line and also the VTW calculated as the different between throse two dates.
    3) Once we get the VTW correctly at the sales orde level. if i drill down the report for material, i want to sea both the dates in every record againest the matarial, but the VTW only aginest the first record...that is againest the sales order. I dont waht the VTW value repeated/duplicated for all the records againest the sales order,as VTW makes sence only at the Sales Order level.
    Please suggest me hwo i can achive the resulsts by meeting both Point 2 and 3.
    Thanks for ur help...in advance.
    Thanks,
    Renu

    Hi..
    I have the data from the extractore and in the cube as below.
    SALES ORDER    ITEM                MATERIAL            DATE1                         DATE2
    101                        Item1               Mat1              01/01/2010                15/01/2010
    101                        Item2               Mat2              01/01/2010                15/01/2010
    101                       Item3                Mat3             01/01/2010                15/01/2010
    I need the reports as below...
    Report1:
    SALES ORDER        DATE1                         DATE2                  VTW (DATE2 - DATE1)
    101                        01/01/2010                15/01/2010                14
    currently iam getting this Report1 output as below...
    SALES ORDER        DATE1                         DATE2                  VTW (DATE2 - DATE1)
    101                             X                                   X                           42
    Report2: Out put required as below
    SALES ORDER     ITEM                MATERIAL            DATE1                         DATE2      VTW (DATE2 - DATE1)
    101                        Item1               Mat1              01/01/2010                15/01/2010              14
    101                        Item2               Mat2              01/01/2010                15/01/2010
    101                   I     tem3                Mat3             01/01/2010                15/01/2010
    currently iam getting this Report2 output as below...
    SALES ORDER     ITEM                MATERIAL            DATE1                         DATE2      VTW (DATE2 - DATE1)
    101                        Item1               Mat1              01/01/2010                15/01/2010              14
    101                        Item2               Mat2              01/01/2010                15/01/2010               14
    101                   I     tem3                Mat3             01/01/2010                15/01/2010               14
    As VTW is need to be measued at the sales order level and we always have the DATE1 & DATE2 as same for all the itesm, it should be shon as only 14 in the first record. It mean once iget the required output from Report one in a single line with VTW as 14, it should not repeat with every line , when i dril down the report for Items or materials.
    Even if i can generate oly report2 as required in a single sheet ...that will be enough.
    Plas kindly provide some solution as how we can achieve this,
    Thanks,
    Renu

  • How do you set up a default Date To based on Date From for report parameter

    I'm working on a report. I have been asked to set up a default Date To based on Date From for the report parameters. I mean when running a report, if an end user selects a value for parameter Date From, system will automatically populate the Date To parameter based on the Date From + 6 days.
    I guess there's gotta be something to do with Value Set. Do any of you guys know how to go about this?
    Any suggestion is greatly appreciated.
    Dennis

    You should be able to retrieve the value of other valueset using :$FLEX$.<valuesetname> I'm not sure about the exact syntax, it's been a while since i worked with applications.

  • MDX calculation based on date logic for the Jan 1 of current year through the 15th of the previous month

    Hello, 
    We need some help with an SSAS MDX query based on date logic. One of the problems is that I don't have access to the Cube but have been given a query example with the logic needed for the calculation. Here's the scenario; 
    The ETL process will run on the first Tuesday after the 15<sup>th</sup> of a given month. The Analysis Cube data queried should include the current year up to the end of the previous month. For example, on May 19<sup>th</sup>
    (the first Tuesday on or after the 15th) the query should include data from January 1<sup>st</sup> through April 30<sup>th</sup>.
    The 15<sup>th</sup> of the month is not part of the query, it is a factor in when the query is run. The query will always be in terms of complete months.
    SELECT
                    NON EMPTY { [Measures].[Revenue Amount],
                    [Measures].[Utilization],
                    [Measures].[AVG Revenue Rate],
                    [Measures].[Actual Hours] }
    ON
                    COLUMNS,
                    NON EMPTY { ([dimConsultant].[User Id TT].[User Id TT].ALLMEMBERS * [dimConsultant].[Full Name].[Full Name].ALLMEMBERS * [dimConsultant].[Employee
    Type].[Employee Type].ALLMEMBERS ) } DIMENSION PROPERTIES MEMBER_CAPTION,
                    MEMBER_UNIQUE_NAME
    ON
                    ROWS
    FROM
                    ( SELECT
    ( { [dimDate].[Week Date].[1/4/2015], [dimDate].[Week Date].[1/11/2015], [dimDate].[Week Date].[1/18/2015], [dimDate].[Week Date].[1/25/2015], [dimDate].[Week Date].[2/1/2015] } )
                    ON
                                    COLUMNS
                    FROM
                                    ( SELECT
    ( { [dimIsBillable].[Is Billable].&[True] } )
                                    ON
    COLUMNS
                                    FROM
    [SSASRBA]
    WHERE
                    ( [dimIsBillable].[Is Billable].&[True], [dimDate].[Week Date].CurrentMember ) CELL PROPERTIES VALUE,
                    BACK_COLOR,
                    FORE_COLOR,
                    FORMATTED_VALUE,
                    FORMAT_STRING,
                    FONT_NAME,
                    FONT_SIZE,
                    FONT_FLAGS

    Hi Hans,
    Thank you for your question.  
    I am trying to involve someone more familiar with this topic for a further look at this issue. Sometime delay might be expected from the job transferring. Your patience is greatly appreciated.  
    Thank you for your understanding and support. 
    Regards,
    Simon Hou
    TechNet Community Support

  • Date calculations based on working days

    I need to add date calculations to a worksheet to show the time elapsed between two actions.
    Just a straightforward subtraction works fine, but what I really need to be able to do is calculate the number of working days between the two point (as something taking 5 days over Christmas with the 2 bank holidays is different equivalent to something taking 3 days in a normal week)
    At the moment I'm exporting the data into excel for analysis of this, but would really like to be able to do it in Disco so that the end users can go straight to the report using viewer, rather than having to do the conversion for them.
    Is this possible?
    Cheers

    Hi,
    Every thing is possible, the Q is how complicated is it....
    My suggestion is to create a table with all the dates of the non-working days for ex:
    create a table with all the MON-THURSDAYS, union to this table the holidays you know of such as christmas and so on.
    After getting this table you can create a function that returns the number of working days between 1 date to another by subtracting the days exists in this table.
    I started with that, you are more then welcome to get ahead with it and let us know what happened...
    create table holiday
    D_date date,
    d_day varchar2(20)
    create or replace procedure holiday_proc is
    d_date date;
    begin
    d_date := trunc(sysdate);
    while d_date<'01-jan-2010'
    loop
    if to_char(trunc(d_date),'Day') not in ('Saturday ','Sunday ') then
    INSERT INTO Holiday (d_date,d_day)
    (select trunc(d_date),to_char(trunc(d_date),'Day') from dual);
    end if;
    d_date := d_date+1;
    end loop;
    commit;
    end holiday_proc;

  • Help with date calculation based on office hours

    Hi,
    could you guys point me which way should I think of in PL/SQL, or maybe SQL to calculate a date using not 24 hours day, but office hours.
    Let me give you an example
    Office hours are between 9am till 5pm
    I receive a case - registration time - 14.03.2013 4pm, and I'm supposed to calculate the Due date, let's say Registration time + 10hours.
    Normaly I would do "registration time" + 10hours, but I can't. I cannot use 24 hours window for the calculation, but 9am - 5pm window.
    So the "Due timestamp" would be = "16.3.2013 10am". Which is : 1 hour from 14.03. + 8hours from 15.3. + 1 hour from 16.3.
    Thanks for any ideas.

    Hi,
    A user-defined function would be very handy for that. Foir example
    add_office_hours ( in_start_date DATE
                     , in_num_hours  NUMBER
    RETURN DATE
    DETERMINISTIC ...First, copy in_start_date to a local variable, start_date, and check if start_date is within office hours. If not, change it to the beginning of the next business day.
    Add in_num_hours to start_date. Is the result before 5pm on the same day?
    If so, the function is finished. Return that date.
    If not, find how much past 5pm the result is, and recurse (that is, have the function call itself with a new, later in_start_date and a new, smaller in_num_hours). If you prefer, you can use a loop instead of recursion.
    How do you treat weekend and holidays?
    Would you want to call the function with a negative number of hours?
    If you'd like help. post your best attempt.
    Post CREATE TABLE and INSERT statements for a table that you use for testing. The table should have start_date, num_hours and correct_result_date columns.
    Always say which version of Oracle you're using (e.g. 11.2.0.3.0).
    See the forum FAQ {message:id=9360002}

  • Dynamic Date Calculation for Current Date - 1

    I am trying to create a variant with a dynamic date calculation attribute.
    I am following the instructions as they are posted to the web but I get an error message.
    I want to get all data EQ to the current date -1
    In the object for selection screen I enter a D for Selection Variable, for Name of Variable I enter an I to include specific values and the option EQ for current date +/- ??? days.  Then I enter 1- for the number of days.  I have tried to enter this many times and in many ways but it doesn't work.  I keep getting this message "lower limit of interval is greater than upper limit"

    Hi,
    Welcome to SDN.
    Selection-screen has four values -
    SIGN
    OPTION
    LOW
    HIGH
    Pass your date value in the option low for the screen.
    Sign you have already pass as I and option as EQ.
    Regard,
    Amit
    Reward all helpful replies.
    Can you paste your code here.
    Message was edited by:
            Amit Khare

  • Promised Date Calculation based on Need by Date and Transit Time

    Hi,
    I have created PO with NBD as D25 (Day 25) and approved it. This means that i need the goods to be at my premisis by D25.
    Now the requirement is
    Promised date in my PO should be calculated to D25 - Transit Time. So that supplier will be notified D25-Transit time.
    Or Is there any workaround to overcome this.
    Thanks,
    Jey

    Jey-SCMFG wrote:
    Hi,
    I have created PO with NBD as D25 (Day 25) and approved it. This means that i need the goods to be at my premisis by D25.
    Now the requirement is
    Promised date in my PO should be calculated to D25 - Transit Time. So that supplier will be notified D25-Transit time.
    Or Is there any workaround to overcome this.
    Thanks,
    JeyHi Jey,
    Where you are capturing your lead time. You can do it in item master.
    Once it is there, write a personalization to calculate the promised date and update the field.
    Thanks,
    PS.

  • Delivery date calculation based on route in VA02

    Hi.
    I am unable to find the code for the calculation of dates in schedule lines in VA02. For plant 0201 the delivery date in schedule lines is coming wrong. I think it is not getting calculated according to the route. In addition, it is not taking route from APO but taking it from R3. I have done the debugging several times and looked into the program SAPMV45A also but still could not find the code for the calculation. Can you please guide me on this?

    Hi,
    Please check for Implementation of User Exits :
    MV45AFZ4
    MV45AFZA
    MV45AFZB
    MV45AFZC
    MV45AFZD
    MV45AFZF
    MV45AFZH
    MV45AFZU
    MV45AFZZ
    Thanks & Regards
    Suresh Nair

  • Calculation based on date but year&month on seperate fileds.

    Hello,
    Simple question:
    I have a table in 9i with the fields SOURCE, YEAR, MONTH
    Since I dont have a date field, how do I count e.g the records <07/2008 ?
    SAMPLE DATA:
    APPLES;2008;06
    APPLES;2008;07
    APPLES;2008;08
    Thank you in advance for your help.

    Without conversion to date:
    WITH sample_data AS (SELECT 'APPLES' Source, '2008' AS Year, '06' AS Month
                           FROM DUAL
                         UNION ALL
                         SELECT 'APPLES', '2008', '07'
                           FROM DUAL
                         UNION ALL
                         SELECT 'APPLES', '2008', '08'
                           FROM DUAL)
    SELECT *
      FROM sample_data
    WHERE YEAR < '2008' OR (YEAR = '2008' AND MONTH < '07');The "WITH sample_data AS (...)" block serves to mimic a sample table, so you can SELECT COUNT(*) FROM SOURCES
    WHERE YEAR < '2008' OR (YEAR = '2008' AND MONTH < '07');Urs
    Edited by: metzguar on 30.06.2011 13:15

  • Due date calculation from GR Date / Service entry sheet date

    Dear Friends,
    GRN Date--01.05.2009
    Payment terms--- Within 45 days due net
    Transaction code---FBL1N
    System should not output these records before 14.06.2009 in FBL1N.
    It should ouput on or after 14.06.2009.
    Regards
    R Panda
    Edited by: Rutabhadra Panda on Jun 2, 2009 9:18 AM

    Hi
    Try with payment terms option
    SPRO- SAP IMG- Material Management - Purchasing - Vendor Master - Define terms of payment
    regards,
    Raman

  • Sort all the Records in Data manager based on Update Date

    How to sort the reocrds in Data Manager based on Date or something ?
    And also I have three records for a same customer in ( for three different company codes ) and when I search for this customer with the Customer number then it is showing three records , but when I search with Update Date then no records are fetched ...what is the reason ?

    If you make a field as type "Time Stamp" in your data model using the MDM Console, make sure that the option Sort Index is set to Normal.  If this is the case, whenever a record is updated in the repository, the date will be updated.  If the sort index is normal, then MDM will allow you to sort the records based on the date and time by which they were updated.  You can do this by finding your time stamp field in the MDM data manager and clicking on it.  If there is an up and down arrow next to the name of your field, it means it can be sorted.  Also, to answer your other question, you can definitely search based on date.  Use the Free-Form Search on the left hand side of the data manager at the bottom of the screen.  Simply select a date, and it will show you all the records updated on that date.

  • Enable "dynamic date calculation" variable type

    When saving reporting date/period in a report variant, we may use "dynamic date calculation" to specific date as selection parameter.  But the "Dynamic date calculation" is not visible in some ABAP reports - only "Table Variable from TVARVC"  type is available for selection. 
    For those reports that are missing that variable type, how can we enable the "Dynamic date calculation" variable type to be visible?

    Hi Paco:
    Yes, they are z-reports, both have the same almost everything, created by the same ABAPer, for the same application SD, just grouping the data differently.
    It seems a screen (#100?) is missing,  In the old version, it's screen 100 where to activate the "D" and "B" variable types.  Now it goes to screen 281.
    Stacy

  • Dynamic Date Calculation

    Hi all,
    Currently, i need to run a background PO report daily. As i only want today's PO data everytime the background job runs, i set the PO date dynamically using dynamic date calculation choosing current date, save it as a variant then schedule daily run.
    Howerver, for the next run day, the report was ok but subsequent running, the report is not the current date data.
    Any idea where i have miss out?
    Kindly assist and advise, points will be rewarded.
    Regards,
    Eric

    Hi,
    Thanks for your prompt reply.
    I am looking for ways to create a variant with changing date for daily run so that i do not have to daily modify the date.
    Regards,
    eric

  • Dynamic date calculator

    Hi all
    In Variants we can give dynamic date calculator to calculate date as we required. Does there is a option to add more selection option (ie if I have to add a selection last day of next month). Where I can do this
    Please comment
    With Regards
    Arun

    check the LSVAVF01 program for enchancement. or dynamic date selection you can select "  nth working day of current month " with calender option to select the last date of month.

Maybe you are looking for