'Variable' variable offsets

Experts - Please advise.
My query accepts user entry for a fiscal week range - a from value and a to value. I am currently using a variable with range for this query. Now, the problem is that the user does not want to input the company's fiscal week. Instead, he wants to input just 2 numbers - say n1 and n2. My fiscal week range should then be
(current week - n1) to (current week + n2).
Has anyone done this before - accept 2 numbers (which are not modeled in the info cube) and pass it on to the user exit (or otherwise ?) and calculate the date range. Please advise.

Hello,
sounds interesting... there are more then one possible solution. One way could be to create an info object (num. 2) with master data. There you can store your 2-sign week-entries (F4-selektion on masterdata). Then include this object into the cube (without filling/mapping them). Within your query you can create a selection on this object. Create a exit-variable on the fiscal-week-objekt.
Within the Bex-exit you have the possibility (within STEP 2) do read the entries from the selektion of the first object. With this entries you could fill (and modify) your fiscal-week-object.
Bye, Joerg
[email protected]

Similar Messages

  • Replacement path variable with offsets

    Hi experts,
    I have the requirement to report receivables (open items) historically by fiscal year / period.
    More precisely, each period should show the open items that are open at the end of the period.
    Example:
    001.2010 (shows open items from 31.01.2010)
    002.2010 (shows open items from 28.02.2010)
    ...etc.
    The idea is that the user enters a fiscal year/period using a manual entry variable.
    The open items should be calculated as follows:
    KF: Amount
    Posting Date <= Variable
    Clearing > Variable or unassigned
    Variable is a replacement variable that is replaced by attribute "Date To" from the user entry Variable (Fiscal year period)
    E.g. if the user enters 008.2010, then this value is automatically replaced by 31.08.2010.
    Generally this works.
    However, to view the values for the last 12 months, a structure is needed consisting of 12 elements with offsets in order to show the 12 months prior to the selected period (e.g. 001.2010 - 002.2010 - 003.2010 ....etc.)
    The problem is that the replacement only considers the user's variable entry and ignors the offsets.
    Example:
    User enters 008.2010.
    In the column strucure I show 3 months 006.2010, 007.2010, 008.2010.
    Then all columns would show items open on 008.2010 - the offsets are ignored.
    Any idea, why this happens and how it can be resolved?
    This problem has given me a headache for days.
    Your help is much appreciated.
    Thanks and regards,
    Alex
    The user should be able to enter a fiscal year / period and

    take an e.g.
    u have characteristic say ch1
    u want to restrict it with replacement path variable
    first of all create a variable var1
    click what it is based upon for e.g. 0calday, 0material etc.
    make it user entry variable
    select single or multiple entry
    make it mandatory
    save it and hit okey
    click on ch1
    right click and say restrict
    in new window create a new variable
    give its name and technical name
    processing path is replacement path
    go to next tab of replacement path
    select several ooptions
    replace variable with another variable
    select a variable called var1
    change the offset length and offset start with different parameters.
    hit okey
    this way u have restricted ch1 with replacement path variable var1
    now when u run report u have to enter value of var1
    which will then further feeded to ch1
    this way u can create replacement path variables at lots of instances and then u can always feed the value from var1 at different time
    make sure as this ur requirement is date
    try to use 0calday as reference infoobject all the times....

  • Posting Period Range variable - Using Offset

    Hi:
    I need to create queries for each quarter.  Without going through detail, some of my columns in my report I need to use the first two months of the quarter and some of the other columns I need to use the 3 months in each quarter.
    So for example:  We are right now in quarter 1; Jan, Feb, and Mar. Some columns I will be using a range of 1 to 2 and the rest I will be using a range of 1 to 3.  The same type of logic for the other 3 quarters.  I have a posting period variable (Characteristic value) and I was hoping that I was going to be able to use the offset option when I restricted my variable in each column that I only want period 1 and 2.  But when I run the query I don't get any results.  I know that the offset works with "fix" values but it seems not to work with a "range".
    I'm trying to stay way of creating the same queries for each quarter where the difference is only the posting period.
    Does anybody have any idea how I can accomplish this?  Has anybody ever had to do something like this?
    Your thoughts comments will be greatly appreciated!
    Regards,
    Helena

    Hi Arun:
    I know I can restrict the values that I want but I'm trying to avoid in having to create 4 queries..One per quarter.  I'm trying to see if I can just have 1 query and use a range variable which I have already defined as a characteristic value and it's a range.  I use the user exit to populate the initial values depending on the posting period at the time the query runs.  Right now the variable screen will show 1 on the from and a 3 on the to.
    The columns that need all three months are coming out fine in the report.  The issue that I'm encountering is the columns that I only need the two months in this case 1 and 2.  What I did here is still using the same range variable and restrict it with an offset of -1.  When the query  runs, this column comes up with no data.
    How can I get around this?
    Thanks for your help!
    Helena

  • How to create variables for offsets?

    Hi BW Experts.
    I have a tricky one that has been posted before, but I couldn't get my head around a feasible answer just yet.
    My customer wants to be able to display his ageing AR report with different buckets, depending on the month.
    For example, if it's January he wants to see buckets for 1-30 days, 31-60 days, 61-90 days and 91 to 120 days.
    If it's February, he wants to see buckets for 1-28 days, 29-58 days, 59-88 days and 89-118 days.
    If it's March, he wants to see buckets for 1-30 days, 31-58 days, 59-88 days and 89-118 days,
    and so on.
    We have create a structure in the query, filtering the key figure 0DEB_CRE_LC by 0NETDUEDATE. We have a variable for 0NETDUEDATE as a starting date and use different offsets to get the buckets. However, the offsets need to be hard coded, preventing us the flexibility of choosing the days in the buckets.
    Is it possible to create variables for the offsets, so the user can choose the days for the buckets at the report run time?
    Thanks in advance.
    Kind regards,
    Aline Passos.

    Hi Aline,
    as user is entering 0NETDUEDATE & he needs different buket for different months, which are more or less decided well in advance, I believe it cane be handled by User Exit varaibles which will draw value from the variable value you have entered & go backward.
    you will need to write the ABAP code with your logic to drive the correct user exit values.
    hope it helps
    regards
    VC

  • Variables with Offsets in Cache

    Hi Guys,
    I have a number of queries that I want to cache the current week, plus the last 4 weeks, each night.
    I have the variable for current week working but how do I create offsets of this in the 'Filling OLAP Cache' in Info Broadcasting?
    Regards
    Scott

    Thanks for your reply. I guess after looking into the problem yesterday I found out that if the changes are made to the project that will be executing then the changes in static String are detected but we have 3 projects in addition to the project with web module (all projects sit in the same workspace). If the static String in one of the project is changed the change is not reflected when the web module is run. As the additional projects are domain objects they are not supposed to be run by themselves only to be called by the web project. We have tried building every project before running web module that does not help. So, any thoughts how this situation can be remedied. BTW- we have just moved all our development to JDeveloper and are loving it.
    Glad to hear that you are loving JDeveloper. Right now your workaround is to Build each of the projects. For the next release we will have a Build Workspace command which will build all of the projects in the workspace.
    Part of the problem, is that your static String (probably final), is getting inlined by the java compiler (this is normal for final values), and therefore not getting updated since it lives in a different project.
    You could not make it a constant (final static) value, and make a static method to get the value, or just remember to build all of the projects for now. With the release later this year, Build Workspace will work nicely for you in this situation.
    Thanks,
    Rob

  • Variable CalMonth Offset and simultaneous Calyear Filter

    Hello,
    I used a variable (user entry) to determine Calmonth, and then I used offsets of the variable to restrict keyfigures and display them in 4 colums, one for each of the 4 quarters preceding calmonth as follows:
    1) calmonth-11 to calmonth-9
    2) calmonth-8 to calmonth-6
    3) calmonth-5 to calmonth-3
    4) calmonth-2 to calmonth
    The problem is that I want also to restrict the keyfigures (and/or the hole query) to the year of calmonth (I dont want to take into accounth the values of the keyfigures if the offset 'falls' the year before).
    Example:
    Calmonth = 06.2007
    Then:
    1) calmonth-11 to calmonth-9 = 07.2006 to 09.2006
    2) calmonth-8 to calmonth-6 = 10.2006 to 12.2006
    3) calmonth-5 to calmonth-3 = 01.2007 to 03.2007
    4) calmonth-2 to calmonth = 04.2007 to 06.2007
    I only want to take into account the values of the key-figures for 2007: 3) and 4).
    So columns corresponding to 1) and 2) should be empty...
    To do so, I have a variable (exit) for calyear that takes the value of the year of calmonth.
    I then additionally restricted the keyfigures with my calyear variable, and I also put the calyear variable in the Filters of the query.
    I also put caracteristic Calyear on top of the columns (before the keyfigures).
    My problem is that on the layout, in the example below, I have all the colums for 2006 and all the columns for 2007, (at least filled with the good values: 2006 has values only for 1) and 2), and 2007 has values only for 3) and 4)).
    But I don't want to have all the 2006 part on my report (having 2006 makes me have a lot of additional rows that are empty on 2007)...
    Why doesn't my simultaneous restriction on keyfigures (calmonth with offsets AND calyear) work?
    Why, if I have a filter on calyear : 2007, I have columns corresponding to 2006?
    Thanks a lot for your help!
    Andrea

    Thanks for your answer. In fact, my problem is not just having the comlums for 2006 but the fact that <u>they're not blank</u>... I've got values on it and that makes my results wrong (For example, I created a column using a SUMGT of another column/keyfigure, and it seems to take into account values of the keyfigure for 2006 AND 2007 => in the the 2007 part of the query. I just want a sumgt of 2007 in 2007...).

  • Bex variables with offset

    I've created a query with a period structure that contains 12 periods. Using a variable and a offset I'm able to key in for example 012/2006 and get the "actuals" using a restricted key figure for month 1-12 of 2006. That seemed straight forward. Were I am confused is if I wanted the users to key in 010/2006 and get months 1-10 or by using the same query key in 04/2006 and get months 1-4. I'm hoping someone can explain if possible.
    Will award points as always.
    Thanks
    Richard

    Use an interval which says:
    Fixed value 'Period 1' to variable value 'entered by user'.
    You can mix values and variables in an interval.
    But you can't use a fix structure where you created a key figure for each month. You would have to use a drilldown instead for 0FISCPER.
    Regards,
    Beat

  • Predefined variable for offset

    HI,
    Can anyone provide me any system variable which will provide me the current offset of line from top of page (either in cms or in line count).
    Bye

    Hi,
    Use SY-LISEL,
    it holds the current line contents of the field
    SY-CUCOL-- which gives the offset value of the current column..
    SY-LILLI   - which gives the current line
    Regards
    kiran
    Edited by: Kiran Saka on Feb 9, 2009 1:52 PM

  • Variable with offset error

    Dear gurus,
    On my query i have a variable V1 ( user input ) for the period char ( 0fiscper3 ).
    I need to have a column with values from period imputed on V1 + 1 until period 13, but when user inputs on V1 value 12 ( 12 + 1 = 13 ), values for period 1 to 13 are displayed. If i fix on the column period 13 - 13, no values are displayed ( its correct ).
    The only thing that i remind is that period 13 does not have values, so system goes to next period with values ( period 1 ) and goes until period 13.
    Does this makes any sense? Does anyone knows what i am doing wrong?
    Please help.
    Best regards,
    Vitor

    Hi Vasco,
    check your user exit code in CMOD. keep a "IF" Condition like the fiscal/period should be less than 13.
    IF Fiscper < 13.
    hope this helps.
    With Regards,
    Ravi Kanth

  • Variable for Offset

    There is standard report Customer overdue Analysis in which it gives the days overdue amount.Like,0-15 days, 16-30 days,31-60 days etc.
    Now the clients requirement is he should be able to input the days interval as per his desire, say 0-5 days, 6-10 days.
    The problem is if it is fixed then I know we can hardcode it in the offset but if it is not fixed then how should I go about it?
    That is take the input from user 5,10 then it should show me the overdue amount for 0-5 days and 6-10 days.
    Any suggestions wold be greatly appreciated.
    Thanks in advance.
    Anuj

    Hi,
    one way is to predefine structures:
    Structure1 0-15 16-30 31-60
    Structure2 0-5   6-10 11-20
    Structure3 0-7   8-14 15-20
    User can select which Sructure he wants to see.
    Kind Regards,
    Alican

  • Customer Exit Variable - Variable Value Error BRAIN 000

    I created a variable which is processed by 'Customer Exit'. This variable is 'optional' and NOT user input required.
    And i have written my code in customer exit under I_STEP EQ 1.
    I used the variable in my query as a default value for a free characteristic.
    The query runs fine and return me the correct result.
    The problem is when i used the same variable as a default value of a free characteristic in another query which has another user input variable for another characteristic, i got a warning message after input a value for another variable.
    Variable Value Error BRAIN 000 <<i>my variable name</i>>
    How to make it work in the second query?
    Please help as I am new to this.
    Thanks,
    CH

    Hi Fernanda,
    Try this:
    DATA:  LS_RA_SID  TYPE   RSR_S_RANGESID.
    DATA:  fst_date LIKE sy-datum.
       CASE i_vnam.
              WHEN 'ZRANGE_PREVMONTH'.
    fst_date = sy-datum - 1.
    concatenate fst_date(6) '01' into ls_ra_sid-low.
          ls_ra_sid-sign = 'I'.
          ls_ra_sid-opt = 'BT'.
          ls_ra_sid-high = fst_date.
          APPEND ls_ra_sid TO e_t_range.
    ENDLOOP.
    ENDCASE.
       ENDIF.
    Just post here for any queries..
    Regards,
    Loed

  • Error with a variable variable

    Hi people!
    First of all, sorry for my bad english ;-)
    I have a vert rare problem. I'm implementing a shellscript to sync svn dirs that are out of actual revision. This script checks automatically which dirs are candidates and into a for iteration he's going building the final svnsync command. This part works ok, but when the recently created command becomes executed he doesn't do any thing. Here is the part of the code that do this task:
                    command=""
                    c=1
                    for i in $optionP;do
                            SVN_SYNC_CMD="svnsync sync http://server/$i $CREDS --no-auth-cache --non-interactive >> $ERROR_SYNC 2>&1"
                            SVN_SYNC_FORMAT="echo \"###### i$ ########\" >> $ERROR_SYNC"
                            command="${command} $SVN_SYNC_FORMAT && $SVN_SYNC_CMD"
                            if [ "$c" != "$CONT" ]; then
                                    command="${command} &&"
                                    c=$(expr $c + 1)
                            else
                                    command="${command} &"
                            fi
                    done
                    $command
                    echo "Final Command ========== >>>$command"
                    $DIALOG --title 'Sincro...' --tailbox $ERROR_SYNC 50 95
    The last echo "Final Command ======>>> $command" shows me the correct command, like this: echo "#################################TestDir#################################" >> /var/tmp/errorSync && svnsync sync http://server/TestDir  --username=user --password=anything --no-auth-cache --non-interactive >> /var/tmp/errorSync 2>&1 && echo "#################################TestDir1#################################" >> /var/tmp/errorSync && svnsync sync http://server/TestDir1 --username=user --password=anything --no-auth-cache --non-interactive >> /var/tmp/errorSync 2>&1 &
    If I execute this command directly from the shell works ok, but when this command is executed from the script it crashes and the script seems to do the first echo, with a output like this "#################################TestDir#################################" >> /var/tmp/errorSync && svnsync sync http://server/TestDir  --username=user --password=anything --no-auth-cache --non-interactive >> /var/tmp/errorSync 2>&1 && echo "#################################TestDir1#################################" >> /var/tmp/errorSync && svnsync sync http://server/TestDir1 --username=user --password=anything --no-auth-cache --non-interactive >> /var/tmp/errorSync 2>&1 &      instead to continue with the next command...
    Anybody knows what can I do?
    Thanks in advance!

    I'm a big fool!
    I've tried to do with eval many times before writing this post, but I tried with other combinations of eval and obviously did not work ... I was so dazed with this stupid problem that it occurred to me that ...
    Thank you very much Procyon
    PD: I Love google translator jajajaja

  • Error in query when using offset in variable

    Hi,
    I have a query in which I use av variable (0CWEEK) for the current week. The query works fine with this varable. But when I use an offset of for example minus 1, the query displays an error:
    (A299(BRAIN)) Terminate: System error in program SAPLRRI2 and form REP_ASSIGN_INITIAL_OPT-01
    We use offset of 0CALWEEK in other info cubes, and there are no problems with that.
    In this case we have implemented 0CALWEEK in a DSO. Perhaps this somehow causes the problem? On the other hand the variable works fine in the DSO, as long as we don't use offset.
    So - why is there a error, and how to solve it?
    BR,
    Niclas

    Managed to solve the problem. The reason was that there was no column (or row) with the variable without offset. I.e. there needs to be a column for the actual week in the query as well, not only week with offset. In this case I didn't want the actual week, only an offset to it. So I just hid the column with the actual week from presentation.
    /Niclas

  • Offsets in variables

    Hi,
    I created a query using variable 0FPER for 0FISCPER and then created offsets to go to prior month from selection month. The result showed the selection month value for the prior month also.
    When I use the text variables, the values for selection month and prior month show the selection month only
    When I use 0P_FPER variable, the query cannot be executed with an error message 0FPER cannot have replacement value.
    I think this is a SP issue. We are on SP 7 in NW2004S. On the other hand, when I create the same query in 3.1, I get different values for different periods which are correct. The text variables work correctly.
    I cannot find any OSS notes for this. Is there any correction instruction for this?
    Thanks.
    Param

    Param :
    Yes, i think maybe it´s an sp issue. Try with 11 level, and see this link with the detail of sp and his corrections :
    https://websmp207.sap-ag.de/~sapidb/011000358700004483762006E
    We have 9 sp level and still it´s not possible work correctly with variables and offsets.
    Hope Helps.
    Natalia.

  • 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

Maybe you are looking for