Customer exit in query

HI Guys,
I require support regarding the customer exit.
My requirment is i am having a query which has following columns.
calmonth salesvalue
04.2006 1234444.00
05.2006 2323233.00
i wanted to include one more column additionallly as follows :
calmonth salesvalue Prevyear_sales_value
04.2006 1234444.00 4545545.00
05.2006 2323233.00 8787788.00
kindly provide me the codes in exit variable ....
thank you.
regards
Giri

Hi priya,
i will explain step wise what i did.
1. I created customer exit variable ( ZG_VAR3). for 0calmonth
2. I created variable ZINPUT  as general variable.
3. used CMOD
4. selected the exit  - EXIT_SAPLRRS0_001  
5. writtent  the following code.
WHEN 'ZG_VAR3'.
IF i_step = 2.
DATA: L_S_RANGE TYPE RSR_S_RANGESID,
      LOC_VAR_RANGE LIKE RRRANGEEXIT,
      LV_CALDAY   TYPE SY-DATUM,
      LV_FISCYEAR like T009B-BDATJ,
      LV_CALMONTH TYPE /BI0/OICALMONTH,
      LV_YEAR(4)  TYPE C,
      LV_MON(2)   TYPE C.
LOOP AT i_t_var_range INTO loc_var_range WHERE vnam = 'ZINPUT'. 
LV_calmonth = LS_T_VAR_RANGE-high.
LV_YEAR = LV_CALMONTH+0(4).
LV_MON = lv_calmonth+4(2).
LV_year = lv_year - 1.
concatenate lv_year LV_mon into LV_calmonth.
l_s_range-low  = LV_calmonth.
l_s_range-opt  = 'EQ'.
l_s_range-sign = 'I'.
APPEND l_s_range TO e_t_range.
ENDLOOP.
ENDIF.
kindly let me know what is wrong .....

