Bex  Custom variable exit

Hi BW Folks,
I need to build a Bex Variable fiscal year/period that when the
var 1: user enters the value
var 2: custom exit that will get me the data for current quarter
Q1[1,2,3]  Q2 [4,5,6]  Q3[7,8,9] Q4 [10,11,12]
e.g.: User enters 008.2007 then the current quarter will be Q3 (7+8)
e.g.: User enters 010.2007 then the current quarter will be Q4.(only 10)
Any suggestions will be reciprocated with lots of points.
thanks

1. Create Customer Exit Variable on your Calender Quarter IO with accepting Select Options (not ready for Input).
2. Create User Exit Variable code in CMOD. 
IF I_STEP = 2.
case <u>'VAR 2'</u>
  SORT I_T_VAR_RANGE BY VNAM.
  READ TABLE I_T_VAR_RANGE INTO LOC_VAR_RANGE
                          WITH KEY VNAM = <u>'User Enter enabled Variable i.e. VAR1'</u> BINARY SEARCH.
  IF SY-SUBRC = 0.
    if LOC_VAR_RANGE-LOW+4(3) <= 003.
      L_S_RANGE-SIGN     = 'I'.
      L_S_RANGE-OPT      = 'BT'.
      L_S_RANGE-LOW = '001'.
      L_S_RANGE-HIGH = LOC_VAR_RANGE-LOW+4(3).
     APPEND L_S_RANGE TO E_T_RANGE.
  elseif LOC_VAR_RANGE-LOW4(3) > 003 and LOC_VAR_RANGE-LOW4(3) <= 006.
      L_S_RANGE-SIGN     = 'I'.
      L_S_RANGE-OPT      = 'BT'.
      L_S_RANGE-LOW = '004'.
      L_S_RANGE-HIGH = LOC_VAR_RANGE-LOW+4(3).
     APPEND L_S_RANGE TO E_T_RANGE.
  elseif LOC_VAR_RANGE-LOW4(3) > 006 and LOC_VAR_RANGE-LOW4(3) <= 009.
      L_S_RANGE-SIGN     = 'I'.
      L_S_RANGE-OPT      = 'BT'.
      L_S_RANGE-LOW = '007'.
      L_S_RANGE-HIGH = LOC_VAR_RANGE-LOW+4(3).
     APPEND L_S_RANGE TO E_T_RANGE.
  elseif LOC_VAR_RANGE-LOW+4(3) > 009.
      L_S_RANGE-SIGN     = 'I'.
      L_S_RANGE-OPT      = 'BT'.
      L_S_RANGE-LOW = '009'.
      L_S_RANGE-HIGH = LOC_VAR_RANGE-LOW+4(3).
     APPEND L_S_RANGE TO E_T_RANGE.
   endif.
    ENDCASE.
  ENDIF.
try this and let me know.
Nagesh Ganisetti.
Assign points if it helps.

