Variable Offsets for Weeks

We have a custom created infoobject for fiscal week, which is basically week number within fiscal variant, fiscal year, and fiscal period. So fiscal period 1 contains weeks 1-4, period 2 contains weeks 5-8, etc.
Our problem is in the use of variable offsets in query definitions. If we use 0FISCPER, BEx knows that the "-1 offset" for 2005001 is 2004012, not 2004999. Similarly, for 0CALWEEK, the week before 200501 is 200452, not 200499. So for our custom infoobject, how do tell BEx that the fiscal week before 200501 is 200452? Anyone know how we can set this up?
Thanks in advance for any info you can provide.
Rachel McGregor

Yes, we figured we would probably need to do something in the user exit. We did not create the infoobject with reference to anything else since we added some custom attributes.
What exactly should we do in the user exit? We want to create a structure with a whole bunch of selections for week number, week number-1, week number-2, week number-3, etc. all the way back to week number-104 (i.e. we want 2 years' worth), with a single prompt to the user for week number.
Any suggestions?
Rachel

Similar Messages

  • Problem with variable offset for 0CALMONTH

    Hello Community,
    I have a problem with using variables offset for time characteristic 0CALMONTH
    Let's say my current query looks like this:
    ...................01.2006..........02.2006..........03.2006   (0CALMONTH)
    Sales ..............100..................125................200   (Keyfigure)
    What I want do now is to add a previous year comparison. So that it should look this way:
    ...................01.2006..........02.2006..........03.2006   (0CALMONTH)
    Sales ..............100..................125................200   (selected months)
    LY_Sales...........50..................100................100   (selected months - 12)
    (LY_Sales should show figures of 01.2005, 02.2005 and 03.2006 in this example)
    I used new selection for LY_Sales with variable offset for 0CALMONTH -12 but that didn't work. Figures in second line are zero. The desired figures would show up (if I expand the selected time intervall wide enough) in 01.2005, 02.2005 and 03.2005 but that's of course not what I want.
    Please help if you can!
    Regards,
    Ulrich

    Hi,
    We can get an an other way by using CELL editor caoncept.
    First create teh query like this:
    ...................01.2006..........02.2006........12.2006.....01.2005...02.20005...12.2005  Sales ..............100................125..............200.............50...........100.........100 
    Sales ..............100................125..............200.............50...........100.........100
    Then hide the 2005 years' kf:
    ...................01.2006..........02.2006........12.2006
      Sales ..............100................125..............200 
    Sales ..............100................125..............200
    Though the call editor concept overwrite the second rows(selection) content with hidden columns of second row(selection) one by one .i.e first cell of 2nd row will be overwritten by 13 th cell of second column.similarly second cell of 2nd row will be overwritten by 14 th cell of second column........
    First row(selection) : Cal year Charactertic with restriction 2006.
    second row(selection) : Cal year Charactertic with restriction 2005.
    With rgds,
    Anil Kumar Sharma .P

  • Variable Offset for Customer Exit??

    Hi,
    is it possible to have a variable offset for customer exit time variables?
    E.g. I have a variable current month but can I also create a one-year offset of that?
    In our system that doesn't work (but also the current month variable doesn't work...)
    thanks
    Sabine

    Hi,
    As it is mentioned by Mr.Voodi,it definately works.
    You only has given the answer for your problem .i.e you need to make sure the Customer exit variable is working proper.So take a look on the code used for it.
    With rgds,
    Anil Kumar Sharma .P

  • Variable offset for date - a year ago

    I have this sales report with the following columns:
    1. Current Day Sales
    2. Month to Date Sales (this Year)
    3. Month to Date Sales (last Year)
    I'm using a range variable for 0CALDAY for column 2 (Month to Date Sales this year).  i'm having problem with column 3.  how is it possible such that the date is automatically assigned to last year's values?  using offset would mean -365, however, this may not work during leap years?
    please help

    Hi,
    Refer the 'Examples for using Variables' in 'Bex Query designer' of sap help..
    Examples for Offset Variables
    You want to use a query to carry out a comparison of two years.
    Year Comparison
    You want to compare the costs of a year of your choice with the costs of the previous year.
           1.      In the Query Designer, create a new structure and add a new Selection for each year that you require.
           2.      Only use one key figure (for example revenue) in this example query. Add this key figure to the filter or add it to the selection.
           3.      Use a characteristic value variable for the characteristic Calendar Year (0CALYEAR):
    Select the characteristic value variables for Calendar Year and, from the context menu (right mouse click), choose New Variables. The Variables Wizard appears.
    If you always want to reference to the current year automatically, use the SAP Exit variable 0CALYEAR (or as appropriate for another time characteristic).
           4.      Move the defined characteristic value variable into the selection.
           5.      Select the characteristic value variable and from the context menu (right mouse click), choose Restrict.
                                a.      Select the characteristic value variable and from the context menu, choose Enter Variable Offsets.
                                b.      Enter –1 as the offset and choose OK.
           6.      Choose OK.
           7.      Enter a description.
    Example: Use the name of the key figure, for example, revenue, for the name and use a text variable for the name of the calendar year. See Using Text Variables.
    When creating a new text variable, enter Replacement Path as the processing type, and choose calendar year 0CALYEAR as the characteristic with display as key.
           8.      Create a second selection with the same characteristic value variable and do not set an offset here.
    Also use a text variable in the description in this case.
           9.      Move the required characteristic into the rows.
       10.      Save the query.
    After execution, the query should appear as follows:
    Variable screen entry: 2002 (or no entry when using the SAP Exit Variable).
    Year Comparison
    A characteristic
    Revenue 2001
    Revenue 2002
    Value 1
    100.000
      90.000
    Value 2
    200.000
    180.000
    Value 3
    300.000
    400.000
    Comparison with Cumulative Previous Year Period
    For example: You want to compare the periods 1-8 of a particular year with the same periods for the previous year.
           1.      Create a new structure in the Query Designer and add a new Selection.
           2.      Move a key figure, for example, Revenue, into the selection.
           3.      Use a characteristic value variable for the characteristic Fiscal Year/Period (0FISCPER):
    Select the characteristic value variables for Fiscal Year/Period and from the context menu, choose New Variable. The Variables Wizard appears.
    Use the SAP Exit variable Current Fiscal Year/Period (0FPER) if you always want to reference to the current year.  If you set the variable as entry-ready in the Variable Editor, after executing the query, the variable screen then appears with which you can change the default values were necessary.
           4.      Move the characteristic value variable, such as OFPER, into the selection.
           5.      Select the characteristic value variable and from the context menu (right mouse click), choose Restrict.
           6.      Under Selection, choose Value Area and choose the tab page Variables.
           7.      Add the characteristic value variable, for example 0FPER, to the selection once again for the second value of the interval.
           8.      Select the characteristic value variable and from the context menu, choose Enter Variable Offsets.
                                a.      As an offset, enter -3 as the from value and 0 as the to value. Choose OK.
                                b.      Choose OK.
           9.      Enter a description, such as Revenue for current year.
       10.      Choose OK.
       11.      Select the selection and from the context menu, choose Copy and then Paste.
       12.      Now select the second selection and from the context menu, choose Edit.
       13.      Select the characteristic value variable and from the context menu (right mouse click), choose Restrict.
       14.      Select the characteristic value variable again and from the context menu (the right hand button), choose Enter Variable Offsets.
                                a.      As an offset, enter -15 as the from value and -12 as the to value. Choose OK.
                                b.      Choose OK.
       15.      Enter a description, for example Revenue for previous year.
    Also use a text variable in the description in this case.
       16.      Choose OK.
       17.      Move the required characteristic into the rows.
       18.      Save the query.
    After execution, the query should appear as follows:
    Variable screen entry: 01. 2002 to 08. 2002
    Comparison with Cumulative Previous Year Period
    A characteristic
    Revenue 01. – 08. 2001
    Revenue 01. – 08. 2002
    Value 1
    100.000
      90.000
    Value 2
    200.000
    180.000
    Value 3
    300.000
    400.000
    Two text variables replaced with characteristic values were used for the descriptions here. One is filled with the from-value for the column with an offset of 0 and a length of 3, the other filled with the to-value with an offset of 0 and a length of 7. You can find additional information under Example for Variable Replacement.
    Comparison of Cumulated Values for Two Years
    You may want to compare the cumulated values up to the current period of the current year with those of the previous year.
    For this example, use the variable 0FPER (current fiscal year period) and the variable 0P_FPER (your chosen fiscal year period). You use these two variables to set the interval limits.
           1.      In the Query Designer, create a structure with two selections:
    ¡        1. selection: Cumulative Amount for current year
    ¡        2. selection: Cumulative amount for previous year
           2.      With the first selection (cumulative amount for current year) , move the time characteristic 0FISCPER into the selection and select it.
           3.      Choose Restrict from the context menu (right mouse click).
           4.      Choose Value Area between as the selection and go to the tab page Variables.
           5.      Double click to choose the variable 0P_FPER as the from value and variable 0FPER as the to value. The result is an interval from the chosen period to the current period.
           6.      Define the second selection (cumulative amount for previous year) and proceed as for the first selection.
    ¡        Add the variable 0P_FPER as the from value and variable 0FPER as the to value here.
    ¡        Set an offset of –12 for both the from and the to values:
    Select the interval and from the context menu (right click), choose Enter Variable Offsets. Enter –12 for each.
    The result is an interval that has been moved 12 periods ahead.
           7.      Add the key figures and additional characteristics for the query.
    After executing the query, you get a variable screen for the variable 0P_FPER. You need to enter the start period in the current fiscal year.
    You can also suppress this entry by deactivating the indicator Entry-ready in the Variable Editor for the variable 0P_FPER and entering a default value (for example, 001.2001 for 2001). You only have to change this value once per year.
    You have now defined a query that compares the cumulative values for two years.
    The variables with SAP Exit delivered by SAP have the following behaviors:
    Variable 0FPER (current fiscal year period): Displays the values of the current fiscal year period.
    Variable 0P_FPER (any fiscal year period): Displays the values of any fiscal year period. You can set the fiscal year period in the variable screen when executing the query in any way you require.
    Variable 0FYTCFP (fiscal year up to current fiscal year period): Displays the values of the first period up to the current period of the current fiscal year.
    Variable 0FYTLFP (fiscal year up to previous fiscal year period): Displays the values of the first period up to the previous period (current period –1).
    You need to use the variables 0FPER and 0P_FPER in the above example for the comparison of cumulative values for two years.  When using the variables 0FYTCFP and 0FYTLFP, only values for one month are displayed for year transitions with an offset of –12.
    Regards,
    Prema

  • Variable Offset for Fiscal Year Not Working

    Hello,
    My fiscal year variable offsets are not working. I have an input-ready query setup with 3 restricted key figures.
    1) Restricted by FY Variable 0P_FYEAR, 0VTYPE = 20, KF = 0QUANTITY
    2) Restricted by FY Variable 0P_FYEAR (variable offset -1), 0VTYPE = 20, KF =0QUANTITY
    3) Restricted by FY Variable 0P_FYEAR (Variable offset -2), 0VTYPE = 10, KF= 0QUANTITY
    I have in my filter selections Fiscal Year Variant = K4
    Rows have 0STKEYFIG
    Columns have 0FISCPER3 (Posting Period) and the 3 Restricted Key Figures.
    When I run the query, the offsets are not being accepted.  Only the selected FY variable.  The first and second restricted kfs show 2009 data and not 2009, 2008 as it should.  Has anyone else had issues with this?  I am not using 0FISCPER but 0FISCPER3 but I am not sure how that would make a differnce.
    I have created new variables, tried to do positive offsets, tried to include and exclude values int the filter to no avail.
    Thanks,
    Cherie

    I kept my variable offsets in the restricted key figure and they aren't working.  When I just put fiscal year in the column and put the 0P_FYEAR and 0P_FYEAR-1 I get the 2 columns and the offsets filter through just fine.  It seems to only be messing up when they are in the restricted key figures themselves.

  • Variable offset for calday is not working - urgent

    Dear experts,
    I need to create RKF on PO count by 0calday. I need PO count for last 3 cal days in columns.
    I have a standard variable on 0calday, characteristic type, single value, mandatory.
    I have created 3 RKF -having offesets:  0calday, 0calday-1, 0calday-2.
    I can see three columns with date headers correcly.
    But I see only data in 0calday column. I have data for previous 2 days, but those columns are not showing any data.
    Please help me in fixing it.
    Regards
    Lisa

    When I am trying to change variable during navigation: I am getting following error
    Diagnosis
    The Can be changed in query navigation property has been set for variable Z_OD, characteristic 0CALDAY. However, the variable is used in the query in such a way, that the system is unable to apply this change-option.
    This can, for example, occur under the following conditions:
    Characteristic 0CALDAY is filtered by additional restrictions (the restrictions must be joined using an OR-connection)
    A second characteristic, which is restricted by a variable, is compounded to charcteristic 0CALDAY.
    Variable Z_OD is a hierarchy node variable, but the hierarchy has not been determined uniquely.
    A variable can be changed during query navigation only if it is used exclusively in a drilldown-characteristic, and there are no further restrictions to the characteristic other than this variable. There must be no additional characteristics with variables compounded to the characteristic you are working with. For variables for hierarchy nodes, the hierarchy must be determined uniquely and agree with the set display hierarchy.
    Also, if the characteristic value is moved, for example (Z_OD - 1), the variable is no longer able to be changed when navigating queries.
    System Response
    The entry Z_OD Can be changed during query navigation is not applied.
    Procedure
    Check the query definition.

  • Variable Offset not working in BI 7.0

    Hi ,
    I am facing an issue with variable offsets in queries in BI 7.0.
    I created simple keyfigures with variable offset for fiscal year period with -1,-2,-3...etc to show different periods but I am getting 0 values for the same.
    Just to inform, we are on SAP GUI 7.10 and support pack 0.Are thre any issues in variable offsets with front end patch ?
    If so, pls let me know.Pls also let me know if we need to apply any notes to resolve this issue.
    Regards,
    Kumar

    Hi Joke,
    Thanks for ur reply. I just now downloaded and installing and after that I will test the variable offsets.
    Wond,
    Just to tell you that variable offsets are not also working in the web.Let me install this patch and try one more time...
    Regards,
    Kumar

  • Variable Exit for fiscal week and weekday previous year

    Hi experts.
    in a reports I'm entering a date manually through a variable ZDATE1 for current year.
    I need to find out the corresponding date last year based on the week number and week day for the entered date.
    So, If i enter date 08/21/2009 , and that happens to be week 35 and day 2 for this week. so what would be the calender date for the same week 35 and day 2 in the previous year (2008).
    Please help with any functions or methods or syntax...
    Thanks

    Hi Frank.
    Im sure its possible to find the date last year, but it will involve some programming and thinking about time/dates etc, unless you can do a lookup in the factorycalendar or "normal" calendar, stored in the system AND having the number of day info.
    But you want to do this on the fly, in the report? I think performance might take a hit...
    regards
    jacob
    Edited by: Jacob Jansen on Oct 8, 2009 8:53 PM
    Edited by: Jacob Jansen on Oct 8, 2009 8:54 PM

  • Offset for variable not working !

    Experts,
    I have to show sales for last 5 months ( in 5 diff. Columns )
    So, i have written CMOD code, where i am converting System date in to Fiscal Year / Period using FM DATE_TO_PERIOD_CONVERT.
    every thing works good, i do get result. but the problem is the Offset for Variable function doesnt support that.
    I was hoping that, Now i can do Offset -1, -2 , -3...till -5 and i will have all 5 Periods.
    But looks like its not working out.
    What other logic i can use.
    !!!!!!!!!!My Variable is Not ready for Input !!!!!!!!!!! So the only way i found is to convert system date to current Period and then off setting it till last 5 months. And i do need to so last 5 months starting current Period -1, -2, -3, -4 and -5
    is there any other way to get current Period ( i guess only from system date ).
    I think in my logic, when i do offset, its not offsetting the Period, but its off setting system date.
    Please help

    Hi Honar,
    I am pretty sure offset should work, in your customer exit, calculate the current period as using the system date, once you get that, create a variable with the same name as you defined in the customer exit and use that variable in five different restricted key figures with each with (Variable, Variable -1, Variable -2, Variable - 3 and Variable - 4). If you have done so and not working, what are you getting in each of the variables, there might be some notes which could address that issue.
    thanks.
    Wond

  • Using offset for global variables in FOX

    Dear all,
    I'm using global variables (i.e. defined in planning area)in my FOX formulas by using VARV-command.
    I'm doing this for fiscal year, which has default value current year. However I'd like to use this variable also for next year thus creating the following code:
    DATA CURYEAR TYPE 0FISCYEAR.
    DATA NEXTYEAR TYPE 0FISCYEAR.
    CURYEAR = VARV(Z021VA01).
    NEXTYEAR = CURYEAR+1.
    This gives a syntax error. Anabody any idea how I can use offset in the FOX for my variables?
    Thanks in advance!
    Kind regards, Harjan

    Harjan,
    Use TMVL function to get the offsets.
    DATA CURYEAR TYPE 0FISCYEAR.
    DATA NEXTYEAR TYPE 0FISCYEAR.
    CURYEAR = VARV(Z021VA01).
    NEXTYEAR = TMVL(CURYEAR, +1).
    hope it helps.

  • Query Designer: "Set Offset For Variable" not available

    Hi,
    I want to restrict a character by using a variable with offset, but the needed function is disabled in context menu for different variables (customer exit, single value, multiple values, etc.). I have found a hint here, that this function only works with interval variables. Is this correct?

    Hi,
    1) For Customer Exit Variable: Offset Functionality will not work,
    2) For Manual input  Interval Varable: you can have the Offset, but the offset will work on upper limit only
    Ex: if u execute the quey by giving the interval like 2 - 4; then in the report output u can see only 2, 3 months data means the offset is working on 4 i.e upperlimit,
    3) For Multiple Single Values:  No offset Functionalty
    Thanks,
    Regards
    ReddYA

  • Is variable offsets can be used for characteristics, text and formulas?

    hi all,
    can anyone let me know whether variable offsets can be used for characteristics, text and formulas.
    if so cany one send me examples of using offsets to my email id [email protected]
    regds
    hari

    You use offsets on dates (0CALMONTH, 0FISCYEAR, 0DAT and so on) and of course the corresponding texts.
    If you have 0CALMONTH in your query and you want to do the same thing not only for the current month but for the past twelve months, they you just minus 1, 2....11,12 for each selections, and at the same time you can create text variable for the description of each month.
    thanks.
    Wond

  • Variable Offsets-Bit Tricky

    Dear Friends,
    It is very surprise with variable offsets (0CalWeek) in my Query. 
    I have a query where I have 2 structures.
    In Rows, I have 3 selections in structure and one characteristic. The three selections are Different Product Groups let say <b>A, B., C</b> and characteristic is <b>Product</b>. So the Products are listing in the report according to <b>A, B</b> and <b>C</b>.
    In Column, I have a Key Figure structure where I have <b>Stock,</b> <b>Age</b> (in No. of Months). The stock and Age are displayed against to Product.
    Apart from the stock and Age, The User want to separate the Product Ages in to 4 categories like <b><6 Month Age Product Stock, <12 Month Age Product Stock, <24 Month Age Product Stock, >24 Months Age Product Stock</b>. I created these selections using Boolean operators taking in to consideration of Age and Stock.
    I have two variable selections for this query, <b>Country</b> (Mandatory) and <b>Cal Week</b> (Mandatory, User Entry/default). The <b>Stock</b> Key Figure is restricted with Variables <b>Calweek</b> and <b>Country</b>. Up to now the Report is working fine.
    Now the User has new requirement is to calculate <b>Previous 12 weeks Sale</b> (in Units) of Product and then he wants to compare <b>Previous 12 weeks Sale</b> with each of <b><6 Month Age Product Stock, <12 Month Age Product Stock, <24 Month Age Product Stock and >24 Months Age Product Stock.</b>
    To Calculate <b>Previous 12 Weeks Sale</b> I have <b>Actual Sales</b> as Key Figure in Cube. In Selection, I restricted sales with <b>0Calweek variable</b> with offsets and like that I made 12 selections. I created formula for <b>previous 12 Weeks Sale</b>.
    Now my problem is When I introduced this <b>Previous 12 Weeks Sale</b>, The other columns <<b>6 Month Age Product Stock, <12 Month Age Product Stock, <24 Month Age Product Stock, >24 Months Age Product Stock</b> are not populating with Stocks but <b>Previous 12 Weeks Sale</b> is working fine.
    If I remove <b>Previous 12 week Sal</b>es and all 12 selections then all the ageing Columns are working.
    This is bit tricky, Please suggest me a suitable solution for this. Your help is highly appreciated.
    Thanks,
    SB

    Hi,
    12 weeks means 3 months.Right?
    try by creating selections month wise. i.e. create 3 selections by restricting sales with offsets on months instead of 12 weeks .
    Hope this helps!
    (what about your previous thread?issue is resolved?if so,pl close it by assiging points )
    Message was edited by: Murali

  • Variable offset not working

    Hello Experts -
    I have a structure and a variable with single-value entry. The variable is on 0CALMONTH.
    If user input 06/2007, I wanted to see information for 06/2007, 05/2007, 04/2007. I'm using a variable offset. But my report output is always for 06/2007. I have data for 05/2007 and 04/2007 also.
    In the column header, it shows 04/2007, 05/2007 and 06/2007 but there's not data.
    Can someone please help me with this? What am I doing wrong?

    If you can see the offset result in header then it will surely work for data also.
    If u have a key figure amount.
    Then you need to restrict this figure for user inputed months variable - offset.  i.e different restricted figures for different months.
    I hope this is clear to you, if not then do let me know.
    Thanks
    Dipika

  • How can i set dynamice for week on Selection screen..pls help me..Urgent

    Hi..All
    please Help me .. i am very  confused..
    i need to set a varient for week which is dynamic on selection screen.
    b) Week from current week to current week + 2. (<b>Dynamic selection)</b>how can i set dynamice for week on Selection screen,,
    how can i do this..i am alrady set dynamice variant for Date.. there is option for D.. but in case of week there is a no option.
    pls help me..urgent
    thamks in advance.
    mayukh

    Hi,
    I think the way out is use the dynamic select option while setting up the varinat and use sy-datum to sy-datum+9 which should essentially serve the purpose.
    While saving the variant, for that particular date field check the Selection variable checkbox, then Choose D
    option and then choose current days + or - option from there.
    Rgds,
    HR

Maybe you are looking for

  • How to create a user in BI

    Hi, I am trying to add a user that I can use in BI other than the Administrator user. I have added a user via the Security Manager of BI Admin and have assigned it the Adminstrators security group. However when I try to log into BI Answers using this

  • Navigate icon problem (go back)

    Hi, I am having some problems with some navigation icons that has been set up with the destination to "recent" and the page to "go back". The way that I am using them is to move around a menu window. For example, the first option in the menu is like

  • XSD Validation, checking for required elements

    I'm using the FTP Adapter to retrieve a flat file in a format like this - H|1|1234|5-APR-2007 L|1|33123|2 L|1|12345|1 L|1|6969|5 S|1|Milton Park, Abingdon, OX142NF I have generated an XSD file using the built in wizard that looks like this - <?xml ve

  • Datagrid problem

    hi all how r u i have a small problem in datagrid and hope any one help me i created a datagrid that each row can has its own color i used this code package Models       import flash.display.Sprite;       import mx.collections.ArrayCollection;      

  • Delay in partial trigger invocation

    HI I am facing an interesting issue. I have a table and some commandtoolbar buttons for add and delete functionality. So the scenario is whenever a user selects a row in a table, buttons are enabled and he/she can perform add or delete.I have some en