Query Fiscal Periods as numbers

Hi Experts,
I need to calculate de difference between two fiscal periods. As simple as that. So I created two formula variables for this.
Variable1
- Type: Formula
- Processing: Replacement path
- Ref.Char: 0FISCPER
- Replace with: Variable
- Variable: ZPERIOD (user input)
- Replace with: Key
- Currency/Unit: Number
Variable2
- Type: Formula
- Processing: Replacement path
- Ref.Char: 0MATERIAL__ZLNCHDATE (ZLNCHDATE was created with reference to 0FISCPER)
- Replace with: InfoObject
- Replace with: Key
- Currency/Unit: Number
But when I use the values in a formula to calculate de difference Variable1 - Variable 2 the fiscal periods are being interpreted as numbers, such as: 2011012 - 2009008 = 2004. Even when I display the variables in the report it is presenting 2.011.012 and 2.009.008 respectivelly.
I already tried to change variables Currency/Unit to 'Date' but it comes with '00.00.0000'.
Also I already tried with and without 0FISCVARNT = 'K4' in the query with no success.
Any suggestions?
Regards,

Hi Marcelo,
This is in ABAP, convert to your BEx requirement.
REPORT  YBW_FISCPER_DIFF.
data: fisp1 type /BI0/OIFISCPER,
      y1(4) type n,
      p1(3) type n,
      fisp2 type /BI0/OIFISCPER,
      y2(4) type n,
      p2(3) type n,
      y3(4) type n,
      p3(3) type n,
      fisp3 type /BI0/OIFISCPER.
fisp1 = '2011012'.
y1 = fisp1+0(4).
p1 = fisp1+4(3).
fisp2 = '2009008'.
y2 = fisp2+0(4).
p2 = fisp2+4(3).
y3 = y1 - y2.
p3 = p1 - p2.
CONCATENATE y3 p3 into fisp3.
write: 'fisp1 =', fisp1,
      /'   y1 =', y1,
      /'   p1 =', p1.
write / .
write: 'fisp2 =', fisp2,
      /'   y2 =', y2,
      /'   p2 =', p2.
write / .
write: '   y3 =', y3,
      /'   p3 =', p3,
      /'fisp3 =', fisp3.
Result of this is below:
fisp1 = 012/2011
   y1 = 2011
   p1 = 012
fisp2 = 008/2009
   y2 = 2009
   p2 = 008
   y3 = 0002
   p3 = 004
fisp3 = 004/0002

