Calculate the current  fiscal quarter based on zero based month index

Hi All,
I need your help to Calculate the current fiscal quarter by adding 1 to a 0 based month index, dividing by 3.0(float or double) and getting the ceiling integer then add one to that number to get the “fiscal” quarter, taking care to loop back to quarter one as necessary.
please help me to get this.
Thank you in Advance.
Ram.

Hi,
933478 wrote:
I need your help to Calculate the current fiscal quarter
The Q datetime format doesn't match your need ?Scott@my11g SQL>select sysdate, to_char(sysdate,'Q') currentQuarter from dual;
SYSDATE             CURRENTQUARTER
10/05/2012 17:35:02 2If your input is the 0-based month, then you could just :Scott@my11g SQL>with monthes as (
  2  select level-1 mon0 from dual connect by level <=12
  3  )
  4  select mon0, to_char(to_date(mon0+1,'mm'),'Q') quarter from monthes;
      MON0 QUARTER
         0 1
         1 1
         2 1
         3 2
         4 2
         5 2
         6 3
         7 3
         8 3
         9 4
        10 4
        11 4

Similar Messages

  • How to calculate the Current APC (Acquisition and Production Cost)

    Hi,
    Please help me how to calculate the Current APC.
    The Current APC (Acquisition and Production Cost) is a calculated value based on Previous Year Acquisition balance plus any value changes up to the time of the report.
    The Asset History Report (RAGITT_ALV01) calculates the Current APC value &
    The Current APC can also be found in the Asset Explorer (transaction code AW01N) under Country Book 10/ Posted Values tab then the line “Acquisition Value” and column “Posted values”.
    I suppose that the calculation of Current APC (Acquisition and Production Cost) is getting done in the GET statements in the report RAGITT_ALV01, but unable to find the actual logic.
    Please help me.
    Thanks in advance,
    Satish

    Hi,
    you'll find the logic in fm FI_AA_VALUES_CALCULATE
    A.

  • How to calculate the Current APC

    Hi,
    Please help me how to calculate the Current APC.
    The Current APC (Acquisition and Production Cost) is a calculated value based on Previous Year Acquisition balance plus any value changes up to the time of the report.
    The Asset History Report (RAGITT_ALV01) calculates the Current APC value &
    The Current APC can also be found in the Asset Explorer (transaction code AW01N) under Country Book 10/ Posted Values tab then the line “Acquisition Value” and column “Posted values”. 
    Thanks in advance,
    Satish

    Hi,
    I suppose that the calculation of Current APC (Acquisition and Production Cost) is getting done in the GET statements in the report RAGITT_ALV01, but unable to find the actual logic where it is being done.
    Please help me.
    Thanks in advance,
    Satish

  • Date parameters for the previous fiscal quarter?

    Hello Folks,
    I have this requirement of selecting the dates for the previous fiscal quarter. usually a fiscal quarter is January 2011 - March 2011. But in my case the fiscal year should be December 2010 to February 2011 and if i check in june 2011 it should return Mar 2011 till May 2011 and so forth. So how can i acheive to be able to select these dates i.e 12/1/2010 till 02/28/2011 in the where clause for the current date?
    create table test_A (id int, col varchar(50),change_date date);
    insert into test_A values(1, 'A',to_date('20101201 000000', 'YYYYMMDD HH24MISS'));
    insert into test_A values(2, 'A1',to_date('20110122 000000', 'YYYYMMDD HH24MISS'));
    insert into test_A values(3, 'A1',to_date('20110202 000000', 'YYYYMMDD HH24MISS'));
    insert into test_A values(5, 'A1',to_date('20110306 000000', 'YYYYMMDD HH24MISS'));
    insert into test_A values(6, 'A1',to_date('20110305 000000', 'YYYYMMDD HH24MISS'));
    insert into test_A values(7, 'A1',to_date('20110307 000000', 'YYYYMMDD HH24MISS'));
    select * from test_A
    1     1     A     12/1/2010
    2     2     A1     1/22/2011
    3     3     A1     2/2/2011
    4     5     A1     3/6/2011
    5     6     A1     3/5/2011
    6     7     A1     3/7/2011
    I only want to see the following
    1     1     A     12/1/2010
    2     2     A1     1/22/2011
    3     3     A1     2/2/2011

    select  *
      from  test_A
      where change_date >= add_months(trunc(sysdate,'Q'),-1)
        and change_date <  add_months(trunc(sysdate,'Q'),2)
            ID COL                                                CHANGE_DATE
             1 A                                                  20101201 000000
             2 A1                                                 20110122 000000
             3 A1                                                 20110202 000000
    3 rows selected.
    SQL> SY.

  • How to write customer exit in my BI query to get (current fiscal quarter) and (current fiscal quarter - 1 ) without user input

    Hi all,
    I need your help how to write customer exit in my BI query to get (current fiscal quarter) and (current fiscal quarter - 1 ) without user input.
    in my query info object is 0CALQUARTER and variable is ZFIS_QTR.
    in 0CALQUARTER fiscal quarter stored in 201301,201302,201303,201304 and 201401 format, for current fiscal quarter 201401 and (current fiscal quarter - 1 ) would be 201304.
    please replay ASAP to deliver the report to client.
    thanks in advance.
    -- Rakesh Nagpure

    I am Getting the same error for both the codes that i have written...
    Do i Need to write sth else in the code...
    Code:
    WHEN 'ZVLIVELEASES'.
      IF I_STEP = 2.
            L_DATE = SY-DATUM.
            SELECT * FROM "DSO_ACTIVE_TABLE"
                INTO TABLE ITAB_LL where "EXPIRY_DATE" > L_DATE.
            LOOP AT ITAB_LL INTO WA_LL.
            CLEAR l_s_range.
            l_s_range-sign = 'I'.
            l_s_range-opt = 'EQ'.
            l_s_range-low = WA_LL-"EXPIRY_DATE".
           APPEND L_S_RANGE TO E_T_RANGE.
            ENDLOOP.
       ENDIF.
    Error: Error for variable in customer enhancement ZLIVELEASES

  • Asset write off in the current fiscal year.

    Hi Experts,
    I want to write off an asset in next 4 periods of the current fiscal year 2007. For example:
    Asset 11000
    APC value: 10000
    APC Date: 01.01.2005
    The useful life will end in fiscal year 2008.
    The book value left at the begining of the current fiscal year 2007 Rs. 4000.00
    In the current fiscal year this asset has already been depreciated for previuos 3 periods.
    Now Business wants to write off ( fully depreciated ) this asset in next 4 periods equally and then if the book value and tax value is nil, they want to scap the asset.
    Now can you please tell me how to make this happened. Its very urgent. If you need any more information, most welcome.
    Rgds,
    BABA

    Hi,
        You would have to set the asset to manual depreciation(Depr.Key MANU)
    and generate a posting via ABMA for each of the periods.
    Kind regards

  • To post write up in the current fiscal year

    Hi,
    I am trying to post write up in the current fiscal. However, the system is not allowed to post me. I know that the write-up needs to be posted from the next fiscal year. However, due to the requirement, we need to post in this current and switch off the message.  I have already switched off the message in OBA5, but still, I cannot proceed to post with write-up in the current year. Is there a way that I can post this.
    The following are the error details.
    You cannot post write-ups
    Message no. AA400
    Diagnosis
    According to the transaction type, you have to post to area 01. However, in this area, there is either no accumulated depreciation or the write-up depreciation type(s) are not managed in this area.
    Procedure
    Check the transaction type.
    Regards,
    Ravi

    Hi Ravi,
    A write up can only be carried out if you have cumulated depreciation   values (from previous years). In the current fiscal year depreciation  should be posted the 'normal' way. Write ups mean that too much  depreciation was posted in a previous year and that you will correct  this in the current year. Therefore, the system does not allow posting write ups if there exist no cumulative depreciation values from   previous year. In other words you cannot perform a write up  for an asset in the year of acquisition.                                                                               
    Also make sure that the depreciation area(s) is defined as such to  manage cumulative depreciation type or write-up depreciation type. This  should eliminate the error 'AA400'.                                                                               
    Following is the menu path to take:                                       
    CU: FI-AA
         -> Transactions                     
         - > Define Transaction Types for                                           
             - > post-capitalization (trans. AO77 and OAXD)                          
              -> manual depreciation (trans. AO78 and OAXE)                          
    For both,- select your Chart of Depr.                                      
             - >select your Transaction Type                                    
             -> select Depr. Area Specs.                                        
    Regards Bernhard
    Edited by: Bernhard Kirchner on May 10, 2010 3:00 PM

  • How to Determine the first day of the current Fiscal Year

    I am a SQL Server developer who is trying to to learn Oracle SQL. I am trying to write a query that will 1) determine the month number and if the number is 10, 11, or 12, will return '01-Oct-' of the current Calendar year. If the month number is between 1 and 9, it returns '01- Oct-' of the last Calendar year (YYYY = current Calendar year minus 1 year).
    I was playing with the EXTRACT function to get the year and month, but was unable to formulate the '1-Oct-YYYY' where YYYY is the current or previous calendar year, depending on whether the SYSDATE falls before or after 1-October.
    Could anyone point me to an example of how to do this in Oracle?

    We can use "add_months" B-)
    select column_value,
    extract(year from add_months(column_value,-9)) as y,
    add_months(trunc(add_months(column_value,-9),'yyyy'),9) as oct
    from table(sys.odciDateList(
    date '2009-01-01',date '2009-09-01',
    date '2009-10-01',date '2009-12-01'));
    COLUMN_V     Y  OCT
    09-01-01  2008  08-10-01
    09-09-01  2008  08-10-01
    09-10-01  2009  09-10-01
    09-12-01  2009  09-10-01

  • Adding periods in the current fiscal period

    Hi,
    I need to extend the current financial period which is actually 12 periods to 18 periods.Is it possible in SAP Business One?
    The financial period is already in use in transactions so i am not able to remove it.
    Thks
    Nisha

    Hi
    No you can't change the no. of periods
    Regards

  • Withholding Tax not picking for the current Fiscal year 2014

    Dear Gurus,
    Withholding tax assigned to the vendor is getting picked up for the fiscal year 2013 but when the same vendor is invoiced for year 2014 with the same WHT tax code we could see that there is no tax line getting generated against the Vendor. All the configurations related to WHT are verified. As far as i Know we will not maintain any end date for WHT tax code. request yout to advance.
    Thanks in advance.
    Thanks & Regards
    Srikanth

    hi,
    Please check below mentioned Path - and check date from & to given period
    SPRO- Financial Accounting (New) - Financial Accounting Global Settings (New) -Withholding Tax -Extended Withholding Tax - Company Code -Assign Withholding Tax Types to Company Codes
    select WHT type against Company code -
    W/tax obligated frm 01.04.2010        Oblig.to w/tax until 31.12.2999
    and check vendor master data -
    Thanking you
    Regards
    Mahesh

  • Carry fwd all items to the current fiscal year 2014

    Hi All
    Can someone guide me on the following attached issue?
    The year had ended on June,2014.
    Regards
    Pankaj

    Hi,
    Do you use automatic budget posting? You should check these OSS notes:
    1620682     FMFG_ABP017 for PBET commit.budget on change of PO del.date    
    1170291     Automatic Budget Posting: error message FMFG_ABP017    
    1329638     Message "Wrong Fiscal Year" during Automatic Budget    
    1265858     Message "Wrong Fiscal Year" during Automatic Budget Posting    
    1632145     Automatic Budget Posting: error message FM_FGABP017
    Regards,
    Eli

  • Reports with variables on fiscal year and want to display the current fiscal period values

    Hi
    i wan to display the fiscal periods in one of the reports when i give input for fiscal year, let say i will pass the fiscal year  as 2012 , then i need to display the revenue for 2012.01,2012.02,2012.03,....2012.12 and in another selection i need to restrict the revenue with the previous year.
    how can we achieve that.

    Hi,
    Refer this thread:Same thing has been discussed.
    http://scn.sap.com/thread/3365593
    Regards,
    AL

  • Current calday or fiscal period to fiscal quarter

    Dear Experts,
    Is sy-datum calendar day date or fiscal day date?
    How to derive the fiscal period or quarter from sy-datum?
    Is there a function module to use to convert from current day (either fiscal day or calendar day) to derive the current Fiscal Quarter?
    I am not sure which function module can be used. Unable to find in the forum as well.
    Please could you provide me some clues?
    Thanks.
    Best regards
    Bass

    hi Steve,
    try function module 'UMC_FISCPER_TO_CALQUARTER'.
    following is sample code in transfer rules, in update rules use COMM_STRUCTURE for TRAN_STRUCTURE.
    hope this helps.
    data : l_fiscvar type PERIV,
    l_fiscper type UMC_Y_FISCPER,
    l_quarter like UMC_YS_DIMVALS.
    l_fiscvar = TRAN_STRUCTURE-fiscvarnt.
    (infoobject 0fiscvarnt)
    by default fiscal variant = K4 if not specified
    l_fiscper = TRAN_STRUCTURE-fiscper.
    call function 'UMC_FISCPER_TO_CALQUARTER'
    exporting
    I_PERIV = l_fiscvar
    I_FISCPER = l_fiscper
    importing
    ES_CALQUARTER = l_quarter.
    RESULT = l_quarter.
    ABAP Code Needed to convert Fiscal Period/Year to Quarter
    hope this helps.

  • Var. Exit code for Fiscper of Current Fiscal Year

    Hi Guys,
    I need to create a variable exit to calculate the Current Fiscal Period of Current Fiscal Year. (STrange requirement)
    Can anyone please help me with the sample code?
    Regards

    You can use DATE_TO_PERIOD_CONVERT based on the current date (sy-datum).
    call function 'DATE_TO_PERIOD_CONVERT'
    exporting
    i_date = sy-datum
    i_periv = w_fiscal_year_var
    importing
    e_buper = w_period
    e_gjahr = w_year
    exceptions
    input_false = 1
    t009_notfound = 2
    t009b_notfound = 3
    others = 4.

  • How to get current fiscal year/quarter/month/week

    Post Author: [email protected]
    CA Forum: Semantic Layer and Data Connectivity
    Hi friends,
    I have to calculate
    1. current year/quarter/month/week.
    2.Previous year/quarter/month/week.
    please tell the process to achieve the above scenerio's.
    the structure of the fiscal_cal is as  follows.
    Name                                      Null?    Type
    TODAY                                     NOT NULL DATE
    FISCAL_DAY                                         NUMBER(8)
    FISCAL_WEEK                                        NUMBER(6)
    FISCAL_MONTH                                       NUMBER(6)
    FISCAL_QTR                                         CHAR(18)
    FISCAL_YEAR                                        NUMBER(4)
    FISCAL_MONTH_WORK_DAYS                             NUMBER(2)
    sample week data is as follows
    FISCAL_WEEK
         200752
         200753
         209901
    Thanks.

    based on ur target database DBMS you can find a built-in functions be used in the universe designer to get the requirment you talked about, like in oracle
    to_char(mydate,'yyyy') it will return the year in the yyyy format.
    and the same way for the other things you want
    to_char(mydate,'q') return the quarter.
    w return the week of the month
    ww return the week of the year
    mm return the month
    ,, to get the last year
    you can use also a builtin functions
    like add_months(mydate,-12) that return the same date for the last year, and you can do the same operations as before.
    its all related to the DBMS.
    good luck

Maybe you are looking for

  • How can i test the actual app on my devices?

         First off let me start by saying that i would post on the actual dev forums but it takes forever to get an answer on them. Id also like to point out that im new to the apple dev center and testing apps on my actual device as i just got my dev ac

  • Problems adding sound

    I can't get sound on my page in dreamweaver. I followed the instructions and I keep getting an error telling me that the plugin is not supported. Has anyone had this problem and what did you do to correct it?

  • Attach external documents to SAP

    Hi we are planning to attach external documents to purchase order in ME22N screen. & every month 10gb files I would like to know the below points do we have any limitation for attachment? what potential risks are involved using this functionality? Wi

  • Endless new windows/tabs when downloading/installing new programs

    when I download a new app/program it opens in a never ending new windows or tabs. I have to force quit firefox and use safari

  • WE57 - for inbound transactions, outbound transactions, or both?

    Hello, Can anyone tell me if WE57 is used for inbound transactions only or is it used for both inbound & outboud? It seems in the documentation I have looked at, it states it is only for inbound.  Why, then, when I try to create a new entry in WE57,