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

Similar Messages

  • Fiscal Year Period User Choice to Restrict the Balance wrt to version

    Hello friend, I have a Budget Balance key fiegure. which has values for a period say 001.2007  4 Values . sum equal = 13035
    Now I want to Create a Current Period Balance in Report and YTD Balance in Report
    For Current Period I did this as below but it is not working
    <b>
    Restricted Key Figure Budget Current period</b>
    Budget Balance key fiegure
    Restrict with Value Type for Budget Data = 90
    Restrict with Fiscal Yr/ Period User Enter Variable  say user enter 006.2007
    Restrict with Version Type for Budget Data = User Choice say user enter  20
    I am still not getting the correct Current Period balance in rep it always take january 2007 balance.
    Now same for YTD
    Restricted Key Figure Budget Current period</b>
    Budget Balance key fiegure
    Restrict with Value Type for Budget Data = 90
    Restrict with Offset Range January Customer Exit Variable -- Fiscal Yr/ Period User Enter Variable  say user enter 006.2007 so it will be 001.2007 --006.2007
    Restrict with Version Type for Budget Data = User Choice say user enter  20
    I am still not getting the correct YTD Period balance in rep it always take January  2007 balance.
    Please help me with the logic to work this CURRENT PERIOD BALANCE  AND YTD
    iF You have any code you can send me at [email protected]
    Thanks
    Soniya

    I am just pasting my answer to your other post...
    but is your RKF restricted to both variables?
    Hi,
    you can remove the OR I_STEP = 3, doesn't do anything....
    . make sure that 'ZVR_YTDBUD' is an interval var, <b>NOT</b> ready for input
    . make sure that 'ZVMFISCPER' is mandatory
    . I guess that you have filetered FISCPER with both variables thus it will be filtered with the signle value of 'ZVMFISCPER'; if this is the case, try the following:
    Include a restricted key figure in your report filtered on 'ZVMFISCPER'; hide it
    Remove 'ZVMFISCPER' from the 0FISCPER filter of your other RKF in order to keep only the 'ZVR_YTDBUD'.
    Otherwise the code looks good except that we don't see how YTD_CURRENTYEAR and YTD_YEARH are declared...
    hope this helps...
    Olivier.
    Message was edited by:
            Olivier Cora

  • How to give the Fiscal year period in RSA3 for checking the data.

    Hi BW Experts, good morning.
      We have loaded the data monthlywise with selection parameters as Fiscal Year Period(FISCPER).
      While checking the data consistency in both R/3 and BI, the selection parameter which i have given  is in the format of         001.2005   
      I got the records in BI side.
      But if we give the same format In RSA3 in the Fiscal Year Period tab , we r getting 0 records.
      So kindly help me how to  enter the selection parameters for 1 month.
        Thanks
                  Anjali

    Hi sanyam ,
       Thanks for the help.
      I got it now.
      Thank you so much
      Bye
                   Regards
                         Anjali

  • Data selection Fiscal year/period in info package

    Hi Experts,
    I loaded the data from application server to my data target and load completed with lot of records, but as per my requirment i need to load Fiscal year/period 001/2010 to 012/2010. I just giving selection in info package like 001/2010 to 012/2010  and i excute load it sowes no records, make sure in application server we have lot of records for this period.
    CAn any one tell me how can i give format in infopackage.
    Thanks in advance
    David

    Hi,
    Select range in correct format. Instead of giving manually, You can select from system. This can be wrong format of selection.
    Thanks,
    SAC

  • Q1: Secondary Index. Q2: Fiscal Year /Period

    Hi gurus,
    I have two questions need your explain:
    Q1: To improve the query performance I am going to create some secondary indexes on an ODS, I am wondering whether this action will remove the data from the ODS therefore I have to reset the data loading process and if these indexes can be maintained while data loading automatically ?
    Q2: About fiscal year /period which technical name is 0fiscper. we know in sales order header, item also purchase order and billing ODS or CUBEs, FY/Period are existed in those models. but there are still some other dates e.g. delivery date, goods issue date, goods recieve date, document date, posting date and so on. So which date is used to generate FY/Period ?
    Thanks in advance
    Edited by: Leon Ouyang on Dec 3, 2008 4:27 PM
    Edited by: Leon Ouyang on Dec 4, 2008 1:26 AM

    Hi,
    1)The creation of index have no effect on the data stored and you need not delete or relaod the data.
    System will adjust the index with every data load to the DSO automatically.
    2)Fiscal year period depeneds upon the module from which you are using the data and you can tweak the logic for this suit your need.
    If the data source is providing the fiscal period values then well and good.
    If not then generally its mapped to those dates which are driving date of the query or the date which is going to be used by the user for the input selections in the report.
    for example if you want sales based on the posting date in the reports and user just wnt sale till month and not date then.......you map posting date to fiscal period in the transformation and use them in the reporting.
    This can vary too...there is no hard fast rule for what date it should be mapped...and it all depends upon the reporting requirement
    The good design practise is to fill it with the same date which is filling calday and calmonth objects.This will keep granuarlty as same...but if you want some other selection in the report then you can map calday to some other date and fiscal period to some thing else.
    Ajeet

  • 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

  • Fiscal Year / Periods does not show properly in WebI and compunding

    Hi,
    I have few reports where I am using Fiscal Year /Period as filter.
    I have created a Universe on the top of a SAP BI Query and did not do any customization.
    Then I created a WebI report. In this report I created various filters beside Fiscal Year / Period. When I run report, filter window opens. I can select all other filters but when it comes to Fiscal Year / Period it does not show me the values I want to see. It shows AUG 0001, APR 0025 etc. I want to see AUG 2010, MAR 2009 etc so that I can select them and get the data of the required Fiscal Year / Period. In Cube I have the required data. If I select MAR 0010 etc I donu2019t get any data.
    On the other hand if I put fiscal Year / Period in columns or rows it shows the right value.
    If also run SAP BI Query and Fiscal Year / Period in Variable then on variable screen I can see the right value from where I can select and get the required result.
    Do I have to do any step at Universe level or something else?
    It seems that Fiscal Year / Period is compounding.
    Is there any help?
    Thanks
    Bashir Awan

    Ingo,
    for thanks for igniting my thoughts in this regards.
    Yes these values do exist in SAP BW.
    It is some how compunding the values at filter level.
    It does not let me see the whole value when filter screen popup in BOBJ.
    In SAP whole value shows when variable screen popup, I see three columns Fiscal Year / Period. Text, Posting Period Key, and Posting Year Key.
    Fiscal year / Period Text which shows Aug 2009, Posting Period Key which shows our period 1 to 16, and Fiscal year key which shows 2009 etc.
    Is there any setting in BOBJ which compunds the year for variable screen so that we may see the whole values for filters?
    thanks

  • 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.

  • Up to the period : Fiscal year period Exit variable is not working

    Hi Experts,
    I have the following code to get the upto the Fiscal year period variable .It shoudl fetch the Values  From the starting of the Fiscal period like 2009001 whatever the  period user enters.But currnelty it is not woking.Please let me know am I doing any mistake in code.currently it is only fetching for the month user enters not up to the period.
    Prasad
    Variable Name : ZUPTOPER
    User Entry  Var : 0P_FPER
    WHEN 'ZUPTOPER'.
        IF i_step = 2.
          LOOP AT i_t_var_range INTO loc_var_range
          WHERE vnam = '0P_FPER'.
            fper = loc_var_range-low.
            fper+4(3) = '001'.
            CLEAR l_s_range.
            l_s_range-low      = fper.
            l_s_range-high     = loc_var_range-low.
            l_s_range-sign     = 'I'.
            l_s_range-opt      = 'BT'.
            APPEND l_s_range TO e_t_range.
            EXIT.
          ENDLOOP.
        ENDIF.

    Hi Prasad,
    This would be happening if you have put the user entry variable in the global filter of your query.
    As a result the complete data set is restrcted to get the data only for one month.
    Please use the variable for user entry month in a selection and not globally.
    -Vikram

  • Issue with Fiscal Year period - Variable

    Hello,
    I have requirement where I have two fiscal year variables selections available for the users. Both are independent to each other. FOR EX: A & B
    1ST Fiscal year period is straightforward. It is a single variable selection where User enters the fiscal year period then the Key figures data will be available to the user for that particular fiscal year what is selected in the variable screen.
    For ex: If user enters 01.2007 then the values will be only for that particular month/period
    However, the 2nd Fiscal year period user wants a Range (From and to). This is also a Single selection variable. Here user enters only TO value, which it should go and get the lower value from first variable screen and then it should take the higher value from the 2nd Variable screen and should calculate the result as a range.
    How this can be sorted? Can someone please help me to sort this Issue? If we need a customer exit, can you please give me some sample code?
    Thanks in advance
    Harish

    Hi,
    Create 3 variable
    One for from variable which will user input ZVAR1
    2nd to variable will be user input              ZVAR2
    3rd variable be variable exit type              ZVAR3
    In exit populate the VAR3 by reading the two user input variable.
    and use the option
    Try this:
    <b> when 'ZVAR3.
          if i_step = 2.
            read table I_T_VAR_RANGE into z_t_var_range
                            with key VNAM = 'VAR1'.
            read table I_T_VAR_RANGE into z_t_var_range1
                            with key VNAM = 'VAR2'.
                 ZE_T_RANGE-SIGN    = 'I'.
                 ZE_T_RANGE-OPT     = 'BT'.
                 ZE_T_RANGE-LOW     =  z_t_var_range-LOW
                 ZE_T_RANGE-HIGH     =  z_t_var_range1-LOW
                 APPEND ZE_T_RANGE TO E_T_RANGE.
                 clear ZE_T_RANGE.
          ENDIF.</b>
    Thanks,
    Debasish

  • 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

  • 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.

  • Currency Tranlation Type with Fiscal Year Period

    Hello Friends, I have a requirement to Choose the Currency Conversion in Context Menu right mouse click on report and then select "Currency Tranlation Type" Monthly Average (002M) thenCurrency Tranlation Type should take the fiscal period/fiscal year as time reference for conversion. Please suggest how to do this
    since in RSCUR, When I create the Currency Tranlation Type only Time reference is Current Date etc. but we want is Fiscal year / period so that If User select
    006.2007 -0102007
    Currency for 006 2007 Should be converted as Month end rate of 006
    AND in 010. 2008 Should be converted as Month end rate of 010
    Please suggest how to do this
    Thanks
    Soniya

    Hello , Good response but thats all standard which I know. Please help me to resolve the problem as stated below
    1. I have created a Currency Translation Type " <b>FiscperConversion</b>" <b>"ZVHGR"</b> now this has Exchange Rate Type from Variable "ZVARN" (Which is a variable single value manual input on 0RTYPE Infoobject for exchange rate.)
    2. Now Currency Tab: Target Currency is selected from Variable placed in the Report. ZRPVAR.
    3. Now the Variable Time Reference is used.  Standard Infoobject 0FISCPER
    which is beginning of period.
    Now all the above is done. Let go to the query and For Value of kEYFIGURE "Audit Balance" in Conversion Tab Conversion Type is specified is "FiscperConversion" ZVHGR"same as above and thats it. <b>But the problem is here user want a variable that user can select the Conversion Type Instead of Hard coding.</b>
    Please suggest how to create this variable for Conversion Type and specify in query designer since In Conversion Tab this is not allowed to have variable.
    Please help me very soon
    Thanks
    Soniya Kapoor
    null

  • Text Variables to show Start and End Date of Fiscal Year Period

    Hi,
    I am creating a query that has user enter a starting fiscal year period and posts information by Fiscal Year Period going back 14 periods.  I am able to put the fiscal year period in the heading for all periods, but would also like to add the start and end calendar day for each listed period.  Can that be done using a replacement path text variable or is that something more for a customer exit variable?
    Thanks in advance for any thoughts provided.
    Bill

    Hi,
    This is one of my exit that display the calmonth (offset -12). Usefull when I have to retrieve in a KF a complete rolling year depending one calmonth.
    S_VMUCMN is my selection variable
    S_TXTCMN_M12 is my text variable calmonth-12
    S_TXTCMN_M0 is my text variable for selected calmonth.
    WHEN 'S_TXTCMN_M12'.
        IF i_step = '2'.
          LOOP AT i_t_var_range INTO loc_var_range WHERE vnam = 'S_VMUCMN'.
            CLEAR l_s_range.
            " First day of the selected month
            CONCATENATE loc_var_range-low '01' INTO l_calday.
            CALL FUNCTION 'YFRBW_FUM_CAL_DATE_IN_INTERVAL'
              EXPORTING
                date      = l_calday
                months    = 12
                signum    = '-'
              IMPORTING
                calc_date = l_calday.
            l_s_range-low = l_calday+0(6).
            l_s_range-sign = 'I'.
            l_s_range-opt = 'EQ'.
            APPEND l_s_range TO e_t_range.
            EXIT.
          ENDLOOP.
        ENDIF.
    Thus, in KF header you have to put the two text variable to display the complete period.
    Hope it helps,

  • 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!

