How to calulate previous fiscal year from current year and periods as input

hi all,
i have a report where i have 2 select options as year and period.
my period can be a range  like( Ex: 1 to 6).
i like to know previous fiscal year from the following inputs.
Tel me a suitable conversion routine to calculate
depending on periods and fiscal year.
regards
sivaram.

Hi
U need to check the lower period, if it's 1 the previous fyscal year will be the year before:
IF PERIOD = '1'.
  PREV_YEAR = YEAR - 1.
ENDIF.
U can also use the fm FI_PERIOD_DETERMINE, in this case you need a date, u can get it from lower current period:
Get the first day of the period
BUDAT(4)   = YEAR.
BUDAT+4(2) = PERIDO_LOW.
BUDAT+6(2) = '01'.
Now get the last day of the previous month:
BUDAT = BUDAT - 1.
Use this date to get its period by fm FI_PERIOD_DETERMINE
Max

Similar Messages

  • Function module to derive start and end dates from fiscal year and period.

    Hi,
    I want to know a function module to derive start and end dates from fiscal year and period.
    ie: If I have say fiscal year '2010' and period '07', then the start date of this period would be '01.10.2010'.
    Thanks.
    Moderator Messge: Basic Date questions are not allowed.
    Edited by: kishan P on Oct 18, 2010 4:45 PM

    Hi,
    This is one of my exit that display the calmonth (offset -12). Usefull when I have to retrieve in a KF a complete rolling year depending one calmonth.
    S_VMUCMN is my selection variable
    S_TXTCMN_M12 is my text variable calmonth-12
    S_TXTCMN_M0 is my text variable for selected calmonth.
    WHEN 'S_TXTCMN_M12'.
        IF i_step = '2'.
          LOOP AT i_t_var_range INTO loc_var_range WHERE vnam = 'S_VMUCMN'.
            CLEAR l_s_range.
            " First day of the selected month
            CONCATENATE loc_var_range-low '01' INTO l_calday.
            CALL FUNCTION 'YFRBW_FUM_CAL_DATE_IN_INTERVAL'
              EXPORTING
                date      = l_calday
                months    = 12
                signum    = '-'
              IMPORTING
                calc_date = l_calday.
            l_s_range-low = l_calday+0(6).
            l_s_range-sign = 'I'.
            l_s_range-opt = 'EQ'.
            APPEND l_s_range TO e_t_range.
            EXIT.
          ENDLOOP.
        ENDIF.
    Thus, in KF header you have to put the two text variable to display the complete period.
    Hope it helps,

  • How to get previous month data from current month values

    Hi Experts,
    I have made one universe from BW Query in which Fiscal year period is entered in interval.
    I have made a universe from that and want to develop webI reports on top of that.
    In my webI reports, i have used one cross tab. In Rows section i have added Company Code and in Column section i have used Fiscal Year/Period and in Value section i have added Sales Value. I want this value of previous month.
    Requirement:
    Ex.
                            Feb'09          Mar'09     and so on...
    Comp_code1   Sales of Jan'09         Sales of Feb'0f         and so on....
    I am getting this.
    Ex.
                            Feb'09          Mar'09     and so on...
    Comp_code1   Sales of Feb'09         Sales of Mar'09         and so on....
    I hope i have clear my requirements.
    Please help as soon as possible.
    Thanks in Advance,
    Rishit

    Hi Rishit,
    Follow the below steps to get the desired result.
    Step1: Convert your fiscal year period from char to a date in your database or in your designer however its feasible.
    to_date('substr('009.2009',2)','mm.yyyy')
    you will get the result 01 sep 2009
    Step2: Convert this format to 01/09/2009 by using date functions.
    Step3: Create a Detail associated to the 'date' field (typically your fiscal period).
    Step4: Create a cross tab Like : Rows section should have Company Code and in Column section should have 'date'(created detail) and in Value section should be Sales Value.
    you should get the following result.
    01/02/2009 01/03/2009 and so on...
    Comp_code1 Sales of Feb'09 Sales of Mar'09 and so on....
    Step5: Use the following formula in your Column (date) formula bar.
    =(<date>-1)-DayNumberOfMonth(<date>-1)+1
    You will get the following result:
    01/01/2009 01/02/2009 and so on...
    Comp_code1 Sales of Feb'09 Sales of Mar'09 and so on....
    Format the cell according to your reruirement.
    Let me know if you will get any break in the above steps.
    Regards,
    Swati.

  • How to get previous 2 months from current date in a dropdown?

    Hello Experts ,
                           In the application which I am developing, there is a requirement wherein , I want to Populate current month and previous two month in a drop down depending upon today's date. please help.
    Thanks & Regards,
    Pratbha Shukla

    The internal format for dates is yyyymmdd.  Therefore you can just grab the month value from the date:
    data lv_month type FCMNR.
    lv_month = lv_date+4(2).
    Just subtract from the month to get the two previous.
    data lv_previous1 type FCMNR.
    data lv_previous2 type FCMNR.
    if lv_month = 1.
    lv_previous1 = '12'.
    else.
    lv_previous1 - lv_month - 1.
    endif.
    if lv_previous1 = 1.
    lv_previous2 = '12'.
    else.
    lv_previous2 - lv_previous1 - 1.
    endif.
    Then do your lookup for the month name by reading the table returned from function module MONTH_NAMES_GET.

  • Default previous fiscal year

    In my BEx Query Variable (Fiscal Year), how to create the variable so that it will default previous Fiscal Year, and yet user can still change it.
    Please help, thanks.

    Hi,
    You need to make one customer exit variable on fiscal year.
    Write cmod code in I_STEP 1.So it will by default fill the variable with previous fiscal year.
    If in case user want to change it,then yes they can change it as well.
    Check out this pdf.
    http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/d09d4588-3832-2c10-e185-f778d9dbea85?QuickLink=index&overridelayout=true
    Hope it helps.
    Regards,
    AL
    Edited by: AL1112 on Dec 23, 2011 3:54 AM

  • Depreciation of the Previous Fiscal Year want to post in Current FiscalYear

    I have already posted Depreciation for the year 2008 by using Planned Posting Run (T.code:AFAB)
    After that I have created one Asset Master (T.code: AS01)
    In AS01, Depreciation tab , I have set Depreciation starts from 19.09.2007, i.e. Fiscal year: 2007
    I have capitalised this asset as on 31.03.2008, i.e. Fiscal Year :2008
    Now I want to post Depreciation for the period  19.09.2007 to 31.03.2009 (560 Days) on 31.03.2009.
    When I am running AFAB  (Repeat Run) Fiscal year: 2008 & Period: 12  with this Specific Asset No, then system is calculating Depreciation only for 1 day, i.e. 31.03.2009
      As the Fiscal year:2007 has been closed for Asset module, hence I have opened Fiscal year: 2007 in AA (T.code: OAAQ)
    But after opening the Fiscal year :2007 also, system is  calculating Dep only for one day.
    Please suggest me how will I solve this issue
    Thanks & Regards,
    Suvadip Mukherji

    >
    Amitava Bhattacharyya wrote:
    > Hi,
    >
    > Plz suggest whether the last period of the previous fiscal year can be opened in MM to allow backposting. If it's possible then how?
    >
    >
    >
    > Amitava
    Please check these answered links:
    MMPI
    Opening the Closed Periods using MMPI
    Edited by: Afshad Irani on Jun 15, 2010 3:45 PM

  • For some reason my Itunes deleted my current library and reverted back to a library from 5 years ago! How do I take the music from my Iphone and put it back into my Itunes library?

    For some reason my Itunes deleted my current library and reverted back to a library from 5 years ago! How do I take the music from my Iphone and put it back into my Itunes library?

    backup from old computer and restore to new either to icloud  or an external drive  also check out turingtest2's excellent article on backup using synctoy

  • Variable for budget from starting to previous fiscal year?

    Hi experts,
    The requirement i got in my report to calculate Budget upto previous fiscal year.
    For ex: If my project starts on Nov 2004 , then i want to calculate for the year Nov 2004 to Mar 2008.
    I tried for variable Cumulate to last fiscal yeard

    Hi,
    Here I'm giving the code to get Months based on System date, so you change this code to as per your requirement.And if any use input variable is there then you need to use ....
    LOOP AT i_t_var_range INTO loc_var_range WHERE vnam = 'ZVARAIBLE'.
    ENDLOOP.
    Note: So by using this variables you need to restrict your Keyfigures with offset values.
    * First Month Of Current Fiscal year comment*
        WHEN 'FMYEAR'.
          CALL FUNCTION 'DATE_TO_PERIOD_CONVERT'
                 EXPORTING
                   i_date               = sy-datum
    *         I_MONMIT             = 00
                   i_periv              = 'V3'
                IMPORTING
                  e_buper              =  zbuper
                  e_gjahr              =  zbdatj.
          CLEAR: l_s_range.
          l_s_range-low+4(2) = '04'.
          l_s_range-low+0(4) = zbdatj.
          l_s_range-sign = 'I'.
          l_s_range-opt = 'EQ'.
          APPEND l_s_range TO e_t_range.
    * Last Month of Current Fiscal year*
        WHEN 'LMYEAR'.
          CALL FUNCTION 'DATE_TO_PERIOD_CONVERT'
                 EXPORTING
                   i_date               = sy-datum
    *         I_MONMIT             = 00
                   i_periv              = 'V3'
                IMPORTING
                  e_buper              =  zbuper
                  e_gjahr              =  zbdatj.
          CLEAR: l_s_range.
          l_s_range-low+4(2) = '03'.
          l_s_range-low+0(4) = zbdatj + 1.
          l_s_range-sign = 'I'.
          l_s_range-opt = 'EQ'.
          APPEND l_s_range TO e_t_range.
    Thanks
    Reddy

  • Current fiscal year and previous fiscal year restriction in Query  Customer

    Hi ,
    My requirment is disply current year qtrs and previous year qtrs in the report . User will not enter year , date , month or qtr . system should calucualte and disply curremt year qtrs and previous year qtrs .
    I have created ZFISCYEAR reference of a 0FISYEAR year . now I would like to write customer exit for Current fiscal year and previous fiscal year to display current year qtrs and previous year qtrs.
    Could you please provide customer exit code if you have or recomend if you know any other options.
    Appriciate you help
    Thanks

    hi try this
    take into account that I don't know th periv you use could be K4 or one defined by you so I have commented it.
    The coding here is for the current fiscal period for the previous year just to another l_year varibale and populate with offset for instance l_year = l_year - 1.
    so for current year
    WHEN 'CURRPERIOD'.
        current_date = sy-datum.
        CALL FUNCTION 'DATE_TO_PERIOD_CONVERT'
          EXPORTING
            i_date  = current_date
        '    i_periv = ''
          IMPORTING
         '   e_buper = l_period.
            e_gjahr = l_year.
        l_s_range-low = l_year.
        l_s_range-sign = 'I'.
        l_s_range-opt = 'EQ'.
        APPEND l_s_range TO e_t_range.
    for previous period
    WHEN 'PREVPERIOD'.
        current_date = sy-datum.
        CALL FUNCTION 'DATE_TO_PERIOD_CONVERT'
          EXPORTING
            i_date  = current_date
        '    i_periv = ''
          IMPORTING
         '   e_buper = l_period.
            e_gjahr = l_year.
        l_year = l_year - 1.
        l_s_range-low = l_year.
        l_s_range-sign = 'I'.
        l_s_range-opt = 'EQ'.
        APPEND l_s_range TO e_t_range.
    bye
    Boujema

  • How to set the fiscal year period as default in variables

    Hi All,
    How to set the fiscal year period as default it shoud take previous period when the report is executed.
    And also I need to do the same changes in reporting agent.
    Could you please any one help me.
    Points will be given.
    Thanks!
    Best regards,
    Ajay.

    Hi Ajay,
    Create a customer exit variable.Write the code in the include 'zxrsru01' using system date.
    take the system date from the system date variable and using that you can get the current fiscal year period.use this value and using string commands, you can get period.
    subtract 1 from this value.Using this you can get the previous fiscal period..
    Please let us know, if you need the coding part
    Hope it helps
    Thanks,
    Teja

  • Carrying forward the parked documents of previous fiscal year

    Hi Experts,
    My requirement is to carry-forward the parked documents of the previous fiscal year to the new fiscal year automatically with a background job that should run at the end of each fiscal year.
    This job should check all the documents that are still parked and must carry them to the next fiscal year. As per standard SAP, the document should be manually posted with posting date of the new fiscal year. Then the system will create a new Document in the new fiscal year, deleting the old document. I need to automate this process.
    For posting a document we use a Customized Workflow (Z copy of FIPP).
    My question is, how can I go about this requirement? What all needs to be done if I want to trigger the workflow in the background on a particular day?
    Thanks!

    Sheryl,
    If you really want to "remove/cancel" the parked documents, then your solution is to delete them as Prashant previously suggested.  Transaction FBV0 allows you to post or delete a parked document.  Deleting the parked documents does not remove the entire document from the system.  It will remove any line item information, but it will leave the header information.  With the header information, you will still have record of the document numbers for audit purposes.  The status on the header will show "parked document which was deleted".  Deletion is the standard SAP solution to "remove/cancel" parked documents - the only alternative to deleting a parked document is to post it.
    Park a document on your test system then delete it so you can see the results.  You will still be able to pull up the header information in FB03.
    I am not aware of any standard SAP reports for listing parked documents that were deleted.  However, if you require such a report, you could create a simple SQ01 query against table BKPF.  You would want to include the Document status field (BSTAT) in the query selection criteria so you can select documents with a status of 'Z' - parked document which was deleted.
    Regards,
    Shannon

  • Amount for previous fiscal years?

    Dear Bwers,
    I have a query with  a KF Amount that is based on a filter on date field ( with a variable to and from date). Now in my query i want to display columns for Amounts from previous three fiscal years (FY(-1), FY(-2), and FY(-3)) based on the date (to and from date) that the user enters in the initial run of the query.How can i do this? Any help would be appreciated.
    Thanks
    Raj

    steps:
    1) Create one structure in column.
    2) Create 1st selection in Column, put fiscal year and your kf from left side to right, and restrict your fiscal year with some variable.
    3) Create 2nd Selection and follow the same process as step1, just when you will restrict ur variable for fiscal year in restrict window, right click on it, and select offset, and assign -1 to it. It will take fiscal year value as Fiscal Year value wihch user will enter in selected variable -1. Like if user enetered 2006, this column will show output for 2005.
    4) Similarly create selectiosn with different offset values, like for 2004 put offset value as -2...and so on.
    Let me know if u need more help?

  • Return current period based off of current fiscal year and date

    Good Afternoon,
    Is there a way in the webi that I can create a dimension that always reflects the current Fiscal Month based of Fiscal year and date? I have a report that I am trying to show sales for a customer based off the current fiscal month. I would like this report when refreshed to be based off this fiscal month dimension instead of showing each fiscal month or changing it manually. What is the best way to do this?
    I have attached an image that shows current numbers by period (month) and then the YTD Totals. I would like to have my 'Period' column always reflect the current period and the Total column to reflect that months totals based off the period column. So for this period (3), instead of seeing 3 lines for each month I would just see the '3' and the total as $541,310.46, monthly as 412,502.09 and my YTD as 1,080,091.06.
    Any help is always appreciated!
    Thank you,
    Tiffany

    Hi,
    Create a variable
    FlagVar=If([Period]=Max([Period]) In Report;"Show";"Hide")
    And apply block filter of FlagVar=Show
    Are these coming TotalSales  MonthlyGoal YTDSales directly from universe? If they are calculated at report level then you might want to use NoFilter. like =NoFilter([YTDSales])

  • Previous fiscal year's  document Gap

    Hi Experts:
    My customer encountered the following issue:
    There is FI document Gap in the previous fiscal year. The end user entered a FI document through transaction FB05, and after saving noted down the document number. But after that, when they try to check this document, it can not be found by the system, nor does it exist in BKPF, BKPF shows that this one document number was skipped. Unfortunately, this issue was not solved timely. We doubt that this gap is caused by update error, since the customer has not done any customer enhancement in this document posting process. However, this issue happened last year so that the update log does not exist anymore.
    Now the customer's auditing team is asking for evidence which can prove that this gap is caused by system. How could this be achieved?
    Thank you so much!

    Hi Yucen,
    Please check the below OSS note( Knowledge base article)
    1828201 - Missing document numbers for accounting documents ( This note it self SAP is given  reasons for the missing documents also mentioned concerns of auditors)
    RFVBER00 ( Report to show update termination , fail documents by system)
    Regards,
    Chandra sekhar

  • How to configure shortend fiscal year

    Hi friends
        plz tell me configure of shortend fiscal year
    urgent

    Hello Kavitha,
    Background- A shortened fiscal year results when you change from a normal fiscal year to a non-calendar fiscal year, or the other way around. This type of change might be necessary, for instance, if an enterprise becomes part of a new corporate group.
    Features:The R/3 Financial Accounting component fully supports the use of shortened fiscal years. However, there are still some points to consider from the perspective of Asset Accounting when you use a shortened fiscal year.
    Configuration: Define the length of the shortened fiscal year and the distribution of the periods in the shortened fiscal year. (Refer to  Shortened Fiscal Years).
    Determine the rules for reducing depreciation for the individual depreciation types and depreciation areas. This is done in FI-AA Customizing: Valuation->Fiscal Year-> Shortened Fiscal Year).
    If the current fiscal year was changed to a shortened fiscal year, start the program for recalculating depreciation (under Tools).
    Hope I had beena ble to help you. please assign points.
    Rgds
    Manish

Maybe you are looking for

  • Audigy 2 driver prob

    Got this huge problem with the drivers for my audigy 2 card. Just formatted my dri've, clean WinXP install and threw in the latest drivers from this page (includes creative audio console). My problem, I get seriously crappy sound from my center speak

  • Document Template queries

    Hi all, I've got a couple of questions regarding document templates: 1. How can we move templates between clients in the same system. I have added the template to a transport in SPRO and tried to SCC1 the template into another client. This does not w

  • How to read emails in ipad without going through the same emails in macbook

    As above... please advise...

  • Filereader can't find file in servlet

    I've got a working Java class that uses Filereader to read a file. The class works when run as a program from the command line. But when I use the class as a JavaBean in a servlet, it can't find the file, and I've tried using both relative filenames

  • Option to change WBS master data

    Hi, Our Client has customized program to upload WBS master data.At present when we upload & create, WBS elements are getting locked (AALK) automatically. But Client don't want this to happen. They want as & when they use upload program or change the