Similar Messages

  • Using fiscal period and Fiscal quarter reporting seemlessly in a BI Query

    Hi,
    We have a very specific issue. Reporting the Fiscal Period( in our
    case we have 53 fiscal periods) and Fiscal Quarter( we have 4 quarters)
    in the same query seamlessly as we would have done using Calander Month
    and Calander quarter in other reports that uses SAP delivered standard
    time dimensions.
    However unlike the Calander time dimension (SAP provided all
    possible...0CALDAY, 0CALWEEK, 0CALMONTH, 0CALQUARTER, 0CALYEAR) where you have all of these inside your info provider, you can get
    aggregation on week, month, quarter etc in your query seamlessly, The Fiscal Year/Period offers a problem in doing report seamlessly.
    When we delve into Fiscal realm, SAP only provided with 0FISCVARNT,
    0FISCPER, 0FISCYEAR and a special period 0FISCPER3. It doesn't provide
    anything like 0FISCQUARTER etc and rightly so, because you can have
    only one 0FISCVARNT in the Time dimension and can have related periods
    (0FISCPER) only for a Row of data in your infocube. For example if you need to model as per the Fiscalweek, you can create a custom Fiscal year variant (Say z1) and can configure to have only 53 periods (Mapped to 0FISCPER) representing
    53 Fiscal WEEK. Similarly for mapping Fiscal Quarter you can create
    another fiscal year variant (Say Z2) and have only 4 periods (mapped to
    0FISCPER also in this case) to represent the 4 Fiscal Quarter. However
    the issue is that for one record you can only map either of those and
    not both since you can only have one Fiscal year variant in one row of
    data in the info provider.
    For example
    If I have two rows OF DATA coming from different sources (One FOR
    Fiscal Week and another for Fiscal Quarter) I can have the following in
    my info provider.
    1> Example data in Fiscal
    Char1 Char2 0CALDAY 0FISCVARNT 0FISCPER Quantity
    X  ......  y .....10/22/07 ....Z1 ....           43’2007 .......10
    X .......  Y .....10/22/07 ....Z2 ....          Q3’2007 .......20
    The issue is how do I report the Quantity in a query in Quarter Q3 as
    (10 + 20 = 30) since both the rows corresponds to FISCAL Q3’2007?
    (Please note that Fiscal week 43’2007(For VARIANT Z1 ) actually is
    Fiscal Quarter Q3’2007( For Fiscal Variant Z2) as per our
    configuration of Fiscal Year Variant configuration Z1 and Z2)
    The same is very simple when I have infoprovider with CALENDAR Time
    dimensions , for example if we don’t have any fiscal reporting
    requirement and just report on calendar time dimension the record in
    the info provider would look like the following ( example)
    2> Example Data in CALENDAR DIMENSION
    Char1 Char2 0CALDAY 0CALWEEK 0CALQUARTER Quantity
    X ........ y .......10/22/07 .......43’2007 .......Q3’2007 .......10
    X ........Y .......10/22/07 ....... 44’2007 .......Q3’2007 .......20
    Here we can use both 0CALQUARTER and get the data aggregated on the
    quarter level in addition to the 0CALWEEK.
    To solve this issue, One option that we are thinking of Using 0CALQUARTER to represent the
    Fiscal Quarter and use Update rule to populate this one. For example
    THE example 1 can be as follows.
    1A> Example of using 0CALQUARTER along with 0FISCVARNT and 0FISCPER
    Char1 Char2 0CALDAY 0FISCVARNT 0FISCPER 0CALQUARTERE Quantity
    X .......y .......10/22/07 ..............Z1 .......43’2007 .......Q3’2007 ..............10
    X .......Y .......10/22/07 ..............Z2 .......Q3’2007 .......Q3’2007 ..............20
    In this case we would populate the 0CALQUARTER by the actual Fiscal
    Quarter and then can use both as per example 2 above. But this is not a
    smooth option since we have various other info providers to join and
    report based on solely Fiscal Quarter etc…
    I am certain that this issue have already been solved by somebody as this bound to happen in any finance application.
    Would appreciate if we can get some light on this regarding the data modelling, reporting etc.
    Thanks
    Arun G.

    You have yourself suggested a solution, which is fine,
    Other option is to have a new characteristic Fiscal Qtr in all the infoproviders ans update the same using a routine in the updaterule depending on the fiscal year variant.
    for eg. for transaction with variant Z1 in one case you can say if fiscal week 01 between 01 to 13 the Fiscal Qtr should be update with1 and if it is between 14 to 26 then update fiscal qtr with 2 and so on.
    For other Variants Z2 you write a different login in the routine ans so on.
    so for all the data irrespective of the variant you will have the qtr as either 1 or 2 or 3 or 4 and you can report on this fiscal qtr.
    assign points if it helps.
    regards
    Venkata Devaraj

  • Issue creating planning query on cube partitioned by fiscal period

    I have a cube that is partitioned by fiscal period (0FISCPER).  This requires that there is a constant value for fiscal year variant (0FISCVARNT).  When I try to create an agg level on this cube 0FISCVARNT is automatically pulled into the agg level.  However, because 0FISCVARNT is set to a constant value it is not available in query designer to add into a planning query...as such, I cannot create a planning query on this cube.
    I can repartition the cube (i.e. remove the partitioning), but does anyone know of any other work arounds?
    Thanks.

    We resolved this.

  • Single Query with multiple fiscal variants / fiscal period

    Experts,
    Currently we have two different queries 1) for US and 2) for Mexico.
    Both the queries are hard-coded with respective company codes and different fiscal variants. We have i step =1 variable, so in both query we have respective fiscal period by default in variable screen.  The user can decide to run the query for current fiscal period or manually overwrite it for past few fiscal periods.
    Now, we want to consolidate two queries into a single one and behind the scene depending on company code entered by user we want the query to run for default period AND we also want user to have liberty to change it for different fiscal periods (similar to istep 1 variable) which is hard coded for each query. Please advice how to proceed?
    Thanks!

    Hi Durgesh,
    I agree with part 1- we can let user select his company code, but my challenge is pre-populate or get the default fiscal period for different company codes.
    2) You can keep rest of the things as it is, because you will be populating the default period value and if user want he can select the required value manually.
    (Alok) =  So if user runs report in Nov'2011 = the US fiscal period is 002/2012; but for Mexico it might be 011/2011 - so is there any way where we can give this value in prompt screen and at the same time not let user remember these values...
    Since with single query and without hardcoding how to determine the current fiscal period for different company codes?

  • Restrict Query to Year To Last Fiscal Period

    I have written a query that reports on Cost Centre line Item data. Up until now I had been using the variable 0I_CYFTD Year To Date for current fiscal year. However I now want to only report Year to then end of the last fiscal period. Anybody any idea how I would do this? The only way I can think of is to create my own variable with a customer exit. If that's the case where does the code go and what's the code involved as I'm no ABAP'er. Or is there another simpler way.

    Hi Joel
    You will probably need some abap code in here eventually,
    but could you not use the Previous Period Of Current Fiscal Year (OP_PRFP1) SAP exit.
    Eg. Create a range from 01.2008 to OP_PRFP1 as part of your key figure.
    Regards
    Nick

  • Option to show values up to last closed fiscal period or up to current date

    Hello,
    How would I create a query that would ask if I want it to calculate values 'up to the current date' or for the 'latest closed fiscal period'.
    Currently I have setup a report, within which, has restricted key figures that will give the 'Period to date', 'Year to Date', and 'Last Year Year to Date' values for some RKFs, however, it would be very helpful if this report could be setup so that the user could choose whether the report provides:
    1. Values only through the last closed fiscal period
    or
    2. Values up to the current date.
    <b>For example</b> if we are in period 7 of 2006, the user could have the report show all values up to the last closed fiscal period, which in this case would be period 6 of 2006.
    Or the user could have the report show all the values up to the current date.
    Hopefully I have been clear,
    Thanks,
    Nick
    Message was edited by:
            Nick Bertz

    Nick,
        What is the problem you are facing? As San mentioned you can only report till Last Fiscal Period using Customer Exit Variables(Calculate Current Fiscal Period using Current Month and Fiscal Year Variant).
    Or as you mentioned you can create restricted Key Figures using Date or month (YTD etc)
    If i miss your requirement, please guide me.
    Regards,
    Nagesh Ganisetti.
    *Assign Points if it helps.

  • Last Closed Fiscal Period

    Hi All
    How can I identify the Last Closed Fiscal Period in a query variable ?
    eg. The current calendar month is Feb which is Fiscal period 11 (Variant is Z3). However Finance still have January open so they want to report YTD figures up to and including December (Fiscal periopd 9).
    I have created a user exit variable (with help from SDN) that works out the YTD range for the fiscal periods but it uses system date to calculate current period. Therefore, the current fiscal period is coming out at 11 but I need 9. When the Month End occurs on Friday the current fiscal month should become 10.
    All help appreciated.
    Asif

    Hi Surender
    I need a variable that does not have any user interaction, and will determine the range of periods that constitute the current fiscal year. The range should start at 1 and end at the last closed fiscal period as maitained on R3.
    I have decided to bite the bullet extract the table T100B from R3. It contains details on all open periods.
    I am trying to load it as master data. Its the first tme I have done this type of work so taking some time.
    I have created the extractor and a characteristic with attributes to hold this info. I then plan to read this data in the variable to work out the range.
    If there is a simpler way to do this then please advise.
    Regards
    Asif

  • Problem with BI-IP and Offsets in Fiscal Period/Year

    Hi freinds,
    I got a request that is linked to BI-IP and Query design.
    The request is that the users should always see a complete year by Fiscal Periods (001.2010...012.2010).
    Now the BI-IP should be dynamic. This means in 007.2010 the user should plan 008.2010...012.2010, the previous month are supposed to be the actuals.
    Problem: I do not want to change the query each month in order to move the planning month. I tried to use an offset with 11 month actuals. Saying "current month/Year", -1,-2,...,-11 using 11 restricted key figures. Same I did for the planning month. I now limited the Data to 2010 in the filter and anywhere I could. However, the result columns are showing all 22 Month. 001.2010...007.2010 are the only once which carry data. all other columns are empty.
    I just do not want to see the columns that do not belong to the current year.
    Any ideas or How to's I can use?
    Thanx and best regards
    Joerg

    Sorry, but I can't imagine how that should work.
    I have two Cubes combined under a Multicube. One containing the Actuals and one for the Forecasts. To show the actuals I have to create a restricted key figure that shows the actuals and for the forecast I have to select differently.
    What is the exit variable supposed to do? I could use a SAP Provided variable to find out about the first month and the actual month, but since it will be a restricted keyfigure it will be shown as sum between the two month. I need for each month of the year a column, and the "open" Month should be input ready. And this should be dynamic.
    Thanks for helping
    Joerg

  • Defining an exit variable for a specific day based on Fiscal Period

    If I do not have Calendar Day time dimension available for reporting is it possible to define a customer exit variable for a specific day.  The days are the first and last day of the financial year?
    Example
    User Input for Fiscal Period: 2009004
    The exit is to define a value for 01.01.2009 and 31.12.2008 (end of last year)
    Thanks

    Hello Niten,
    yes it is possible. Procedure:
    - add a new column in the report structure
    - hide this column
    - create a new text variable in this column (for customer exit)
    - now you can fill this variable during query execution based on 0FISCPER
    You don't want to filter by this variable. Right?
    Buy,
    André

  • How to Create Dynamic Columns based on Fiscal Period

    HI BI World;) We are on BI &.0
    I have a requirement to create a time series BI query
    It must take the variable value (range) from the user abd create all months within this range in a time series displaying the key figure value for the respective periods.
    I have so far added the fiscal year period characteristic  to the columns with the key figure under this and the fiscal/year period is on a restiction in the filter area by a variable (range)
    When I run this query it only shows the fiscal periods which have a value for the key figure. Is it possible to show all fiscal periods and have blank columns where there is no value for the respective key figure/period.
    I have tried using master data for the fiscal period but this does not work as has some junk values.
    Any ideas? I need to show alll periods between the dates whether they have values or not.
    Best,
    Stevo
    Points will be awarded.
    Thanks in advance

    Hi,
    Try restricting the fiscal period inside the keyfigure and in the output format try drill across of fiscal period.
    in tne fical period char properties try masterdata relationship option.
    Thanks,
    Arun.

  • Quarter, halfyear and more for Fiscal period

    Hi experts,
    i have a query requirement to create the quarter and halfyear of the fiscal period.
    The problem is that our fiscal period does not correspond to the natural year, starting in october.
    I tried to use the standard 0CALQUART1 and 0HALFYEAR1 and doing a map from 0FISCPER in update rules, but as expected, the result was that 010.2005 = 4.
    I need to get a 010.2005 = 1, and if possible to get the year also... but this is another problem.
    Is there any standard rule to get it?
    Thanks a lot for your help
    Ignacio

    hi
    which fiscal variant ur using.
    or else you can go for update routines are Transfer routines to update the infoobjects
    Hope this helps
    Shiva

  • Get Fiscal Period based on Fiscal Year

    Hello Experts,
    I have one query. I wanted to get fiscal period based on fiscal year entered in selection screen.
    I tried to find the FM for it but didn't get it. Can you suggest me any FM which gives in Fiscal period based on fiscal year in FI?
    Regards,
    Neha

    Hi,
    Check the following link:
    How to get fiscal period based on date and Fiscal year?
    http://www.sapdev.co.uk/fmodules/fms_fiscalyr.htm
    Regards,
    Bhaskar

  • Values by fiscal period

    Hi,
    I have a column "Total Cost To Date" which gets all costs per project.
    The actual value should be =Cummilated cost to last month. Say I am running the report in AUG any time the report should get the total cost till July.
    I have used offsetting but does not work and have also used Variable 0FYTLFP but not getting the correct values.
    the report gets only values for July not cummilayed values.
    Please help.
    Thanks
    Niren

    Use 0FPER  variable.
    Assuming you need to display the value till date and not Year till date.
    Create a Restricted Key Figure and select your key figure and the 0FISCPER characteristic.
    Right click on 0FISCPER and select restrict.
    Select value range and Between from the Selection Drop down
    Select Fixed value tab and transfer the lowest Fiscal period (e.g. Period 12 2006) available to the right. So you can see something like []012/2006; 012/2006
    Select Variables tab and drag 0FPER on the second 012/2006 range. So now you can see the value like [ ]012/2006; 0FPER. Right click on that and select Specify variable offsets and select -1.So now the value looks like [ ]012/2006; 0FPER-1.
    Save and execute the query.

  • Fiscal Period and Calmonth issue in SSM 7.0

    In Fiscvar V3 Where Fiscal Year is not from Jan to Dec but April to Mar, PAS not reading Fiscal Period correctly.
    Workaround suggested is to Create BWFISCPERINFO document in PAS under the model and mention periodicity as
    MONTHLY
    2009001 200904 
    which means ist Fiscal Period of 2009 = 4th Month(april) of 2009.
    The BW Query with oFiscper as Time Dimension is not importing data beyond March 2009 while BW Query
    with 0Calmonth is populating upto current month of July 2009. What could be reason for this anaomaly in data import ?
    M Akhtar

    Good day M Akhtar,
    I would suggest rechecking your BW Query with oFiscper to make sure that you have set the fiscal period to start in March and not set the data to be imported to only be March. It may be that your current settings are only bringing in the data for March.
    Regards,
    Bob

  • Reg Fiscal Period

    Hi Everyone,
    How to get the current Fiscal Period from System Initialization->General Settings in a query
    The information is stored in OFPR table. But how do i know which is the current set Fiscal Period?
    Thanks,
    Vinoth

    Hi,
    You can try to work out the current period based on todays date but the best way is to pick up the current period using a variable.
    If you save this query and run it with a form open then you will get the current period returned:
    SELECT T0.\[Name\] FROM OFPR T0 WHERE T0.\[AbsEntry\] = $\[PERIOD\]
    Regards,
    Adrian

Maybe you are looking for

  • In Purchase Order Line item Maintaining Serial Numbers for Material Codes

    Dear Gurus, We have a business process in legacy system for Purchase Order like in PO line item, Material code with description, Quantity, unit of Measurement, Serial Number Start and Serial Number End is maintained, for example for Material code whe

  • Screen exits - Urgent.

    Hi, I am working on screen exits for VA01. Can someone tell me how to add table control in a sub screeen at item level in additional data B ?

  • Async process

    hi, i have a question. if u have a async process then u send several request and u may or may not receive response immediately. Then, how can soa infrastructure relate - whenever the response does come "Which response is meant for which request" ? Ho

  • Apply Model from ESS Repository

    Hi Sapall. as iam new to SAP-PI7.1.1,i just want to know on how i can do the Apply Model From ESS Repository. i have created the Process Integration Scenario in ESR with the all the data type,message type,message mapping,operation mapping but all i w

  • Very confused about ppi, resolution, and image size...

    I have read so much on these things and even posted along these lines here and there, but remain totally confused. Say the size of my pictures is around 2000 x 3000. Once I download them to PSE, the resolution is 72ppi. Is this default and could I/sh