Variable for prior 36 months

Hi all,
I need to create a required variable to get the prior 36 months of data EXCLUDING the current month. Can someone help me with this?
Thanks,
Angie

HI,
in BI Go to SE38 ZXRSRU01 where you can write code for user exit variable.
DATA : Month(2) type c.
DATA : Year(4) type c.
  WHEN 'ZVAR2'.
    IF I_STEP = 2. "after the popup
      Month = sy-datum+4(2).
      Year = sy-datum+o(4).
      IF Month EQ '01'.
      Month = '12'.
      Year = Year -1.
      ELSE.
      Month = Month - 1.
      ENDIF.
      Concatenate year month into L_S_RANGE-high.
     clear : month, year.
      Month = sy-datum+4(2).
      Year = sy-datum+o(4).
      Year = Year - 3.
      Concatenate year month into  L_S_RANGE-low.
      L_S_RANGE-SIGN = 'I'.
      L_S_RANGE-OPT = 'EQ'.
      APPEND L_S_RANGE TO E_T_RANGE.
    ENDIF.
ENDCASE.

Similar Messages

  • Variables for prior and next periods in logic

    Hi,
    I'd like to do something that I would have thought should be quite simple, but I just haven't managed to get it right.
    In Category, we use the properties Year and Month. For example:
    Member  Year     Month
    Actual     2014     APR
    SP          2016     DEC
    The issue is that we would like to create SP (Strategic Plan) for 3 years, of which the year in the property, 2016, is the first.
    Creating variables for the month and for the first SP year is simple:
    *SELECT(%CYEAR_SP%,"[YEAR]","CATEGORY","[ID]= 'SP'")
    *SELECT(%CMONTH_SP%,"[MONTH]","CATEGORY","[ID]= 'SP'")
    I'd then like to  dynamically create 3 variables based on properties Year and Month; %SP1%, %SP2% and %SP3%, that I can use in scoping, in *WHEN/*IF, in GET and in *REC. It should be something like:
    %SP1% = %CYEAR_SP%.%CMONTH_SP% (2016.DEC)
    %SP2% = %CYEAR_SP%(+1).%CMONTH_SP% (2017.DEC)
    %SP3% = %CYEAR_SP%(+2).%CMONTH_SP% (2018.DEC)
    However it doesn't seem possible to use mathematical expressions for this, and I haven't managed to use NEXT or PRIOR successfully either.
    Has anybody out there encountered this?
    /Cecilia

    Thanks Roberto! Square brackets for Year in *SELECT was the syntax solution, works like a charm!.
    I developed this further by creating new variables concatenating the year and  month:
    *SELECT(%SP1%,"[ID]","TIME","[ID]='%CYEAR_SP%.%CMONTH_SP%'")
    *SELECT(%SP2%,"[ID]","TIME","[ID]='%CYEAR_SP2%.%CMONTH_SP%'")
    *SELECT(%SP3%,"[ID]","TIME","[ID]='%CYEAR_SP3%.%CMONTH_SP%'")
    /Cecilia

  • Variable for calender month in BEX Query

    Hi all ,
    I am new to BI .
    Can any one please guide on how to create a month year variable that I can get calculated from a date..
    For Example
    if billing date is 01.02.2009 then my variable should have 02.2009 in Query   .
    Regards,
    Shashank

    Hi Shashank,
        You can achieve this by creating a customer exit variable for calendar month.
    Function module :
    READ TABLE i_t_var_range WITH KEY vnam = 'Date variable name ' INTO loc_var_range.
       IF sy-subrc = 0.
        year = loc_var_range-low(4).
        month = loc_var_range-low+4(2).
         CLEAR l_s_range.
         l_s_range-sign = 'I'.
         l_s_range-opt  = 'EQ'.
         CONCATENATE year month INTO l_s_range-low.
         APPEND l_s_range TO e_t_range.
       ENDIF.
    Hope this will help you. Let me know if you have any questions.
    Regards
    Suvarna

  • Display Net Outstanding Invoice amt only in Cust Statement for prior month

    Hi
    Our Client has requested for the Customer Statement to include only Net Outstanding Invoice balance for prior month while showing all transactions of Invoices and Payments including fully paid transactions for the current month only.  Currently they are not able to reconcile historical payments against Invoice because lots of them are partial payments only.
    Kedalene Chong

    Hello,
    Backdating of the statement is supported in 2007 A / 2007 B versions. Displaying fully
    paid transactions for the current month only will be considered for next release.
    Thanks for the valuable feedback.

  • Selection variable for next month in RFPERIOD_OPEN in closing cockpit

    Hi,
    we would like to use RFPERIOD_OPEN in the closing cockpit in order to open the next period on D-10 automatically. I would like to use the selection variables of the closing cockpit in the program variant in order to avoid unnecessary variant maintenance every month.
    Unfortunately I cannot find a variable for the next month. There is only SAP_FAST_CLOSE_PERIOD_P. Do you know if it is possible to base a calculation logic to derive the next period from SAP_FAST_CLOSE_PERIOD_P.
    Thanks!
    Kind regards,
    Mariya

    Thanks! I checked it, but the appearance of months and order is okay in T247.
    Any other ideas?
    I thought I read somewhere that this is a bug but can´t remember where I found that bug hint.

  • Overage Charge for prior month on first bill

    Got my first Verizon bill today and found something interesting.  I was charged for going over my data for the prior month to the tune of $15 for a gig.  Problem is, I've only had the phone for a month and there is no prior month on my account!
    Or at least there shouldn't have been.  Looks like my billing cycle started the day after I got the phone, so all the data from setting up my phone in store was overage.  This is crap.  Anyone else notice this?

    That one day of the prior billing cycle was prorated based on the data plan you selected and divided by the number of days in the billing cycle.

  • Substitution variable for multiple months

    Ideally, i would like to have a calc script with a substitution variable FIX(&Month) which points to specified months. I have tried setting the value for my substitution variable in different ways
    1.
    Variable = Month
    Value = "January""February"
    2.
    Variable = Month
    Value = "January","February"
    However, the script seems to be failing to pick up the second month as it returns no values for February. If i specify the months in the calc script, it works just fine. This suggests to me i'm getting the syntax wrong for the substitution variable.
    Any ideas?

    There is nothing strange it can behave. It will work.
    I am using this in production for years to genarate comma seperated scenario list with out any issues.
    What a substitution variable will do?
    It will store a string as a value for the variable and resolve at the time of calc. if the value is a valid member set it will work.
    I believe issue is not because of that.
    However, the script seems to be failing to pick up the second month as it returns no values for FebruaryIs it throwing any error in syntax check or in executing. Answer is No from the above statement. But you are not seeing the expected results in the calc.
    first check the application log whether the calc is happening for both jan and feb.
    Then why the calc is not as of expected for feb.

  • User Exit Variable for Infoprovider based on month characterstic in query

    Hi,
    I am financial reporting with reports created on a mulit-provider over a plan & Actual cube.  Along the top of the report is a structure which has amongst other restricitions a column for each month, i.e columns 1 to 12. 
    Currently we are in month 9, so the report should show data from the Actual infoprovider for months 1 to 9, but data from the plan infoproviders for 10 to 12.  My question is how should the variable be coded for the infoprovider which will return a value based on the month characteristic in each columns selection.  I understand how I can look at say the current system date, derive the month and return the plan/actual value for the correct infoprovider based on the current month.  But I need to create a variable which will look at the month value which is in each column selection in the query itself.
    Many thanks,
    Richard

    we recently had this kind of reporting requirement. only difference being week instead of month.
    you need to create 12 variables for actual month columns and 12 for budget.
    now you will write a code to address all the variables. in following format :-
    when var1.         "suppose var1 represents month 1 of actual columns
    1. derive month from date.
    2. if month <= i_vnam+3(1)                         "get the number from var and compare
                  set the  variable value as the month number of that year for e.g
                  concatenate year i_vnam+3(1)      into        l_s_range-low       
        else
                  set the variable value way back in past which will not have any data.
    above logic will cause values in following fashion
    if this month is 3 and year is 2008
    var1 = 200801
    var2 = 200802
    var3 = 200803
    var4 = 199001
    var5 = 199001
    etc.
    In the query all columns will be set with the property = hide if not values are present. so if 199001 is set in the variable then it will be collapsed.
    same way logic for variables in budget column can be written which will set all the month variables which are less than
    current month to 199001 (just in reverse fashion of above mentioned logic.)

  • Sap standard variable for currecnt calmonth & year

    hi
    please let me know any sap standrd variable for current month & year

    Hi,
    "OP_RTFPM-Current Month of Fiscal Year", this is also to give month only. If still be in searching just try for month.
    Thanks-RK

  • Text variables for non-input ready variables

    I have a query with a structure in the Rows section.  The row structure contains three selections for different time periods.  Two of the time periods are based on non-input ready variables for Calendar Month.  The user will enter a calendar month and the other two selections will be based on the month that was inputted.  Since the time periods are dynamic, I need the text in the rows to reflect the appropriate Cal. Month value.  I have tried using a customer exit to define text variables but they are not working.  My text variables are called "CMON_TXT_D01" and "CMON_TXT_D02".  If the user selects 'Dec. 2010', the report would look like this
    Dec. 2010  => user inputs this value
    &CMON_TXT_D01&  => customer exit calculates -1 month back from inputted value
    &CMON_TXT_D01&  => customer exit calculates -2 month back from inputted value
    I need it to look like this if the inputted value was 'Dec. 2010'
    Dec. 2010
    Nov. 2010
    Oct. 2010
    I can get the text variable based on the input-ready variable to work but the two selections that are based on the non-input ready variables are not working.  Does anyone know how to get the text variables to work for the non-inpjut ready variables?
    Thanks.

    Hi,
    I would do it this way;
    1) Create a Row Structure
    2) Create Row Selection for Dec 2010 by restricting Cal. Mth. by the User Input Var
    3) Create Row Selection for Nov 2010 by restricting Cal. Mth. by the User Input Var with a Var Offset of -1
    4) Create Row Selection for Oct 2010 by restricting Cal. Mth. by the User Input Var with a Var Offset of -2
    5) Create a Text Var whose processing is by Replacement Path & choose Variable with the User Input Var under Replacement Path options
    6) Edit the Description of each of the 3 Row Selections to contain the Text Var in (5)
    7) The Text Var should automatically reflect the User Input selection & the offsets defined on the same in the Row Selection Captions
    --Priya

  • Want to schedule WebI report for End date of Prior Month

    Hello Experts,
    We have WebI report created on top of Bex Query, We have key date as prompt for the report. Can we schedule the webi report for key date as last date of prior month, so if current month is February, my key date should be Jan 30 2011. I am not sure if this is possible?
    Thanks,
    Ravi

    You need to apply two FM to get the end day of the month.
    First you need to apply FM MONTHS_PLUS_DETERMINE. This will give you the date after 3 months.
                CALL FUNCTION 'MONTH_PLUS_DETERMINE'
                  EXPORTING
                    MONTHS        = 3   " << for 3 months
                    OLDDATE       = l_start_Date   " << 12/01/2007
                 IMPORTING
                   NEWDATE       = l_3_Date. " << 02/01/2008
    Then call the FM RP_LAST_DAY_OF_MONTHS . this will give you the end date of the month
      CALL FUNCTION 'RP_LAST_DAY_OF_MONTHS'
        EXPORTING
          day_in            = l_3_Date  " << 02/01/2008
        IMPORTING
          last_day_of_month = l_3_Date  " < 02/29/2008
        EXCEPTIONS
          day_in_no_date    = 1
          OTHERS            = 2.
    Call both FMs again to get your another date(after 4 months).
    Regards,
    Naimesh Patel

  • Variables for calendar year/month

    Hi All,
    My requirement is to create a headcount report which has to display the number of employees for different time period. ´
    1) When user chooses calender day then the report should display total number of employees on that time period(01.01.2005)-(10.01.2009).
    2) If user chooses calyear /month then he should see the report for each calyear/month (like 01.2005 , 02.2005,02,2005....)in the columns.
    I tried dropping calyear/month in column and i got the result for my second scenario (like 01.2005 , 02.2005,02,2005....)
    But when the user chooses the calday it still shows the report by calmonth (bcoz of calyear/month in the column).
    I also tried text variable for calyear/moth(replacement path method) but i have the restriction in the interval (from date or to date - i have to choose one by default) so it shows only either date in the columns .
    The  two variables. 1) Calender Day (Interval,Optional)) 2) Calender Year /Month (Interval,Optional)
    I got four restricted key figure to restrict number of employees by business.
    Eg :
    When Cal Day is choosed then the report will be :(01.01.2005 -10.01.2009)
                   (01.01.2005 - 10.01.2009)
    Country  Sales Finance
    India        20      30        
    Denmark  30      50        
    When Calyear / Month is choosed then the report will be : (01.2005 - 02-2005) :
                        01.2005                    02.2005                                
    Country     Sales Finance      Sales Finance    
    India           24     70                70         45       
    Denmark    36      60               56        30         
    Regards
    A.Vasister
    Edited by: vasister a on Oct 9, 2009 11:10 AM

    Hello,
    This cannot be achived dynamically.
    I think the two ways you can work out is creating two different reports one to include daywise and the other to include montwise structure.
    Otherwise you can keep calday in free char and ask user to swap calmonth with calday as per requirement.
    Else you have to create a workbook report and make use of VB macros to calculate report dynamically which is a very complex approach.
    Regards,
    Shashank

  • How to load stocks for the months prior to initialization ?

    Hello,
    We load a cube stock from 3 ODS for BF,BX and UM extractors.
    We are in a monthly snapshot scenario(we have read the specific how to but we must use 3 ODS one for each datasource because of data integrity (strong customer architecture contrainst).
    For opening stock and the future month the solution is ok.
    How to load the data for the 12 month prior the loading of opening stock ?
    Specific datasources, full loading ?
    Thanks to share our experiences
    Best regards
    Christophe

    your previous months closing stock becomes opening stock for current month. Try the infostructure S039,this holds the closing stock of each month. You can populate this infostructure with program rmbs039. create a generic data source on this and populate opening and closing stock for each month.

  • How to create a text variable for Calender Yr/Month depending on the prompt for calendar year

    Hi everyone
    Please assist on this issue:
    i have created a Bex report that has an offset for 12 months from the current calender month, i tried to use text variables to replace the calender months but i just learned now text variables from Bex dont work in BO, so I would like to create a prompt in BO to enter Calendar Year and then based on the input(Calender Year) the Webi report must display a 12 months for that Year.
    Please also indicate where exactly  i have to click in order to get that "Helpful icon "  when the my issues have been resolved, because i searched it and havent seen it anywhere on the communications
    Thanks in Advance
    Ole

    Hi Gill
    In BO I recieve my all months for existing data  and when i create a prompt for Calender Year the months in the report still has those text varibale for exampl if i enter 2011 on the prompt the text remains for the year that was already there wen i created my text variable... so its not dynamic.....
    So if i have text variables in Bex it will display like this in Webi in which it wont change if i put in 2011 as input for the prompt...

  • Need help on Creating YTD for a month variable in WEBi...

    Dear Experts,
    I am using BO4.1. I am creating a WEBi report where I have a month variable which shows months in the below format
                                                                                                                                             I need to create YTD for the year ...Please help me .. this has to be displayed in chart.. So using the sum(No.Of.Ans ) doesnt work in chart.
    Please suggest any other ideas...

    Hi Bala,
    Create a variable at universe level,and assigned table must be the table from which you are getting month.
    Now take the object "YTD" into second query
    Merge the Month object and YTD object
    Create a variable for balance,
    =If [month]="YTD" then sum([balance]) else [balance]
    Noe you will get the required output as your requirement,
    Regards,
    Samatha B

Maybe you are looking for

  • I dont see 2lis_03_BX what should be the problem in LO cockpit?

    hi gurus, I dont find or see STock initialization 2LIS_03_BX data source in my LO cockpit or in RSA6 Tx screen, instead i find 2lis_40_s278.. what should i do to activate 2lis_03_bx data source and not with the above 2lis_40_s278...I am using R/3 4.7

  • 3dmark2001 cant get it to work??

    i can't get it to work?? i have the 875p intel 3gig 800 fsb 1 gig corsair twin x 3200 audigy 2 platinum nividia ti4200 and when i try to run the program it says 3dmark error "3dmark2001 se needs directx8.1 and proper drivers installed in order to run

  • HP G62 DVD Drive Manufacturer

    ImgBurn would like to know the manufacturer for my ts-l633n. I've looked all over the boards, and the internet and couldn't find a manufacturer. Big, big, big help needed. Thanks in advance, Amrinder This question was solved. View Solution.

  • No picture, only sound. JVC gy-hm100 ssd card

    Hi. I just bought the new JVC gy-hm100 camcorder that records directly into QT format. How ever, when I import the files to my new mac pro, I only get sound and no picture. Why??? Jacob

  • Transfer 1 asset to multiple assets

    I'm looking for the functionality to transfer 1 asset to multiple assets in one in one transaction.  In transaction code ABUMN, there is a "multiple asset" functionality but it cannot be used to transfer 1 asset to multiple assets.  SAP will give an