ABAP routine for DTP fiscal year/period filter

Hi All,
Delta loads are which not possible for when the transformation source is an InfoSet.  To limit the data in these loads, currently a filter is set in the DTPs on fiscal year/period so only load the current month and 2 prior months are loaded.  This filter has to be updated each month for each of the DTPs manually.  To eliminate this monthly task a dynamic filter (routine) needs should be used rather than a static filter. Can anybody help me in providing the logic
Regards
Siri

data: l_idx like sy-tabix.
read table l_t_range with key
     fieldname = give field name .
     Data : Year(4) type n,
               period1(2) type n.
               period2(2)type n.
Currper = sy-datum+4(2) .
period1 = currper-1 .
period2 = currper-2.
year = sy-datum+0(4).
concatenate  year currper to P1.
concatenate  year period1 to P2. // define P1 , P2 , P3 as 0fiscper .
concatenate  year period2 to P3.
l_t_range-sign = 'I'.
l_t_range-option = 'BT'.
l_t_range-low =  P3.
l_t_range-high=  P1.

Similar Messages

  • Variable for Fiscal Year Period in cube "0ECCS_C01" - Urgent

    Hi all,
    I have created a query based on cube "0ECCS_C01". I have restriced the characterstic " Fiscal Year Period" on  "Period/Fiscal Year (Single Value Entry, Required)" variable. Output of the query are just 2 numbers : sum of "cumulative value GC" and sum of "period value gc" for given period. This query is working fine in query designer. The variable takes input in following form "001.2008". I have checked that in analyzer that the 'key' value of the variable is in this format "001.2008".
    Now in VC , when i place "001.2008" in start point coding for fiscal year, it is giving error. Can any one please tell me that why it is throwing an error.I have given the same format as i gave in query designer. or shud i give period in some other format??
    Please respond.
    Regards,
    Aisha Ishrat
    ICI Pakistan Ltd.

    Hi,
    can you give us further information about the data type in the cube resp. the infoobject, which is used in the cube for the fiscal year/period?
    Maybe you can try 0002008. Can you check which values you can enter when you execute the query in the web, so that the value helps for the variable comes up?
    Best Regards
    Marcel

  • Current fiscal year period in BEx

    Hi,
    I have a requirment. i have a BEx query, that query is a source of APD and data is store in direct DSO.
    i need to run this query every month and load current fiscal yer period data into the DSO.
    i need BEx variable to filter the data for current fiscal year period.
    I have fiscal year period char. in query definaton
    Please help me to get this.
    Thanks.
    Edited by: Pria Gupta on Nov 24, 2011 2:18 AM

    Use variable 0F_CUFPE Current Period of Fiscal Year (Formula Variable)
    Re: how to get default value fiscal year period in Variable
    Regards,
    Sushant

  • Error while entering the Fiscal Year/Period Variable

    I keep getting the following error message when I try to input or select the Variable on the report that has been executed on the Portal. Everything is fine when done through Bex.
    <b> Please enter value in permitted format for variable Fiscal Year/Period (Selection Options, Optional).
    Entry needs template  ___/____
    For characteristic , enter value in a permitted format</b>
    Would anybody have any clue as to why?? It does have the Fiscal year Variant.
    Thanks

    This is fxed in BI JAVA SPS 12 Patch 2. Not sure whether there is any OSS notes for earlier SPS.

  • Selection criteria is fiscal year/period but need to restrict KF by date

    Hi,
    I have query where selection criteria is based on fiscalyear/period and in result I need to have Netvalue for all the sales order by created on date for that fiscal year/period.
    For eg if I have entered fiscal year/period as 008.2007, I should get net value for all the orders that have created on date between 08/01/2007 to 08/31/2007.
    Can anyone help me about this please.

    Hi DV
    Here is the code
    put it in I_STEP=2
    WHEN 'EXIT NAME"
    READ TABLE I_T_VAR_RANGE INTO loc_var_range with key vnam = 'userinput variable name'
    v_fiscal_year = loc_var_range-low_0(4)
    v_period = loc_var_range-low+4(3)
    CALL FUNCTION 'FIRST_DAY_IN_PERIOD_GET'
              EXPORTING
                i_gjahr              = v_fiscal_year
              I_MONMIT             = 00
                i_periv              =  Give your fiscal year variant name
                i_poper              = v_per
             IMPORTING
               e_date               = v_date_beg
             EXCEPTIONS
               input_false          = 1
               t009_notfound        = 2
               t009b_notfound       = 3
               OTHERS               = 4.
            CALL FUNCTION 'LAST_DAY_IN_PERIOD_GET'
              EXPORTING
                i_gjahr              = v_fiscal_year
              I_MONMIT             = 00
                i_periv              =  Give your fiscal year variant name
                i_poper              = v_per
             IMPORTING
               e_date               = v_date_end
             EXCEPTIONS
               input_false          = 1
               t009_notfound        = 2
               t009b_notfound       = 3
               OTHERS               = 4.
            CLEAR s_range.
            MOVE:
              v_date_beg TO loc_range-low,
              v_date_end TO loc_range-high.
              loc_range-sign = 'I'.
              loc_range-opt = 'BT'.
            APPEND s_range TO e_t_range.
    Thanks
    Tripple k

  • Custom exit variable for fiscal year/period

    Hi BI Experts
    1) In one of the column i just want Budget data to be displayed for the entire year..i.e even if the user enters 005/2006 for fiscal year /period that column should display 001/2006 to 012/2006 Budget.
    I have created a restricted KF for 0AMOUNT restricted by version(for Budget), valuetype (for Budget )
    now how do I assign variable for Fiscal year/period...and the problem is posting period is not populated ...I mean there is no transformation for that...
    Can you share your experience on that ...full points wil be awarded...
    Thanks

    Hi Ajay and Pradhiba
    I am really sorry for assigning you guuys points ...wasa bit busy ...
    The problem is that the year and posting period is not populated...there fore I cannot use those time characteristics...
    Now I have only fiscal year/period populated..now i want
    if the user enters 005/2006 ....i want my first column to calculate the data for 001/2006 to 012/2006 ...thats the req...
    can u share ur ABAP experience in that...
    thanks

  • Custom variable for fiscal year/period

    Hi BW Experts,
    My problem is only fiscal year/period is populated
    (fiscal year and posting period is not populated) and I need to have a custom exit ...that if the user enters 006/2007 i need to have a varaible which will contain 001/2006 to 012/2006 ..i.e data for entire year.
    It doesnt matter which year the user enters ...i should fetch data for the entire year
    I am very weak in ABAP programming ..if any body can share their experience..I would appreicate with full points
    Thanks

    Create a customer exit  variable(not ready for input) var1 with interval
    var2 is a ready for input variable that take the value entered by the user.
    IF I_STEP = 2.
    WHEN 'var2'.
          DATA: v_mth_beg TYPE d,
                     v_mth_end TYPE d
          REFRESH e_t_range.
          CLEAR l_s_range.
          LOOP AT i_t_var_range INTO loc_var_range
                   WHERE vnam = 'var1'.
            EXIT.
          ENDLOOP.
          CONCATENATE loc_var_range-low+0(4) '001' INTO v_mth_beg.
          CONCATENATE loc_var_range-low+0(4) '012' INTO v_mth_end
          l_s_range-sign = 'I'.
          l_s_range-opt = 'BT'.
          l_s_range-low = v_mth_beg.
          l_s_range-high = v_mth_end.
          APPEND l_s_range TO e_t_range.
    try this out.Hope it helps.
    Regards,
    Rakesh

  • Texts for Fiscal Year Period

    Hi all
    We are currently using Fiscal Year Variant Z6(July - June, 4 special periods).
    When we display the texts for Fiscal Year Period in a Query it displays as CALMONTH FISCYEAR. E.g. July 2004, which is FISCPER 01.2004 but Calmonth 07.2003 (July 2003). I want the texts to display as the correct calendar year month, not as a combination of calendar month with the fiscal year.
    I have tried to maintain the texts of 0FISCPER, but I get the following message "The master data table of char. 0FISCPER is not generated, operation terminated"
    Has anyone managed to solve this problem?
    Thanks in advance
    Chami

    Chami,
    I see the problem. The Year Part of the Text is wrong.
    Unfortunately this means that Fiscal Year cannot be used to display the texts.
    The solution to your problem is to have the description from the calendar month/year in the column headings by adding the calendar period to the data target, convert the fiscal period to calendar period on data loading (using provided date conversion functions in the formula builder) and use it for display purposes. The fiscal year is still used as selection criteria (as a filter)
    The other solution is to have text variables created from the Calendar period and used in the column headings
    Hope that helps!
    Rishi

  • FM for month and year to Fiscal year period

    Hello ABAP Experts,
    Please suggest a FM to convert month+year to fiscal year period.
    Suggestions appreciated.
    Thanks in advance,
    BWer

    use the function moduleGM_GET_FISCAL_YEAR
    pass date and fiscal year variant as 24..
    see all the values of the fiscal year variant in the table T009
    Check with fm FI_PERIOD_DETERMINE
    Thanks
    Seshu

  • Formula to calculate two fiscal year/period difference for non null quantit

    We'd like to have a query result like the following:
    Person -- Jan_2007 -- Feb_2007 -- Mar_2007  --  No. of Months
    Tom --- 21 --- 54 --- 10 --- 2
    John --- 0 ---  3 --- 15 --- 1  
    In the above query, the row is sales persons, the 1st three columns list the sales quantity by each sales person restricted by fiscal year/period and we would like to create 4th column "No. of Months" to calculate (will use formula) the month span (difference) for each sales person from his last sale activity (the last month he performed sales) and the 1st sale activity (the first month he performed sales) as listed in the above query result, e.g.,  Tom performed his first sales (sales quantity: 21) in the month of January of year 2007, and he performed his last sales (sales quantity of 10) in the month of March, 2007, then the "No. of Months" column value for Tom is 2.  The calculation formula will be performed based on the last quantity value (> 0) to trace it's corresponding column fiscal year/period value (max of the fiscal year/period value with quantity value >0) and on the 1st quantity value (>0) to trace it's corresonding column fiscal year/period value (min of the fiscal year/period value with quantity value >0) and then do the subtraction between the max of the fiscal year/period value and the min one. 
    Would be appreciated if BEx experts here give the detailed steps on how to build up this formula to calculate the number of month difference and we will give you reward points!
    Edited by: Kevin Smith on Mar 18, 2008 1:47 PM

    hi Danny,
    I only gave an example of 3 columns, but actually, yes, the report can have more than 12 months, e.g. from Jan_1999, Feb_1999, ..., Mar_2011, Apr_2011.
    In our simple example of 3 columns for the three consecutive months, if John had (3)(0)(15), then the No. of Months is 2, or the last month value he performed sales and 1st month he performed sales.
    You said macro in Excel sheet?  Not sure if macro will work on web since we will eventually run the reports on web browser, therefore we still prefer using Formula.
    Any idea/solution?
    Thanks!

  • New posting period for former fiscal year

    Hello All!
    For a customer we set up a database with posting periods for 2011 and 2012 (monthly periods). The database went live in 2011.
    Now the requirement came up to post the opening balances for 2011 per end of 2010 (to have the postings not in fiscal year 2011).
    My question is: is it a problem to add now a fiscal year 2010 (yearly basis)?
    Thanks and regards
    Peter Ganserer

    Hi Peter,
    Although it is your 2nd posting, I would add welcome message because I had not do so 1st time.
    For your question, it is not possible to add new posting period for former fiscal year. You best solution is to post those OB as the first date of the first period.
    Thanks,
    Gordon

  • Text variable for Fiscal year/period

    Hi gurus,
    We are on BI 7.0 (PL 15). In G/L i am using the standard 0FISCPER text variable 0T_FPERF in the columns, which should e.g. produce the text "04.2008".
    However instead it displays "4  .0800". Adding Fiscal year/period 0FISCPER to drilldown shows a correct format in the rows "APR.2008", so the problem seems to be only with the text variables.
    I have checked on a reference 7.0 system where the same variable is working fine, so i assume that some fix must be available. Any hints as to what should be performed to correct this display error?
    Points will be rewarded.
    BR
    Morten

    Hello Jamspam,
    I had a similiar problem with indicators in BEX. I had an numerical indicator that displays me value in a very weird way.
    My solution was to upgrade my frontend, with SAP Business Explorer patch.
    Have you got the latest BEX patch (or others) on your frontend? No guarantees that will solve your case, but for me it worked
    Regards,
    Bruno

  • Custome variable exit for fiscal year/period

    Hello BW Gurus,
    Q1[1,2,3] Q2[4,5,6] Q3[7,8,9] Q4[10,11,12] quarterly periods
    I have a custom variable exit as shown for fiscal year period
           IF LOC_VAR_RANGE-LOW+4(3) =< '003'.
              L_S_RANGE-LOW+4(3) = '001'.
           ELSEIF LOC_VAR_RANGE-LOW+4(3) > '003' AND
                                              LOC_VAR_RANGE-LOW+4(3) =<'006'.
              L_S_RANGE-LOW+4(3) = '004'.
           ELSEIF LOC_VAR_RANGE-LOW+4(3) > '006' AND
                                                LOC_VAR_RANGE-LOW+4(3) =< '009'.
              L_S_RANGE-LOW+4(3) = '007'.
           ELSE.
              L_S_RANGE-LOW+4(3) = '010'.
           ENDIF.
    Now this works fine to give me the Current Quarter ....say if user puts 005/2007 i get the data Current quarter as [4+ 5] i.e. April and MAy data. Now for <b>Previous Period</b> I gave an offset as -3 to -1 inorder to get data for Q1[123] but the requirement is changed and I want the same time period i.e. [1+2] and not the entire quarter since the Current Quarter calculates only for 4 and 5.
    I hope u are getting my point....please give your suggestions will reciprocate with lots of points

    Hi gaurav,
    Basically If I am selecting period 005 I am getting the data for 4 and 5 as Current Quarter i.e. April is the starting period of that Q2.
    Similarly the previous Quarter should also give me data for period 1 and period 2.
    Right now the offset I gave is -3 to -1 on my custom variable so i am getting data for the entire previous quarter which is Q1[1,2,3] but in reality i just want data for period 1and period 2.
    Can you please help me in this
    Appreciate your concern
    Thanks

  • BSC:  Display values for Fiscal Year/Period

    Hi all,
        We are trying to create a small test scenario to know about balance score card. We have a cube which has Actual and Plan data in one KF diffentiated based on Value type character. Time character is fiscal year/period.
    We want to display a graph which displays actual and plan for fiscal year/period wise. But when we execute the score card it shows the total year's plan and actual for the individual fiscal year/period. But ideally it should display actual and plan for the respective fiscal year/period.
    we have created two value field in the measures of score card. and formula a/b (Plan / Actual ) is used.
    Please guide us in solving the problem.
    Regards,
    PM

    <FONT FACE = "Tahoma", Font Color = "Blue">
    Hi
    <Br>
    Do you have Fiscal Year Period in the Rows of your BW Report? If not, please try that.
    <Br><Br>Hope it helps.
    <Br>
    Cheers
    Abhijit
    <Br>* It's a good habit to reward someone with points in SDN if you think his/her
    response was helpful to you
    </FONT>

  • Invalid value for Fiscal year/period

    Hi all,
      I have an user exit variable which populates the fiscal year period value from two separate fields.
    1) Fiscal Period
    2) Fiscal Year
    But when I contatenate it and place it in the format 200601 the report in BEx gives me the error
    "Value 200601 for user-exit variable ZRMA_FIP is invalid"
    ZRMA_FIP is my variable name
    The code I have is:
    WHEN 'ZRMA_FIP'.
      l_yr_zrma_fip = l_v_cur_year.
      l_per_zrma_fip = l_v_cur_period.
      CONCATENATE l_yr_zrma_fip l_per_zrma_fip INTO
    l_calmth_zrma_fip.
            r_vari-low = l_calmth_zrma_fip.
            r_vari-sign = 'I'.
            r_vari-opt = 'EQ'.
            APPEND r_vari TO e_t_range.
        ENDCASE.
    I thought I had to take care of internal/external format but nothing is working...can anybody help?
    thanks

    Hi
    I have demo code
    hope that will help u.
       WHEN 'ZMXFIPED'.
    clearing the storage areas used above.
         CLEAR: l_s_range , loc_var_range .
    checking step if it is after inputing the variable value.
         IF i_step = 2.                "After selecting of input variable
    looping at interval range table .
           LOOP AT i_t_var_range INTO loc_var_range WHERE vnam = 'ZMSFPER8'.
    assigning values to year and period values.
             l_year_exit   = loc_var_range-low+0(4).
             l_period_exit = loc_var_range-low+4(3).
    putting the from and to values together with year and period values.
             CONCATENATE l_year_exit '001'  INTO l_s_range-low .
             CONCATENATE l_year_exit l_period_exit INTO l_s_range-high .
    sign I-> includes the range between.
             l_s_range-sign =  'I'.
             l_s_range-opt =   'BT'.
    appending the fianl interval range table.
             APPEND l_s_range TO e_t_range.
    exiting after appending.
             EXIT.
           ENDLOOP.
    clearing the storage area for next iteration.
           CLEAR: l_s_range .
         ENDIF.
    by using tha logic u can try.

Maybe you are looking for

  • How can I Setup my Email Account in Mavericks?

    The existing description on Apple support is not valid. There ist no possibility to setup the account manually to e.g. IMAP. Best regards

  • Error while extending two interfaces.

    I am using Weblogic Integration 8.5. When an interface extends two interfaces. Out of which one has a clone method declared. <br> This IDE is giving error as <br> ERROR: Sample.java:3: This type inherits two versions of method java.lang.Object clone(

  • No face time on iPod touch 5

    when i buy my iPod touch 5 i didn't find face time in the home screen or setting . how can i use it ?

  • Profit Center error in F-02

    Hi, I am passing following entry for transferring invoice amount into retention using TCode F-02 Entry: Vendor A A/c...  Dr (Special GL R, posting key 24)    To Vendor A/c A (posting key 39). There i want to enter profit center manually. But SAP does

  • Slow Internet Speed after Leopard

    I'm having a funny problem since the installation of Leopard and that is very slow internet browsing speed. But its not as simple as it sounds. I have another Windows PC on the same network; when its on mac internet speed is slow, when Windows PC is