How to calculate next 12 months

Hi Gurus,
If a user enters a date like : 15.05.2007, I need to calculate next 12 months values.
i.e. low = 16.05.2007
     high= 15.05.2008.
Any help greatly appreciated. Thanks.
Best Regards,
Reddy.

data: l_month         type i,
        l_year          type i,
        l_sum_of_months type i.
data : V_DATE TYPE  D,
         V_MONTHS TYPE  I DEFAULT 0,
         E_DATE TYPE  D.
    l_sum_of_months = v_date+4(2) + v_months.               "YREM981595
    l_month         = ( l_sum_of_months + 1 ) mod 12.       "YREM981595
    if l_month eq 0.
      l_month = 12.
    endif.
    l_year  = l_sum_of_months div 12.
    l_year  = l_year + v_date(4).
    if l_year gt 9999.
      e_date      = con_hidate.
    else.
      e_date+6(2) = '01'.
      e_date+4(2) = l_month.
      e_date(4)   = l_year.
      e_date      = e_date - 1.
    endif.
rewards if useful,
regards,
nazeer

Similar Messages

  • How to Calculate last 12 months in webi?

    Hi,
    I am working on a webi report based on oracle. My report table does not have any month field in it. Hence, I created a derived table in the universe for 12 months. Now, in my report I need to calculate last 12 months data. The month and year value will be given by the user and from that date values will be displayed for previous 12 months on a chart.
    Any ideas how achieve this in webi?
    Regards,
    C Mira

    Hi,
    Generally you can get the user values using the UserResponse() function.
    Using this, you can do some basic transformation of the user values for month and year to create a "Year_month_user" variable - e.g. in the format YYYYMM or better yet - create a date variable!
    (using the ToDate() function)
    When this variable is created, you can create a similar variable "Year_month_unv" from the universe objects.
    Then apply a custom filter on your chart with the syntax
    =[Year_month_unv] Between([Year_month_user];RelativeDate([Year_month_user];-365))
    I hope this helps.
    Btw: my first forum post - Yes!
    Edited by: Simon Steiper on Jul 28, 2010 2:25 PM (added the RelativeDate to syntax)

  • How to Calculate number of months between two dates

    Hi All,
       In one of the fomr developments, I have to calculate the
    Number of Days
    Number of Months ( Considering Leap Year) provided by the dates, end user enters in the form,
    After going thorugh some forum discussion, I have come to know about so many things which were not clear till now.
    I have gone through various forums too,  some one suggets to make use of FORM CALC and some other JAVA SCRIPT. But the logic i want to build in java script.
    The most interesting point is the DATE object is not getting created when i write  the below code
      var startDate = new DATE(oYear, oMonth, oDay);
    I am still not clear, that really the date object gets created in Adobe form If so the why the alert box is getting populated when i write below lines
    var oTemp = startDate.getFullYear();
    xfa.host.messagebox(oTemp);
    So, there are so many unclear things,
    If any one can help me by suggesting the approach and how to build the logic in the JavaScript I would be really thankful
    Regards
    PavanChand

    Hi,
    ChakravarthyDBA wrote:
    Hi
    I want number of Sundays between two dates
    example
    number of Sundays count between '01-04-2013' and '30-04-2013' in one select query I have to include this as sub query in my select statement.Here's one way:
    SELECT       early_date
    ,       late_date
    ,       ( TRUNC (late_date + 1, 'IW')
           - TRUNC (early_date,        'IW')
           ) / 7       AS sundays
    FROM       table_x
    ;This does not depend on your NLS settings.
    I hope this answers your question.
    If not, post a little sample data (CREATE TABLE and INSERT statements, relevant columns only), and also post the results you want from that data.
    Point out where the statment above is getting the wrong results, and explain, using specific examples, how you get the right results from the given data in those places.
    Always say which version of Oracle you're using (e.g., 11.2.0.2.0).
    See the forum FAQ {message:id=9360002}

  • How to calculate year and month

    Dear Friends
    I have to make a customised report.In this report there are different buckets of one year from the year and month being entered by the user.
    For example if user is giving input value for year and month as 200912 then system has to show data in first bucket for the period 200912 to 200901.In the second bucket system will show data for period 200812 to 200801.In this way system has to show data in 11 buckets for 11 years.
    Is there any function module/BAPI in SAP through which system will calculate period of one year for different buckets for my report from the input value(year and month) being given by the user.
    Moderator message - Please see The specified item was not found. before posting - post locked and Points unassigned
    Edited by: Rob Burbank on Jan 5, 2010 11:03 AM

    Hi Satish,
    You can do this with a Standard function module.
    I am providing my code below :
    data : G_date type sy-datum.
    CALL FUNCTION 'RP_CALC_DATE_IN_INTERVAL'
        EXPORTING
          DATE      = sy-datum " instead of sy-datum provide
              " the select option here which user provides.
          DAYS      = C_fourty"45
          MONTHS    = C_MM    "00
          SIGNUM    = C_Negative "'-'
          YEARS     = C_YY    "00
        IMPORTING
          CALC_DATE = G_date. "G_date will have date less than 45 days
    *                         " from the day program has been executed.
    Now based upon the G_DATE, we can fetch remaining 10 buckets.
    Regards,
    Kittu
    Edited by: Rob Burbank on Jan 5, 2010 11:01 AM

  • How to calculate a week & Month in given date range (not for sele-options)

    Hi ,
      I have defined 2 date parameters in sel-screen (Plz remember that date variable are not a SELECT-OPTIONS).  Now i want ot display week nos & monts in output.
          Ex: date1: 20080101 & date2: 20080229. then
                    weeks : 1, 2, 3,---9.
                    months: jan-08, feb-08.
    Plz help me with block of code or any FM.
    Regards,

    Hi Srikanth,
            The FM HR_99S_INTERVAL_BETWEEN_DATES   is doesn't existing, but there is a fm HR_MX_INTERVAL_BETWEEN_DATES but it returns no of Years & Days.
           But i found some FM which r returns no of months for given date range. but my requirement is, want to display the month no bw 1 to 12. (ex: dat1=15-03-2008 & dat2= 01-06-2008 then in month fields 03,04,05 & 06. ).
    Plz help me on this.
    -Regards.

  • Calculate last 5 months

    How to calculate last 5 months from sysdate ?
    The statement - SELECT TO_CHAR(SYSDATE,'YYYYMM')-1 FROM DUAL gives 201300. The desired output is 201212, 201211, 201210, 201209, 201208.
    Sanjay

    Try this
    select to_char(add_months(sysdate, -1), 'YYYYMM') from dual
    union
    select to_char(add_months(sysdate, -2), 'YYYYMM') from dual
    union
    select to_char(add_months(sysdate, -3), 'YYYYMM') from dual
    union
    select to_char(add_months(sysdate, -4), 'YYYYMM') from dual
    union
    select to_char(add_months(sysdate, -5), 'YYYYMM') from dual

  • How to calculate age based on current month and over the next 12 months in Webi 4.1

    Hi,
    I am working on a report where I need to show employees who turned 65 from the time the report is run to over the next 12 months.I have the 'Date of Birth' field available. I am using Bex Query as a data source and webi 4.1. How do I calculate this in Webi 4.1. I appreciate any help.
    Thank you,
    Charvi.

    Hi Charvi,
    Get the all employees who are all in 64 age bucket till yesterday.  Keep indicator for these employees.
    Then obviously these employees will be falling in 65 age in coming 12 months/365 days.
    Same you can get at Bex level also. Create formulae :
    if employee age = 64 then 1 else 0.
    (AGE = 64 * 1 + 0)
    Then create condition on this formulae as Value = 1.
    Revert back your feedback.
    Regards, Vijay

  • How to calculate Month on Month growth rates in an OBIEE query?

    Dear all,
    I would like to ask your help on how to calculate Month on Month growth rates [(last month - previous month)/previous month*100%] in an OBIEE query. This ratio should be always calculated for the last 2 available months.
    I have the following query:
    Month0 | Month1 | Month2
    Product A 500 | 100 | 200
    Product B 600 | 300 | 150
    would like to add Month on Month column as following:
    Month0 | Month1 | Month2 | Month on Month(%)
    Product A 500 | 100 | 200 | +100.00%
    Product B 600 | 300 | 150 | -50.00%
    I tried to add a calculated item but it was not successful because I could not find out how to show only the calculated column as % with 2 decimals. Moreover, I would ideally prefer to have an automatic update but as far as I understood it can't be done in the calculated item automatically
    I also tried to add a new column in the column area and to filter the results for the last month, then for the previous month and then based on it to calculate the needed ratio but unfortunately it also does not work out.
    Thank you your hints in advance

    Hi,
    The best way to solve this is using the Ago function. With this you can create a logical column for the previous month. Then you will have 2 columns available with which you can do your calculations.
    If you want to do this with a calculated item (don't know if the formatting will work for you), but you can make the calculation more general by using $1 for column 1 and $2 for column 2 in your calculation. So the relative columns ($x) will change with the columns in your report.
    Regards

  • With 'Revenue' Fact Column how can i calculate 'Previous 3 Months Revevue'

    Hi All ,
    i have a Column Called Revenue from Fact Table. i need to calculate Previous 3 Months Revevue
    How can i achive this ? please help me
    Thanks in advance

    Hi,
    Create one new logical coloumn bmm layer and
    1.Check Use existing logical columns as the source
    2.Click the Expression Builder button (three dots) to open the Expression Builder
    3.Select Functions > Time Series Functions > Ago.
    by using this u can create 3 months year ago revenue coloumn and use this coloumn in your formula
    hope this will help for you
    Naresh

  • How to calculate AUTOEXTEND ON NEXT in tablespace clause

    hi
    Please explain How to calculate AUTOEXTEND ON NEXT in tablespace clause.
    whether AUTOEXTEND ON NEXT 50M or 100M or 500M
    Thanks

    174313 wrote:
    hi
    Please explain How to calculate AUTOEXTEND ON NEXT in tablespace clause.
    whether AUTOEXTEND ON NEXT 50M or 100M or 500M
    ThanksThe autoextend size depends on the following :-
    1) Tablespace type Dictionary managed (DMT) or Locally managed (LMT)
    2) Segment space management manual or Auto.
    3) Extent allocation management Autoallocate or uniform.
    If your tablespace is Locally managed with segment management Auto (ASSM) and with extent management is uniform , the autoextend size will be uniform for all the extents , initial and next extents all will be uniform size .
    If your tablespace is Locally managed with segment management Auto (ASSM) and with extent management is autoallocate, Oracle will size the extents automatically starts with 64KB and can go upto 64MB.
    If you have dictionary managed tablespace you will specify the next size at tablespace creation.
    Hope this helps.

  • How to calculate ' Month - 1' in web intelligence 3.1?

    Hello All,
    While designing webi report I want to display previous month in the table.
    eg:--
    Aug -- Jul -- June -- May -- June .............like wise.
    I know the inbuilt function to calculate previous date... that is ...
    =RelativeDate(CurrentDate();-1)
    but how to calculate previous month ?
    Thank you.
    Regard's,
    Bhushan.

    Hi,
    So If consider Island Resort Marketing, you have the following Objects:
    Country, Sales Revenue and Invoice date in format(dd/MM/yyyy)
    Current requirement is:
    to display say a crosstab:
                    Aug-10    July-10     Jun-10     May-10   April-10    March-10   Feb -10  Jan-10
    US                 103         343            34          34          5676           5656          565       565
    France            45            454          454         454 ......
    Japan
    Please correct me if that is wrong.
    If this the case then...
    1. Create an Object Month of year- [invoice date] where year="2010" or any other will be fine.
    2. use [YearMonthname] =FormatDate([Month of year]);"dd/MMM/yyyy"  to get the month name.
    3. Use Substr([YearMonthname];4;3) to get only Month Name, call it [Month Name]
    4. Drag the object to the report and apply Custom Sort to it to appear in the order in which you want it to display.
    5. if Year required along with Month then concatenate with Year too.
    If this is not the case then let me know.
    Regards,
    Velly

  • How to calculate the salary of the employees when they are differentiated by monthly and hourly basis

    Hi all
    How to calculate the salary of the employees when they are differentiated by monthly and hourly basis
    How can we write the logic though sql
    Thanks in advance

    (case when pay_basis like 'HOURLY'
    then PROPOSED_SALARY_N*pay_annualization_factor
    when pay_basis like 'ANNUAL'
    then PROPOSED_SALARY_N*pay_annualization_factor
    end )
    I was actually trying to write the logic in this way but it was not calculating in correct format for hourly paid employees

  • How to Calculate Opening balance

    Hi BW Gurus,
    How to calculate Opening balance for previous period using variables in Reports using debit and credit.
    Example:
    Opening balance is the balance for an account for the previous period. In other words, if the user is running a report for Period 1, 2006, the opening balance is actually the ending balance from Period 12, 2005 (December 31st, 2005).
    Thanks in advance
    DJ

    Hi Friend,
    If Your Prob is solve then tell me how to find perticular month balance amount.
    i m create cash book report for perticuler GL Account , i use BKPF + BSEG for this
    i found all entries,
    But at last i want to Opening Balance for perticuler date.
    like     01/05/2007 opening balance = 10000 as per tcode FS10N
    and in 26/05/2007 ??????
    how to find exact date opening balance is there any function for same
    or any procedure..
    Thanks
    From
    Gaurav

  • How to calculate Average balance for an account

    Hi,
    How to calculate average balance for an account for a particular period say for JAN-12 period and after the end of that period for another two days 01-feb-12 and 01-feb-12 ?
    I'm using the following query :
    SELECT cc.segment1||'-'||cc.segment2||'-'||cc.segment3||'-'||cc.segment4||'-'||cc.segment5||'-'||cc.segment6 "Account_XX",
    nvl(sum(l.accounted_dr - l.accounted_cr),0) "Balance"
    FROM gl_code_combinations cc,
    gl_je_lines l
    WHERE cc.code_combination_id = l.code_combination_id
    AND l.set_of_books_id ='XX'
    and code_combination_id = replace it with code combination_id for account_xx
    AND l.effective_date <= '31-Jan-12' (january period end ??)
    GROUP BY cc.segment1||'-'||cc.segment2||'-'||cc.segment3||'-'||cc.segment4||'-'||cc.segment5||'-'||cc.segment6
    There are some discrepancies in "average balance" after end of month (Jan-12)?
    How to calculate average balances for a particular account (Account_XX above)from end of month of Jan to first two days of february?
    Thanks,
    Kiran

    Kiran,
    Please let me know first, is Average Balancing feature enabled in your GL Ledger?
    Regards
    Muhammad Ayaz

  • How to calculate YTD and Last year YTD on Date in Bex

    Hi,
    I have a requirement in which I need to show the report as following format.
    I need to show    Year>monthday as Hierarchy. user will drill down on Month to Date.
                 Del Qty              Ord Qty              Del  Qty LY              Del Qty YTD                  Del Qty  L YTD
    Year
    > Drill Down to Months
            Jan
            Feb
            Mar
              ---> 1.03.2010
              ---> 2.03.2010
              ---> 3.03.2010
            Dec
    I have Calday, Calmonth, Calyear all three objects.
    Now my question is how I can achive this? On which i need to create hierarchy?
    and how to calculate the YTD at day level.
    Note:- in the selection calyear is mandatory. User wants to display as per year.   So What infoobject I need to take in selection?
    and the way to calculate YTD on Day (in the case also ,where user doesn't give the date in selection)
    Plz reply asap its uregent !!!
    Thanks in advance,
    Amit

    Hi,
    As per my understanding I think YTD means JAN to current date result. I means say if user enter 062005 then result in YTD should be from 012005 to 062005.
    And to do this you need to write a customer exit variable where LOW field of internal table you will put JAN year and HIGH will contain month year entered by user.
    Hope this will help you.
    Suneel

Maybe you are looking for

  • Contacts always crashing

    Everytime I open my contacts, it shows the iCloud updating (the wheel spinning beside it) then it will stop and completely shut down. This happens every time I open it. Please help me out. Here is the error: Process:         Contacts [53596] Path:   

  • My time capsule is no longer recognized. Help!

    I was trying to extend my wireless connection with an airport extreme. In following the instructions, it indicated that by pressing 'continue' the device (the time capsule) would be disabled for a few minutes. It's been a couple of hours now. Any ide

  • Can't connect to computer on network but can share screen

    I've got a MBP 2.4 that I can't connect to another MBP or a Mac Pro on our home network (Airport Extreme router). I can share the screen but I can't connect. The other computers can connect and share into the 2.4. I can't figure this out since all of

  • Oracle 8i vs Windows 2000 profesional

    Hi! Guys Need help please! I 'm trying to install Oracle 8i on windows 2000 and I keep getting the error "No top level NT products". I tried chnging the symcjit.dll to symcjit.old as sugested in other forums but I'm still not winning. Please help guy

  • HELP! Lost work!!

    I was typing a paper on ipages when it closed without warning. I did not save before this happened. Is there anyway to get it back? Please I put a lot of work in to this I was so stupid not to save!