Maybe you are looking for

  • DataSource 2LIS_11_VAHDR does not exist in source system ECDCLNT100 of vers

    Hi iam working on BI 7 and ECC 6 system. When i try to install the transfer rules for 2 lis_11_vahdr in BI7 business content, it gave a message that "<b>DataSource 2LIS_11_VAHDR does not exist in source system ECDCLNT100 of version A".</b> i have don

  • How to add new assignment block in opportunity

    Hi,Experts. I'm a beginer of SAP CRM. I need to add/create a new assignment block similar to existing assignment block 'Details' and display enhancement items in Opportunity screen with SAP crm 2007. I have created new view using Wizard in BSP_WD_CMP

  • How to fix the excel cell  length in the sap

    hi      i want to fix the excel cell  length in the sap. how to fix perform fill_cell1 using l_row l_col 1 wa_cat-seltext_l. i want to fix the fill_cell1 how to do. Regards, sivakumar

  • 8.0.5 & 8.1.6 rel 2

    We are installing 8i 8.1.6 Rel 2 on a Unix server that contains 8.0.5 binaries and a database. Is it necessary to do a migration of the current 8.0.5 database to version 8.1.6 Rel 2?

  • Old business, New Website design problem

    I am attempting to build an entirely new website for an old business using Dreamweaver MX. (version 6).  I want a very basic site on which to advertise my menu and to which I can post a few pictures. Obviously, I want it somewhat professional looking