Similar Messages

  • Urgent - Related to generic customer exit for Query

    Hello Experts,
    We have a query whose selection screen has two user input variables, plant and fiscper. Let say user enters 001 plant adn fiscper 0012007. We have about 100 rows for this selection. Each row has three date fields D1, D2 and D3. we have requirement that out of these 100 records only those records which meet the condition that D1 falls between D2 and D3 should be displayed as query result, others should be ignored.
    Is there any generic customer exit (Like we have customer exit to manipulate virtual keyfigures) that gets called before query result is displayed where we can play around with the query result before it gets displayed? I am not talking about user exits for customer exit variables.
    Please throw some light on this.
    Thanks
    Sundar

    Hello Sundar,
    You can use conditions for the requirement mentioned.
    Create a Contition on date D1 with operator "Between" and instead of hardcoding the values for the condition use variable entries.There you can create a variable with Customer exit type - to get in the selected range of dates between D2 and D3.
    Thanks
    Sam

  • Customer Exit in query on aggregation level

    Hi,
    I try to have variables filled with a customer exit.
    The coding of the customer exit is correct, this have been tested in queries on multiproviders.
    Unfortunately it is not working when these variables are used on level of aggregation levels.
    What I would like to achieve:
    We have some planning queries on aggregation levels. Different users can plan on the same query (and aggregation level), but not for the same set of data. Therefore the query should be restricted to the authorized values. Unfortunately we can not switch to the new authorization concept (analysis authorizations) yet, but we already need this functionality very soon.
    The customer exits are the only possible option. Unfortunately it seems that the customer exits are not being executed when the variables are used in queries on aggregation levels.
    The variables are not ready for input and should be filled in I_STEP = 2
    Is this normal? If so, is there a work around?
    Thanks in advance for quick replies!
    Kind regards,
    Bart

    Hi,
    You can debug your query by putting the break-point in your exit code and execute the query in RSRT. This way you will be able to find if your customer exit is actually being called or not. If it is being called then there can be some logical problem with your code due to which the variable values are not getting populated.
    Regards,
    Deepti

  • Customer exit for query variable to calculate amount since 1998

    Hi Experts,
    I am trying to fetch the expenses since 1998 till last fiscal year in Bex Query.
    I have created a variable ZFYRVAR1, processing type customer exit, Interval, Mandatory. I unchecked 'Variable is ready for input' box. There is no 0CALYEAR in the infocube. We have 0FISCYEAR and 0FISCPER in the InfoCube.
    We wrote following code to populate the variable. It is throwing a warning message.
    Value " is too long for variable ZFYRVAR1.
    The column remains empty and nothing is populated. Can somebody tell me whats wrong with the code. I also defined another variable instead of l_year. like
    zyear like /bi0/pfiscyear-fiscyear.  but same error.
    Any help is appreciated.
    data: l_s_range type rsr_s_rangesid.
    data: l_year(4)     type n.
    case i_vnam.
    l_year = sy-datum+0(4).
      l_s_range-high = l_year - 1.
       l_year = 1998.
      l_s_range-low = l_year.
      clear e_t_range.
      l_s_range-sign = 'I'.
      l_s_range-opt  = 'BT'.
      append l_s_range to e_t_range.
    endcase.

    Hi Sheo,
    Hope the sample code below helps you. You can debug it in RSRT to be sure.
    DATA: L_S_RANGE TYPE rsr_r_rrrangesid.
    DATA: l_yearh(4) type c,
          l_yearl(4) type c.
    IF I_STEP = '2'.
      if i_vnam = 'ZFYRVAR1'.
         *Please check your user profile to make sure l_year is in the format YYYYMMDD.
         l_yearh = sy-datum(4).
         l_yearh = l_yearh - 1.
         l_yearl = '1998'.
         l_s_range-high = l_yearh.
         l_s_range-low = l_yearl.
         l_s_range-sign = 'I'.
         l_s_range-opt = 'BT'.
        APPEND L_S_RANGE TO E_T_RANGE.
        exit.
      endif.
    ENDIF.

  • Every value of an InfoObject as input for a customer exit in Query

    Hi,
    I have a Query which shows a contract number in rows and an amount in columns. Now I want an additional key figure in columns which should be filled through a customer exit. This exit should read from another DSO an additional amount for every contract number (that means every contract number per row should be used as input for the where statement of the DSO select).
    Can anyone tell me if this is possible and which is the best way to realize this?
    Thanks and greetings,
    Sebastian

    you cannot have customer exit for such requirement
    then use virtual KF  concept
    http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/60e34f63-f44c-2c10-488e-c89b04e0ca7c?quicklink=index&overridelayout=true.

  • Customer Exit in Query Designer

    Hi,
    I have to build a query in QD 7.0 which schould cotain the Countries (Hierarchy) in the Rowes and Revenue % in the Columns.
    I have to show the revenue% in three catagory: >30%, 10-30% and <10% with sum for each catagory, somehow like this:
    Greater than 30%
    usa 40%
    can 31%
    sum
    Between 10-30%
    IT 20%
    CA 21%
    sum
    Less than 10%
    DE 9%
    FR 8%
    sum
    Total sum
    I know that can be done with Customer Exit, but can any one tell me how to do it und how should the Customer Exit look like. I have not too much experience ABAP, or may be some one has another idea.
    Thanks for any help in advance

    Hi Martin,
    Why you want to go for customer exit ??
    I hope that revenue %ge is a calculated key figure. And you have to place Revenue depending on its value under proper column. Is this what u are luking for ?
    If so then u can create busckets for the 3 categories and place the revenuce of particular country under proper category without using customer exit.
    Create 3 different calculated key figure namely >30%, 10-30% and <10%.
    write below formula; for e.g in <10 %
    (revenue < 10) * revenue
    (Im taking into consideration that revenue is a calulated key figyure)
    Will help u in more better way once u clear your requriement.
    Thanks
    Dipika

  • Customer Exit for query

    How can I find out in which queries that the variables that are defined in the customer exit ZXRSRU01 are used? Thanks

    you should be able to go into table rszglobv and type in the variable name and select the id for you variable using se12.
    Then use this id and go into table rxseltxref put this id in the field teltuid and laytp = var and objevers = A . The technical names of your queries will be displayed
    Then use table rszcompdir and give it this technical name to get the english name.
    Hope this helps.
    Richard

  • How and where to create SAP Exit or Customer Exit in query variable

    Hi,
    I have to create a date variable in BEx and it should always contain default value as SY-DATUM i.e. current date.
    I dont have 0CalDay in any of my data flow,also I am not supposed to add 0CALDAY.
    If so,where i can write that exit.
    Thanx in advance.

    Actually,what my requirement is...
    I will not filter any characteristic based on this sy-datum instead I will use that variable value in formulae.
    For ex: in my selection,i mention As of date = today's date..then inside the quer designer,a formula will calculate No.of days=As of date-Due date,where "As of Date" is nothing but the date which i have enterd in my selections.
    please let me know any solution

  • How to identify what customer exit variables are used in which query?

    Hi all,
    When i happened to check the CMOD transaction code i can find a list of customer exits are used. But i want to know what are those customer exist are used in which query? can anyone let me know the procedure of identifying it.
    Thanks a lot
    Pooja

    hii pooja
    check the foll links
    Very Urgent: Customer Exit Variable
    customer exit variable
    MIssing Authorisation for customer exit variable query
    Authorization variable or customer exit variables
    if it is helpful assign points
    thanks.

  • Error while trying to Execute the Query with Customer Exit

    Hi Experts,
           I am having a Query with Customer Exit, it is working fine for all the Employess, except for one. When i try to remove the Customer Exit it is working for her too. Below is the error i am getting.
    system error in program SAPLLRK0 and form RSRDR; CHECK_NAV_INIT_BACK
    Thanks,
    Kris.

    Hello Kris,
    Are you working with multiprovider? Please check if OSS notes 813454,840080 or 578948 are applicable in your case.
    Regards,
    Praveen

  • How to select data from an aggregate in a customer exit for a query?

    Hi,
    I have written a virtual key figure customer exit for a query. Earlier the selection was from the cube, where there was severe performance issue. So I have created an aggregate, activated and have loaded the data.
    Now when I select that data I find that the Key table is different in development and production. How do I resolve this.
    My code is attached below. The table in developemnt is KEY_100027 and in production is KEY_100004. This code is activated and running in BW development server.
    SELECT
        F~KEY_1000041 AS K____035
         F~KEY_1000271 AS K____035
         F~QUANT_B AS K____051
         F~VALUE_LC AS K____052
    INTO (xdoc_date, xval1, xqty1)
    UP TO 1 ROWS
    FROM
    FROM
    */BIC/E100004 AS F JOIN
    /BIC/E100027 AS F JOIN
    /BIC/DZMM_CGRNU AS DU
    ON FKEY_ZMM_CGRNU = DUDIMID
    JOIN /BI0/SUNIT AS S1
    ON  DUSID_0BASE_UOM = S1SID
    JOIN /BI0/SCURRENCY AS S2
    ON DUSID_0LOC_CURRCY = S2SID
    JOIN /BI0/SMATERIAL AS S3
    *ON FKEY_1000042 = S3SID
    ON FKEY_1000272 = S3SID
    JOIN /BI0/SMOVETYPE AS S4
    *ON FKEY_1000043 = S4SID
    ON FKEY_1000273 = S4SID
    JOIN /BI0/SPLANT AS S5
    *ON FKEY_1000044 = S5SID
    ON FKEY_1000274 = S5SID
    JOIN /BIC/D100004P AS DP
    *ON FKEY_100004P = DPDIMID
    ON FKEY_100027P = DPDIMID
    WHERE
    WHERE
    ( ( ( ( F~KEY_1000041 BETWEEN 20051230 AND 20060630  ) ) AND  ( (
    ( ( ( ( F~KEY_1000271 BETWEEN 20051230 AND 20060630  ) ) AND  ( (
             S3~MATERIAL = <l_0material> ) ) AND  ( (
                s2~movetype BETWEEN '101' AND '102' OR
             s4~movetype BETWEEN '921' AND '922' OR
             s4~movetype BETWEEN '105' AND '106' OR
             s4~movetype BETWEEN '701' AND '701' OR
             s4~movetype BETWEEN '632' AND '632' ) ) AND  ( (
             S5~PLANT = <l_0plant> ) ) AND  ( (
             DP~SID_0RECORDTP = 0  ) ) ) )
    GROUP BY
        ORDER BY F~KEY_1000271 DESCENDING.
          IF sy-subrc NE 0.
            EXIT.
          ENDIF.
        ENDSELECT.
    How do I transport the code and make it work?
    Whats the reason that the two key fields are different.
    I had transported the aggregate from development to production. Activated it and filled the data.
    What is the way out? Please help.
    Regards,
    Annie.

    Hi Sonu,
    The main task is to move the contents of the one internal table to another with some condition.
    First sort and delete the duplicate entries from the First Internal table like below : 
    sort it_tab by material ascending date_modified descending.
    delete adjacent duplicates from it_tab.
    Then move that Internal table contents to another internal table.
    Define another internal table with the same structure as you have first internal table and then
    Second Step :
    it_itab1 = it_itab.
    If you are using seperate Header line and Body then you can do like below :
           it_itab1[] = it_itab[].
    This will fix the issue.
    Please let me know if you need any further explonation.
    Regards,
    Kittu
    Edited by: Kittu on Apr 24, 2009 12:21 PM

  • Customer Exit variable of Query not working in View

    Hi,
    I have a customer exit variable in my query to calculate the last 6 month period on Calendar month. I have used 0CMONTH for the same and then using offset of 6 on its value range to get it.
    Now, I have many views based on this query, which should ideally be having the same filter condition for the calendar month, but it is not happening. Although, it is working fine for the query! The views do not seem to be catching the selection correct.

    Hi there,
    As far as I Know, yes they exist. The only difference here, is that you build a query with a selection screen, and  you execute the query with some selection parameters, and therefore all customer exit variables, offsets, etc, will be read and changed at the runtime execution of the query, and you can rearrange your query visualization drilling down free char., making filters, etc. and storing that visualization in a view.
    If you save your view and execute it afterwards, you'll get the same selection parameters to input, the same offsets, etc, that you have with the query, but with a visualization stored by you.
    So that should have been working.
    Diogo.

  • Customer Exit Variable and Condition in a Query (Sequence of Execution)

    Hi,
      For a query i defined a Customer exit variable and a condition....
    Which will first execute...wether it is a  Variable and then Condition or vise versa
    Is there any way we can control sequence of execution
    My requirment is first to execute the condition and the variable how can i control this
    Thanks

    Hi
    In your customer exit you will be having a field by name I_STEP which will help you to handle the time of execution of the variable.
    Assign points if helpful
    Prathish

  • Understanding complex query with selections(customer exit variables)

    Hi experts,
    I am trying to understand one query having  a combination of selections and BEx variables in it.
    In Characteristic Restrictions panel of Query Designer:
    we have some CHARs restricted by means of authorisation variables
    In Default Values panel:
    some other CHARs without any filters
    In free CHARS panel
    some characteristics
    In Rows panel:
    some more chars that were placed in Default values panel
    In Columns panel:
    Formula YTD on selection YTD
    Formula Monthly on selection Monthly
    Selection on YTD characteristic(hidden)
    Selection on Monthly characteristic(hidden)
    Selection XX(in definition,I saw selection on YTD Keyfigure and a characteristic variable VAR1(i-step=1) filled with customer exit..this variable picks up right version of Master Data...our system has many versions of master data,one for each year)
    Selection YY(in definition,I saw selection on Monthly key figure and the same characteristic variable VAR1 we used in Selection XX)
    When I execute this..I see one variable popup which asks for values for year and version of master data...I enter master data version for that year and the year....I see the result...
    Now I tried to experiment to learn...I deleted Selection XX and Selection YY and tried to execute....a variable popup asking for year...I enter year and tried to execute..it throws message---'Value for variable VAR2 cannot be determined'......
    I couldnot understand this error because VAR2 is a customer exit characteristic variable defined in CMOD...ITS NEVER USED IN THIS QUERY...but defined in CMOD to pick up correct version of Master data..its defined in such a way that it picks value depending upon VAR1 varaible....both variables function is same...its just that  VAR1 works on i_step=1 and VAR2 works on i_step=2 plus dependent on VAR1....
    Can anyone understand why I am seeing error about VAR2 when its never used in Query....??
    Thanks for your inputs....

    Hi Vikram,
    I am unable to find VAR2 anywhere in query designer....Can it be like that its hidden?
    Thanks and Rgds,
    SChand

  • Date Customer Exit in the query is not reflecting in the workbook

    Hello.
    We have a BI 7.0 Query where we have a restriction for req del date and billing date to show the month of current date - 2.
    We have written 2 customer exit variables and we have restricted the same. The query is working well.
    For Broadcasting, we have created a workbook for this query and saved it under a role.
    The workbook is fine running for the current month., But if the month changes to the next, the workbook is not reflecting the same.
    Still only Old dates are available in the workbook.
    Please let me know if i am doing any mistake

    Hi Karthik,
    If the customer exit variable is of type i_step = 1, ie if it is a manual entry variable as well, then this will not get updated based on teh month of execution.
    Kindly check the article below for info.
    http://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/enterprise-data-warehousing/how%20to%20update%20variable%20values%20in%20broadcast%20settings%20dynamically.pdf
    Regards.
    Shafi.

Maybe you are looking for

  • Error handling and Manual Retry mechanism in BPEL

    Hi Gurus, We have a requirement that If any error occurs during BPEL process , We need to auto retry. if auto retry is not enough We need to manual retry and send the request message to Worklist for retry. In our BPEL process We have CreateOrganizati

  • Is there more simple interface library than OCI for C.

    I read OCI 8.0 documentation and I think that API like CLI XOpen standard but this standard is much complicated. So I am looking for a way to interacting with server in manner such as PostgreSQL interface library or MYSQL interface library or Sybase

  • SOA In a Day at India's Most Influential Business Technology Conference

    Business Technology Summit 2010 – India's First, Largest and Single-most Inspirational Technology Show Bangalore, July 12, 2010: Businesses are organizing themselves with Service-oriented architecture (SOA). SOA moved from exploration and experimenta

  • How to pass a command line argument to the sequence?

    Hi, My GUI is written in VB.NET. I can read the command line argument in the GUI, using: Me.AxApplicationMgr.CommandLineArguments(). But I don't know how to pass it on to my sequence file which the GUI invokes. How do I read the command line argument

  • IPad 3 - wifi 3G works without 4G connection?

    I would like to buy an iPad3 wifi+3G but Im not sure if the connectivity will work properly without 4G connection. My country does not have 4G, just 3G and edge.