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.

Similar Messages

  • BPS variables exit F4 help

    Hi,
       I am having a BPS variable exit which is listing all the records from the master data table in the F4 help screen but  i want to see only those values which are populated by my exit .
    Did any one faced the same problum? Do we have a note or patch to fix this.
    Thanks,
    Ramkumar

    Hi Ramkumar,
    Check the ABAP code behind the variable.Make sure that it is fetching the right records based on the logc in the code.Check the select statement in the ABAP.
    Debug the code and find out if its fetchin the right values into the export parameter  ETO_CHARSEL.
    hope this helps.
    regards
    Sai Vishnubhatla.

  • Please help me to correct the Variable exit

    Hello,
    I am trying to calculate the previous month from the user input 0CALMONTH variable 0I_CALMO. I have created another variable ZVPCALMON and have restricted a key figure Amount with this variable.
    I have written the below code. When I debug the query I am able to get below in E_T_DATA
    Sign -> I
    OPT ->      EQ     
    LOW -> 200508
    when I enter the variable 09/2005 but I dont get the data in the report. However when I run the report without restricting the keyfigure with ZVPCALMON and input the calmonth as 08/2005 I am able to get the data.
    IF i_step = 2.
      CASE i_vnam.
    WHEN 'ZVPCALMON'.
            CLEAR : l_s_range,
                    l_month_low,
                    l_year,
                    w_var_range.
          LOOP AT i_t_var_range INTO w_var_range WHERE vnam = '0i_CALMO' .
            l_year  = w_var_range-LOW(4).
            l_month_low = w_var_range-low+4(2) - 1.
            IF l_month_low = 0.
              l_month_low = c_12.
              l_year  = l_year - 1.
              CONCATENATE l_year
                          l_month_low INTO l_s_range-low.
            ELSE.
              CONCATENATE l_year
                         l_month_low INTO l_s_range-low.
            ENDIF.
            l_s_range-sign = c_sign_i.
            l_s_range-opt  = c_range_opt_eq.
            APPEND l_s_range TO e_t_range.
          ENDLOOP.
        WHEN OTHERS.
      ENDCASE.
    ENDIF.
    I think I am missing something. Could anyone suggest what could have been wrong.
    Thanks,
    KK

    Hi KJ,
    Thanks for the reply. I don't know why but a simple offset doesnt work either. I have restricted the key figure with 0CALMONTH Variable and put the offset '-1' but still I dont get the result. Thats the reason I have gone for the variable exit.
    thanks,
    Kalyan

  • How to debug variable exit in Bi 7.0

    Hi Experts,
          I  have code in variable exit in Bi 7.0, I am trying to debug in RSRT but im not able see my source code, Can you any body suggest me any thing or can suggest me steps to debug variable exit in bi 7.0.
    Thanks
    Vinod Kumar

    Hi Vinod,
    1) add following code into your exit-routine, at ??? fill your user-name:
    Routine will STOP here,
    than in new session call transaction SM50
    find your query-request and mark the line
    now go to menue line to -program/session and -debugging
      DATA: help.
      WHILE help IS INITIAL
        AND sy-uname = '???'.
      ENDWHILE.
    2) after activation of exit-rountine start your query
    3) open new session and call transaction SM50
    4) check the list and look for your query-request and mark the line
    5) now go to menue line to -program/session and -debugging
    6) the run will stop at your while-statement
    7) now you must change the contents of the variable help to '1' to leave the while-loop
    8) with F5-Key you can proceed your coding
    Regards
    Edi
    Edited by: Eduard Meder on Feb 19, 2009 12:40 PM

  • 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

  • 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

  • Debugging the variable Exit  -  EXIT_SAPLRRS0_001

    Hi Guys
    Not sure how to debug the variable exit with setting break point.
    I need to check if my variable it correctly populated after written code in ZXRSRU01 .
    Any help will be awarded.
    Thanks in advance
    Kirk

    Hi Kirk,
    after When'Data Source'.
    Write : <b>BREAK-POINT</b>
    Save and activate the code and execute the report. Provide required input and execute. It will go into debugging more.
    Dont forget to remove the "break-point" before transporting to Quality/Production.
    Hope it helps.

  • Variable Exit Code i_step = 2

    Hi There
    I have an issue with the code of type i_step = 2. What i want to do is to check a table and if a certain value is in that table i want to include a restriction for all values for the caracteristic on which the variable is based.
    My code looks like this:
    IF zuser_auth-comp_code = '*'.
              ls_range-low = '*'.
              ls_range-sign = 'I'.
              ls_range-opt = 'CP'.
              APPEND ls_range to e_t_range.
              EXIT.
    ENDIF.
    THE CP = * restriction is used without problems for i_step = 0 variables but it does not work for i_step = 2. Does anybody know why or know another way to restrict to all values in a i_step = 2 variable exit??
    I hope that you can help me.
    /Chris

    Hi again
    You are right the I_step = 2 is executed after execution of the query. When i debug the exit my exit variable code is executed but the result is that the program ends with an illegal state.Below i have inserted the complete code.
    WHEN 'ZCECCST2'.  "Authorization check for Company Code
        IF i_step = '2'.
          READ TABLE i_t_var_range into loc_var_range with key IOBJNM = '0COMP_CODE'.
          if sy-subrc <> '0'.
          SELECT * FROM ZUSER_AUTH WHERE
              username = l_uname.
          IF zuser_auth-comp_code = '*'.
              SELECT comp_code from /bi0/mcomp_code into ls_range-low.
              ls_range-low = '*'.
              ls_range-sign = 'I'.
              ls_range-opt = 'CP'.
              APPEND ls_range to e_t_range.
              ENDSELECT.
              EXIT.
          ELSE.
              ls_range-low = zuser_auth-comp_code.
              ls_range-sign = 'I'.
              ls_range-opt = 'EQ'.
              if ls_range-low <> ''.
                APPEND ls_range to e_t_range.
              endif.
          ENDIF.
          ENDSELECT.
          ELSE.
              ls_range-low = loc_var_range-low.
              ls_range-sign = 'I'.
              ls_range-opt = 'EQ'.
              APPEND ls_range to e_t_range.
          ENDIF.
      endif.
    /Chris

  • Variable exit not taking multiple single values...urgent pls

    Hi BW Guru's
    I have created an variable exit where the variable represents mulitple single values.
    In the customer exit when i trying to populate mulitiple values and move it to e_t_range it is not taking multiple values. I have also observed that it is a line item type. I want to know if there is anyway out since it is an urgent requirement. Any help would highly appreciated. I shall also award points accordingly. Thanks.

    Hi Anil,
    Thanks for your prompt response.
    I guess i am missing out some thing.
    The scenaio is like this I want to hard code some values which have to be removed from the selection hence I have created the variable  with multiple single value variable and I have removed (unchecked) ready for input as it is not required. After your suggestion I have also made it mandatory but after running the query I am getting a message Abort no value determined. I have written this code under if i_step = 1.
    My code goes like this….
    DATA: BEGIN OF I_SO_VENDNO occurs 0,
            SOURCSYS TYPE /BIC/TZSO_VEND-/BIC/ZSOURCSYS,
            ZSO_VEND TYPE /BIC/TZSO_VEND-/BIC/ZSO_VEND,
            TXTMD TYPE /BIC/TZSO_VEND-TXTMD,
          END OF I_SO_VENDNO.
    select * from  /BIC/TZSO_VEND into table i_so_vendno.
      loop at i_so_vendno where TXTMD CS 'GREAT LAKES'.
          l_s_range-low = i_so_vendno-zso_vend.
          l_s_range-sign = 'I'.
          l_s_range-opt = 'NE'.
          append l_s_range to e_t_range.
          clear: e_t_range, l_s_range, i_so_vendno.
      endloop.
    Want to know if I am missing out something.
    Thanks.

  • 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

  • Variable exit in sap bi 7.0  is not working in web report

    Hi Experts,
        I had wrote a variable exit to get latest run date at variable screen for a variable.On the base query i have created query view.This query view is working fine when i am viewing from analyzer  but on  the web Im not getting latest run date but it taking some other date.
    Can  any body suggest any thing why system is behaving so strange.
    Thanks
    Vinod

    Hi, Succhi
    Note 1621031 - Incorrect status I1054 "To be distributed"
    Note 1620893 - Screen output without connection to user - SMQ1
    also check program CRM_DATAEXCHANGE_TOOLBOX
    Denis

  • Need help for user exit mereq001

    Hi,
    I need help for user exit mereq001. I think I messed up with include table CI_EBANDB and CI_EBANMEM. And When I tried to check the syntax . It gives me error like : <b>Class IF_PURCHASE_REQUISITION. Inconsistency in the dictionary for the structure mereq_item_s_cust_data.</b> Anyone had experience for this exit? I just need to extract costcenter information of the each item from the requisition and block the requisiton if the costcenter are differents from each other before the requisition is saved. Any one has idea about it?
    Thanks.

    biao,
    Have you checked this struture consistency from SE11. Also check the activation log.
    If there are any errors and you are not able to rectify the same use RSDDCHECK program, give your table name and run the report.
    This will list down the error structures releated this table and also prompts for you to activate it.
    Regds
    Manohar

  • Variable Exit for Displaying last transaction or opening bal

    Dear Experts,
    material            year                period              amt         qty            
    abc                   2008                  01                4545         878
    abc                   2008                  03                5255         900
    def                   2008                  02                4333         1212
    def                   2008                  05                4551         1555  
    like wise data is stored in infocube , i am going to create a query based on the infocube . In query i define a variable for period and year respectively .if i give the input of period as 02 and year 2008 for the opening stock should get displayed as
    abc                   2008                  01                4545         878
    def                   2008                  02                4333         1212 
    if i give input of period as 10 and year as 2008 i should get the values as
    abc                   2008                  03                5255         900
    def                   2008                  05                4551         1555  
    and also pls let me know how and where  to write the variable exit
    PS: This is Go Live Critical
    Thanks and regards,
    raj

    Hi Frank.
    Im sure its possible to find the date last year, but it will involve some programming and thinking about time/dates etc, unless you can do a lookup in the factorycalendar or "normal" calendar, stored in the system AND having the number of day info.
    But you want to do this on the fly, in the report? I think performance might take a hit...
    regards
    jacob
    Edited by: Jacob Jansen on Oct 8, 2009 8:53 PM
    Edited by: Jacob Jansen on Oct 8, 2009 8:54 PM

  • Calculating difference between two dates in Variable Exits

    Hi,
          I need to calculate the difference between the two dates in months in Variable exits. I want the result in months so that I need to find out the Average Usage.
            How can I find the difference between them in months.
    Thanks
    Dave.

    Hi Christophe, Senthil
                                       Sorry for late response, I checked this  MONTHS_BETWEEN_TWO_DATES_NEW  in SE37/SE38 and about the date they are going to enter at query run time it should be like 03/03/2006 to 08/03/2006 and I should get in 5 months and or if the date range 03/15/2006 to 08/03/2006 and I should get like 4.5 months. Please could you tell me how to get the values in months or please give me a functional module so that I can use.
    Thanks
    Dave.

Maybe you are looking for