Similar Messages

  • How do I...Mimic Replacement Path with Query using Customer Variable Exits?

    Hello SDN:
    We are on BW 3.5 SP16.
    We are currently using a replacement path Query(RP) with variables
    to populate a variable in another Query(T).
    The problem we are having is with performance.
    The entry of variables in replacement path Query(RP) is optional (This is necessary there cannot be required values)
    When results from Replacement Path Query are small performance is fine. (e.g. 10 seconds)
    When results from Replacement path query are large performance suffers. (e.g. 1+ minutes)
    Users are free to leave the replacement path variables empty resulting in a large set of data to be replaced. This is the worst performance case.
    We would like to discover a way to conditionally execute the replacement path query. That is if users do not enter values for the replacement Query(RP) variables do not execute the replacement path query(RP).
    Does anyone know if this is possible within reason and in customer exit space?
    We have reviewed the situation from all angles and the requirement for the replacement path FUNCTIONALITY and the freedom for the user to leave variable values blank remains.
    I've been searching and reading SDN and SAP notes for about a week and do not find threads which address this situation.
    We are also exploring Customer variable exits to mimic replacement path functionality
    (different topic subject="How do I...Mimic Replacement Path with Query using Customer Variable Exits?")
    Any help will be appreciated
    Many thanks
    David Schuh

    My appologies-I posted this message with the wrong subject. I will repost it with appropriate subject.
    dave schuh

  • 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

  • BEX - Custom variable

    Hello experts,
    I need you one more time to help me write abap code...
    In a query, a mandatory variable for multiple values (ZS_ZBILL_TYPE) is populated by the user.
    I need to check if the value 'ZRE' was selected in this variable. If yes, the result of an other variable (TEST_CREDIT) will be the same result. Otherwise, I put a fake value (XXX).
    Unfortunately, my code doesn't work...
    Can you have a look to this and tell me what's wrong ?
    Thank you very much in advance.
    Jacques
      data: loc_var_range_2 LIKE rrrangeexit.
      when 'TEST_CREDIT'.
        loop at i_t_var_range into loc_var_range_2
                        where vnam = 'ZS_ZBILL_TYPE' and low = 'ZRE'.
        endloop.
        IF sy-subrc NE 0.
          loc_var_range-sign = 'I'.
          loc_var_range-opt = 'EQ'.
          loc_var_range-low = 'XXX'.
          APPEND l_s_range TO e_t_range.
        ELSE.
          loc_var_range-sign = 'I'.
          loc_var_range-opt = 'EQ'.
          loc_var_range-low = 'ZRE'.
          APPEND l_s_range TO e_t_range.
        ENDIF.

    Hi guys,
    Thanks for your proposals. I changed the code like following and the TEST_CREDIT returns 'XXX' in any case. I don't understand why the condition is not taken into account.
    Reminder:'ZS_ZBILL_TYPE is a variable with multiple values.
    Any idea ?
    Thanks.
    Jacques
        case i_vnam.
    when 'TEST_CREDIT'.
    IF i_step = 2.
    loop at i_t_var_range into loc_var_range
    where vnam = 'ZS_ZBILL_TYPE' and low = 'ZRE'.
    endloop.
    IF sy-subrc NE 0.
    l_s_range-sign = 'I'.
    l_s_range-opt = 'EQ'.
    l_s_range-low = 'XXX'.
    APPEND l_s_range TO e_t_range.
    ELSE.
    l_s_range-sign = 'I'.
    l_s_range-opt = 'EQ'.
    l_s_range-low = 'ZRE'.
    APPEND l_s_range TO e_t_range.
    ENDIF.
    ENDIF.

  • Default value of BeX customer Exit variable not Displayed in WeBI??

    Hello Experts,
    We are stuck with a problem where WeBI report is created on top of BeX query and we are not able to see the default value of Bex Customer exit variable in WeBI run. Here is the complete scenario:
    1. One restricted KF is created in BeX, restricted with Customer exit variable on net Due date. And this variable is mandatory, ready for input, and Default value in calculated is user exit as current Week's Monday.
    2. So, by default KF data should be restricted to Monday of current week, if user does not change this value.
    3. Now, WeBI report is created on top of this Bex query, and all is working fine, i.e. we are getting variable as Prompt in WeBI, but Default value is not shown while Running the Webi Report.
    So, need your inputs on the same, if default values from BeX in WeBI is supported or not? If yes, why this is happening, and how to resolve it?
    Please notice, the restrcition is in KF only, it is not a separate restrcition on Net Due date in Filter area or in Defualt area of BeX
    and we are on SAP BW 7.1 and BOXI 3.1 SP4.
    Regards,
    Vipul
    Edited by: VIPUL GOYAL on Nov 23, 2011 9:44 PM

    Hi,
    See 1285993 - Support of Customer Exit Variables from BEx query into WebIntelligence via OLAP universe
    WebI will prompt when executed, but the default values calculated by the user exit  - do not appear.
    Note: If the BEx variable has property 'ready for input' set / enabled, then its WebI prompt shows ok, but no default value appears.
    Cause
    This behaviour expected 'by design' (in the context of the product's current limitations) as explained in the online guide below:
    Please refer to Chapter 7, page 44, document link here: http://help.sap.com/businessobject/product_guides/boexir3/en/xi3_sap_olap_universes_en.pdf
    Characteristic variable > processing type > Customer Exit  is "Supported, without user entry"                                                                               
    -->  This should be understood as meaning "User will not be shown a prompt"
    regards,
    H

  • Customized variable for Bex

    Hi Gurus;
    I am using BI 7.0. My client wants a customized variable for 0CALMONTH with 2 dialog boxes in the selection screen saying "From month" and "To Month". When you input months, say; 06.2008 in "From Month" and 08.2008 in "To Month", the output which will come is data from all the months between 06.2008 and 08.2008. The 2 dialog boxes are important in this screen. I know. it can be done through interval option in BI 7.0, but the dialog boxes doesn't appear in the first screen of the Selection Screen (Like in 3.x).Is there a way to fulfill my client's requirement? Please provide me a step - by - step guide if possible.
    Regards;
    Sumanta

    Sumanta,
       Could you please clarify
    1 ] whether you are using BEx Analyser or Web queires to execute the report? Does your query has only the custom variable as it selection parmeter?
    2] Is your Custom variable(with Interval) for 0CALMONTH is defined as mandatory / optinal ?
      If you are using Web queries and you variable is defined as optional, then there is setting that you need to do on the web template that you are using.
    Choose you web template on the properties tab> Choose Web Template parameters>under the behaviour section ,choose check box for Display variable, as the default is off. This means that if you have Custom variables that are optional on you BI query will not be display as selection screen.
    Hope this help,
    Cheers,
    Balaji

  • Questions about authorization variable customer user exit

    Dear all,
    To reduce the authorization maintenance effort, I found from the web that we can use authorization variable with customer user exit RSR00001.
    When I use the transaction CMOD to display the maintain the user exit RSR00001, the user exit does not found. I would like to know how can I use thie user-exit?
    My SAP version is R/3 4.7
    The information of authorization variable  from web is as follow:
    http://help.sap.com/saphelp_nw04/helpdata/en/6d/58f438114ee836e10000000a114084/frameset.htm
    Would anyone have some ideas to solve my questions?
    Many thanks
    Sunny
    Edited by: LI Sunny on Aug 3, 2010 12:08 PM

    Dear Bala Duvvuri,
    Firstly, many thanks of your reply.
    Actually, what I want to do is to call some user-exit when performing authorization checking. I want to add some logic to the authorization checking and the user exit can be called automatically when performing authorization checking.
    I mainly use this checking in the FI module.
    Are there any ways I can perform this checking?
    One more findings, I have another machine containing SAP XI, I can search the user exit RSR00001. but it doesn't exit in SAP R/3 4.7. Is it version issue or my SAP R/3 4.7 doesn't contain the BI module?
    Many Thanks again.
    Sunny

  • About Variable exits(Customer exits)

    Hello gurus
    Could u give me some documentation on variable exits. How and when it is required? Give me some examples mainly on customer exits so that i can practice it.
    It will be very much thankfull to u all guys. u can send me a mail to me i.e [email protected]
    regards
    Ajay

    Can you send me those documents to [email protected]
    Thanks,
    Nikki
    Hello Gupta, I am not able to give you points. Can you direct me again.
    Thanks for the docs

  • VARIABLE EXITS

    Hi floks;
    I need some information on why and how to create variable exits in BEx? can you please give me and business scenarios why to create variable exits and virtual KF exits? any documents would be highle appreciated also. [email protected]
    Regards:
    Gandaki

    Hi,
    Customer or Variable exit is done in CMOD transaction. There are 2 kinds of Exit project available for BEX one at the Data target level EXIT_SAPMRSRU_001 and one at the query level EXIT_SAPLRRS0_001.
    Please see document below,
    http://help.sap.com/saphelp_nw04/helpdata/en/f1/0a56f5e09411d2acb90000e829fbfe/content.htm
    Hope this helps
    Arun

  • Reg Variable exit

    Hi Bw xpertz
      Is there possibility to use variable exits in a query?
    If possible how? if not HOw?
    Can any one give the clarification please..
    Thanx IN Advance
    Regards
    Krish
    Bangalore

    Hi krish,
    we have SAP Exit variables as well as Custmoer exit variables.
    for customer exits in variables...we have to choose processing type as 'customer exit' while creating a variable..corresponding code should be written in CMOD transaction in BW.
    pl refer this post to download how to do...documnet.
    customer exit help
    Take a look at
    User exit
    Re: User Exit for Global Variables
    Re: User exit for BEX vaeiable
    Re: Where do I write the code for customer exit variable?
    Hope this helps in understanding about user exits in variables.
    Please don't forget to assign points if it helps
    regards

  • Help in Variable exit in Bi 7.0

    Hi Experts,
        For my requirement  I need write a variable exit in BI 7   based on start date and end date.1)If  user enquiry date is  lies between current month +last 2 month then get data of 3 months ie current month( complete data   before current week) + last 2month.  2)If user enquiry date lies beyond (current month + last 2 months ) then he get only data on which date lies.Can any suggest me how write variable exit  for requirement and what would be abap code i need  in variable exit.
    Thanks
    Vinod
    Edited by: vinod  kumar on Jan 27, 2009 5:35 AM

    Hi Vinod,
      Check here.........
    Customer Exit variable
    Customer Exit for Query Variable
    Customer Exit for Query Variable
    Re: variable customer exit
    Thanks,
    Vijay.

  • Custom Conversion Exit for a Custom InfoObject

    Has anyone created a custom conversion exit for an InfoObject?
    I have a requirement to mask the first five digits of the Social Security Number on output only. I created a custom conversion exit ZCONV, for example and added code to the output function module CONVERSION_EXIT_ZCONV_OUTPUT to accomplish the masking. In the CONVERSION_EXIT_ZCONV_INPUT, I just passed INPUT to OUTPUT.
    It works OK for masking the output results but any input variables return an "Invalid Format" error. So I am not able to have a selection screen variable where you enter the SSN number and run the query for it. It tries to convert it to the masked form and then run the query.
    Any pointers. Helpful answers will be promptly rewarded.
    Thanks
    Vineet

    Since the ultimate goal was not to display Social Security Numbers, I changed the custom Conversion exit to display SID values. In case anyone needs to do the same, The output function module CONVERSION_EXIT_ZCONV_OUTPUT  is coded to read the SID value for the SSN number from the SID table of the InfoObject and the input function module CONVERSION_EXIT_ZCONV_INPUT does the reverse by reading the SSN number for the SID.
    Dropdowns on variable values work OK by displaying the SID value and the employee name. The only drawback is that you cannot input a SSN number on the selection variable. You have to do the dropdown and select.
    Thanks
    Vineet

  • The window to select dimensions simply does not appear and I can't move forward, due to variables exit in the report

    Dear experts,
    I am having an issue when I try to create a WEBI document using Bex query through OLAP connection (Bics).
    Due to variables exit, it is not possible to open query pannel in webi to choose wich dimensions to add to the webi document.
    The window to select dimensions simply does not appear and I can't move forward!
    In RSRT ou Bex Analyzer, the query is running fine without errors.
    CMOD code is like this (I believe there is not any error as it is working flawless on other reports for other variable names):
    WHEN 'ZREDT1'.
         IF i_step = 2.
           CLEAR wa2.
           READ TABLE i_t_var_range INTO wa2 WITH KEY vnam = 'ZRE_DT_IN'.
    *      wa2-low = |{ v_year_h }12|.
           IF sy-subrc EQ 0.
             v_year_h = wa2-low(4) - 1.
             CONCATENATE v_year_h '12' INTO wa1-low.
    *        wa1-low = wa2-low.
             wa1-opt  = 'EQ'.
             wa1-sign = 'I'.
             APPEND wa1 TO e_t_range.
           ENDIF.
         ENDIF.
        WHEN 'ZREDT2'.
         IF i_step = 2.
           CLEAR wa2.
           READ TABLE i_t_var_range INTO wa2 WITH KEY vnam = 'ZRE_DT_IN'.
           IF sy-subrc EQ 0.
    *        wa2-low = |{ v_year_h }12|.
             v_year_h = wa2-low(4) - 1.
             CONCATENATE v_year_h '12' INTO wa1-low.
             wa1-opt  = 'EQ'.
             wa1-sign = 'I'.
             APPEND wa1 TO e_t_range.
           ENDIF.
         ENDIF.
    Please provide assistance,
    Thanks in advance,
    Kind regards,
    André Oliveira

    I solved it.
    The problem was due to date coming to exit - as you know some time intervals start at 01-01-1000, and as I was calculating 1000-1 = 999
    I was getting and interval from 99901 to 201405. Do not know if it was not working because CHAR NUMC6 was failing trying to recognize interval 99901 - 201405, but probably, this was the issue.
    Thanks for your inputs,
    Best regards,
    André Oliveira

  • Variable Exit

    Hi People,
    I am trying to make a Variable Exit on the caracteristic 0SEM_POSIT. I Already made the code in the program ZXRSRU01 and when i make some test on the transaction RSRT, its showed the erros below:
    00000005  EError for variable in customer enhancement V_CTPL BRAIN 649
    00000005  EVariables contain invalid BRAIN               633
    00000005              I>> Row: 78 Inc: LRRMSU13 Prog:SAPLRRMS                                                                                RS_EXCEPTION        301
    00000005              ASystem error in program CL_RSR_OLAP_VAR and form INIT-02- (see long text)                                                           BRAIN               299                                                    
    Someone already saw these erros ??
    Thanks

    Hi,
    Note specified for this issue: 1042703, which suggests to install Support Pack 14.
    Do a manual correction for the Program as specified in the correction instructions of the note 1042703.
    Corrections:
    Delta 001Context Block 
      CLEAR: p_sx_seldr.
    *... read the VREP
      readvrep( i_vrnid ).
    Delete Block 
      IF p_sx_vrep-range IS INITIAL. RETURN. ENDIF.
    Insert Block 
      IF p_sx_vrep-range IS INITIAL.
      arbritary seltyp (initial is not allowed)
        r_seltyp = rsdd_c_seltyp-range.
        RETURN.
      ENDIF.
    Regards,
    Srinivas.

  • Dynamic filtering with BEx query variables in WebI 3.1

    Hi experts.
    Can anybody help me ?
    1) I use BEx query variables in WebI 3.1 .  But i can't understand how to order fields of selection screen in WebI reports
    2) How can i use Dynamic filtering with BEx query variables in WebI 3.1 ?
        It's need that  list of second field on selection screen will be accoding to result of selection first field on selection screen and so on .
        Need i use BEx user-exit variables ?
    Thank you

    Hi,
    1)  Variable sequence isn't respected in XI3.1 - and can't be modified in OLAP.unv  (this enhancement exists in 4.0 )
    2)  Dynamic filtering?  Yes, Exit routines are the best way to go for this.
    Regards,
    H

Maybe you are looking for