Query on Customer Exit

Hello All,
When user executes the report, BW throws variable screen. Now I wanted to set dynamic default value in the variable screen. Take an instance, if user execute report in Mar05, CALMONTH variable should be having default value Feb05 (Previous month). I know that it can be done using Customer exit. But I never wrote as of now. Could you please throw light on following…….
1.     Explain the complete procedure to create a customer exit?
I really appreciate if you send in sample code for similar functionality as well.
Thanks in advance,
Harsh.

Hello
I am facing an issue on User exit usage. I am doing following steps.
1. Dragging Calander year/month characteristic.
2. Define a varaible (Technical Name: ZCALMONTH) with Customer exit as processing by and Single value with entry "Optional" field. 
3. Go in CMOD and oepn EXIT_SAPLRRS0_001.
4. Open include "ZXRSRU01".
5. Write following code and activate it.
data: l_s_range type rsr_s_rangesid.
data: l_help(8) type c.
case 'i_vnam'.
when 'ZCALMONTH'.
clear: l_s_range.
l_help = sy-datum. "actual day
l_help+6(2) = '01'. "first of month
l_help = l_help - 1. "previous month
l_s_range-low = l_help(6).
l_s_range-sign = 'I'.
l_s_range-opt = 'EQ'.
append l_s_range to e_t_range.
endcase.
After doing all above steps, variable default value remains blank. Please let me know if i am wrong or missing any step.
Thanks

Similar Messages

  • 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

  • Crystal Reports with BEx Query using Custom Exit Variable

    Hi,
    We have BW BEx Query using Customer User Exit variable to derive  the Fiscal Week for Last Year (called it VAR2) based on another user input variable Current Fiscal Week (called it VAR1).
    VAR2 is derived from VAR1 in CMOD via some codings and thus it DOES NOT have the "Variable is Ready for Input" flag ticked in the BEx. VAR1 is user input variable, so it has "Variable is Ready for Input" flag ticked in the BEx.
    When we create a Crystal Reports with the BEx Query using variable VAR2, and when we run it we got an error message saying "Failed to execute query; '[]<java.lang.UnsupportedOperationException: No Selection State Support!ZP_MI_LYPUBWEEK>'. Redesign your query or contact the data source maintainer to solve the problem".  (note: ZP_MI_LYPUBWEEK is VAR2 in this case).
    Could anyone please assist? Surely, CR supports BEx customer user exit variables like the above, right?. I also refer to the forum below as it seems to have a similar issue (except mine with an error message), but it does not provide a solution in it.
    Crystal Reports with BEx Query using Custom Exit Variable
    Thanks,
    Andy

    Hi Vibhav,
    We have the SAP Crystal Reports for Enterprise XI4.0 Version 14.0.0. Not sure if SP0 or other SP, got to check with Basis Team later.
    We tried that "mandatory" option and did not work either.
    Anyway, SAP has now come back again saying it is something they will fix it in next release/version. We got a phone call from them and a reply below to our OSS.
    23.08.2011 - 08:20:49 CET - Info for Customer by SAP  
    I have raised this issue on the Idea#s Place as an enhancement request
    on the below link:
    https://cw.sdn.sap.com/cw/ideas/5586
    This ER contains the information of including the customer exit
    variables in the report without checking the #input for ready# option.
    This ER can be considered for being implemented in the future
    versions. You can refer to SAP Note: 1515837 - How To: Enhancement
    Request Process - "Idea Place" for more information regarding the Idea
    Place.
    Cheers,
    Andy

  • Query Performance - Customer Exit Variable

    Hi All,
    In the report I am using a customer exit variable on FiscalYear Period. When the user inputs a FiscalYear Period it gets the data for the previous 52 weeks. For ex. If the user inputs 052.2008, then it get the data from 001.2008 - 052.2008 (for 52 weeks).
    Here the report takes a significant time to run. I do understand from the high data volume perspective. Here I could not depend much on the aggregates, as the input selection is dynamic.
    Are there any ways to improve the performance of the query. If aggregates is a solution, then on what basis should I build the same.
    Thanks in advance.

    Hi ,
    You can use OLAP Cache....this will help you improve the performance of the query.
    The OLAP cache is architected to store query result sets, and to give all users on an application server access to those result sets. If a user executes a query, the result set for that queryu2019s request can be stored in the OLAP cache. If that same query (or a derivative) is then executed by another user, the subsequent query request can be filled by accessing the result set already stored in the OLAP cache. In most cases, a query request filled from the OLAP cache is significantly faster than queries that receive their result set from database access.
    Go to RSRT >> give the query name >> Click on Execute and Debug >> there uncheck the box " Do not use Cache".then execute....
    Again execute the query without Cache........just check if it makes any difference.......
    Thanks and Regards,
    Debjani..

  • BEx Query Designer - Customer Exit

    Hello All,
    I have a requirment to create USER customer exit.
    User will enter the value of Month(ex, 02, 03...) and Year (ex 2010,2011 ...)  with two different prompt screen.
    Now i have to return back a date back to a RKF based on following senario:
    1) If month and year is current month and current year than return back current date to the perticular RKF Date.
    2) If month and year is not current month and current year then return back the last date of the month and year entered.
    Thanks & Regards
    Nishant

    HI,
    Just restrict the RKF with a CMOD variable and write the CMOD code as follows (sample):
    assume your month and year variables are as follows: VAR_MON and VAR_YEAR
    DATA: L_S_VAR LIKE RRRANGEEXIT.
    DATA: L_S_RANGE TYPE RSR_S_RANGESID.
    DATA: V_MON TYPE C LENGTH 2.
    DATA: V_YEAR TYPE C LENGTH 2.
    DATA: V_MONTH TYPE /bi0/oicalmonth.
    DATA: V_CURR_DATE TYPE SY-DATUM.
    DATA: V_DATE TYPE SY-DATUM.
    when 'variable_name'.
    if i_step = 2.
    READ TABLE I_T_VAR_RANGE WITH KEY VNAM = 'var_mon' INTO L_S_VAR.
    IF SY-SUBRC = 0.
       V_MON = L_S_VAR-LOW.
    ENDIF.
    CLEAR L_S_VAR.
    READ TABLE I_T_VAR_RANGE WITH KEY VNAM = 'var_year' INTO L_S_VAR.
    IF SY-SUBRC = 0.
       V_YEAR = L_S_VAR-LOW.
    ENDIF.
    V_CURR_DATE = . "Current date
    "Check for the values
    if V_MON eq V_CURR_DATE+4(2) AND V_YEAR eq V_CURR_DATE+0(4).
    V_DATE = SY-DATUM.
    else.
    CONCATENATE V_YEAR V_MON INTO V_MONTH.
    "call some function module to populate the last day of the above month (V_MONTH)
    "and populate the above obtained value into V_DATE.
    "see if you can use this SG_PS_GET_LAST_DAY_OF_MONTH
      L_S_RANGE-SIGN = 'I'.
      L_S_RANGE-OPT  = 'EQ'.
      L_S_RANGE-LOW  = V_DATE.
      APPEND L_S_RANGE TO E_T_RANGE.
    endif.
    Regards,
    Joe

  • Query Drilldown does not Invoke Customer Exit Variables

    We have a problem with performing a drilldown in a BEx Analyzer reprot, basically the client is a Trading company and they have inter company trading. We are using the Profit Centre as one of thre u201CFree Characteristicsu201D in the query and hence we are able to drilldown on a Characterictc by Profit Centre.
    We are using a couple of BEx query variables (Customer Exit variables) to determine the inter-area and extrenal area profit centres and these profit centres will be different based on the level of Hieracry node selected when the query is initially executed. For example if we assume a hierarchy with has one root node, 3 children under the root node and 2 grand-children under each of the 3 child nodes, now if we are at the root Node of the Hierarchy then every profit centre is internal and there are no external profit centres,  similarly if we are at the 2nd node (i.e. one of the child nodes) then everything under that node is internal and everything in the other 2 child nodes is external and so on.
    This is where the issue starts for us, since on the report if we select the the node we want to see the results for at the query rumtime (i.e. the Customer Exit Variables are invoked at I_STEP=2 and they select the other nodes of the hierarcy if any and group them into either external or internal)  then the results are correct. Now if we were to drilldown, i.e. We selected the root node and we drilldown on to see for example of the child nodes then the result are not correct, this becomes apparent when we drilldown further to the grand-child nodes.
    One logical explaination is that when we are doing the drilldowns the customer exit variables are not being invoked in the BEx analyzer report and hence they are not grouping the sums for the internal and external profit centres relevent to node selected in the Drill down.
    Does anyone have any suggestions regarding how to make this query work properly or show the correct results in BEx Analyzer (ideally), I have considered the Workbooks option but the client does not want Workbooks.
    Please let me know if there is a program etc we can customise to ensure that the Customer Exit variables logic is used when the user does a drilldown in the query or any other way to make it work.
    Many Thanks
    Jack

    Hi
    Just to aid anyone who is thinking what to do in a similar situation, I am aware that RRI or using workbooks are a couple of good alternatives (just that these are currently not being considered by the client, hence I am asking here).. Also, if someone has Business Objects WEBI then we can satisfy the requirement by creating a new Webi Report for each of the nodes and displaying it (similar to Workbooks but much nicer and faster) or we can get the Webi to execute the variables again during the drilldown... Unfortunately the client is not using Webi either... So the solution has to be in BEx Analyzer / Query designer based...
    If you have any thoughts on how I might be able to do what I want to do then please feel free, I am quite confident that I am not the 1st person to come accross this issue and someone somewhere has solved this issue. 
    Thanks

  • Query Customer Exit - Multi Single Values

    Hi SDN,
    Is it possible to return multi-single values in a customer exit for a query variable or only a range?
    I have 2 characteristics (NUMC), an item ZITEM and a group ZGROUP.  An item can belong to many groups.
    ZITEM           ZGROUP
    1                     1
    1                     2
    2                     3
    4                     1
    I would like to create a variable in Query Designer for ZITEM that returns a list of single values for ZITEM (not a range).  For example, Group 1 should return items 1, 4.
    The relationship between ZITEM and ZGROUP is not defined in master data (compounding).  Currently, I have a DSO which has ZITEM and ZGROUP defined as a key.  I would like my query variable-customer exit to read the DSO and return a list of single values of ZITEM.
    I'm assuming making ZGROUP a compounding infoobject of ZITEM would solve the issue in query designer because I could restrict on ZGROUP.  I have not used this approach because it would require modifying standard extractors.
    Another option I explored was to create an Infoset between my InfoCube and the DSO which has ZITEM & ZGROUP.  Unfortunately my InfoCube has NonCulm. Key Figures and therefore cannot be used in an infoset.
    Does anyone know how to create a multi-single value customer exit or have any ideas on how to solve this problem?
    Thanks!

    I was able to create a customer exit which performed multi-single values.
    Psuedocode:
    1) Create Internal Table and populate it with DSO data for Group and Item
    2) In Customer Exit, loop through internal table for the group you want
    3) In loop, append l_s_range to e_t_range (this will add multi-single values)
    WHEN 'ZCX_FLWGRP60'.
        IF I_STEP = 2.
          l_s_range-sign = 'I'.
          l_s_range-opt = 'EQ'.
          "get multi single values for flow types
          LOOP AT l_t_flwgrp INTO l_s_flwgrp
            WHERE /BIC/ZFLW_TP_G = '60'.
            l_s_range-low = l_s_flwgrp-FS_FLW_TP.
            append l_s_range TO e_t_range.
          ENDLOOP.
        ENDIF.

  • Variable customer exit

    Hi all,
    I created a query with customer exit variable that is filled from another variable manual entry.
    When i start a query I receive this error message:
    Error for variable in the customer exit
    and in debug I find this message:
    System error in the program CL_RSR_REQUEST and Form GET_SETXX_WA
    How can I do?
    Thanks
    Gianmarco

    when 'ZODACE'.
        tables: /BIC/AZSD_O0100,
                /BIC/AZSD_O0200.
        ranges: r_createdon for /BIC/AZSD_O0100-CREATEDON.
    break-point.
        if i_step = 2.
          loop at i_t_var_range into loc_var_range
                  where vnam = 'ZDATADOC'.
            clear r_createdon.
            r_createdon-low    = loc_var_range-low.
            r_createdon-high   = loc_var_range-high.
            r_createdon-sign   = 'I'.
            r_createdon-option = 'BT'.
            append r_createdon.
            exit.
          endloop.
          select DOC_NUMBER into
                 /BIC/AZSD_O0100-DOC_NUMBER
                 from /BIC/AZSD_O0100
                  where /BIC/ZAUDAT in r_createdon.
            select single * from /BIC/AZSD_O0200
          select * from /BIC/AZSD_O0200
                   where refer_doc = /BIC/AZSD_O0100-DOC_NUMBER.
              clear l_s_range.
              l_s_range-low = /BIC/AZSD_O0200-refer_doc.
              l_s_range-sign = 'I'.
              l_s_range-opt  = 'EQ'.
              append l_s_range to e_t_range.
          endselect.
          endselect.
        endif.
    The variable are:
    ZODACE based on IO 0REFER_DOC with customer exit
    ZDATADOC based on IO ZDATU with manual entry
    After wich end-user digit a data in ZDATADOC popup I take ODOC_NUMBER in order item ODS ZSD_O01 where ZDATADOC=CREATEDON.
    With 0DOC_NUMBER I go to delivery item ODS ZSD_O02 and I take the corresponding 0REFER_DOC and then I fill variable ZODACE.
    0REFER_DOC is in row of the query.

  • Behavior of customer exit variables (used as prompt) in a workbook

    Hi All,
    We are on NW2004s. I am using a customer exit variable in the prompt for my query then saved the query as a workbook.
    1. When I run the query the customer exit routine/program is called and the selection screen variable is populated with the correct value.
    Ex. Calendar year variable is a prompt variable defined as customer exit variable that gets the current year.
    when you run the query the prompt for calendar year shows "2007" as default value. this is correct.
    2. when I run the workbook using this same query, it looks like it is not executing the customer exit program. The value in the calendar year prompt is whatever the last value used when the workbook was last ran.
    I also placed a breakpoint in the customer exit program (EXIT_SAPLRRS0_001) to check if it is being called and it looks like it isn't.
    Is there a configuration/property that I should enable/check to make sure that customer exit variables used as prompts works in workbooks? Is this a bug? Anybody else have issues with using customer exit variables as prompts in their workbooks?
    Thanks in advance,
    Malou

    Hello Marilou,
    See the abswer I got from the 1st response on my question
    Save and reuse variable option in 7.0
    It may be a good help.
    Variables seem to be an understated item in the documents.
    Kind regards
    Message was edited by:
            BI developer

  • Currency conversion type by customer exit variable doesn't work

    Hi all.
    In my query I need amounts by quarter, applying quarters last date rates as currency conversion.
    Query has Year parameter. Based on this parameter, by customer exits I calculate every quarters last date and use them as currency conversion types.
    The problem is that query DOESN'T APPLY currency conversions!
    I checked TCURR table - currency conversions do exist for applied days
    I checked my customer exits - the date calculation works fine
    I suppose where is something wrong in query processes (customer exits/currency conversions) sequence before running it.
    Someone knows anything 'bout that?

    Check these docs.. and check again.
    [Creating Currency Translation Types|http://help.sap.com/saphelp_nw04/helpdata/en/80/1a6813e07211d2acb80000e829fbfe/content.htm]
    [Use Variables for Currency Conversion|http://www.scribd.com/doc/7061035/How-to-Use-Variables-for-Currency-Conversion]

  • Variable with customer exit

    Hello,
    I have created a query with customer exit variable.this variable calculates cumulative month from the beginning of the year. this variable depends on another regular variable 0PCALMON (single value, mandatory). i also use this variable in the query to show the month itself.
    <b>the problem is as follow:</b>
    until yesterday the 0PCALMON variable pop up normally, but now the variable doesn't pop up  at all!
    Does anyone have an idea?
    Thanks,
    Maya

    Hi,
    The variable may be personalized with some value.
    <b>To remove the personalization for a user:</b>
    Step 1: RSA1 -> Search for ODS 0PERS_VAR
    Step 2: Manage -> Contents ->selective deletion
    Step 3: Put the user to remove the personalization
    http://help.sap.com/saphelp_nw04/helpdata/en/01/42c73c13b0ce5be10000000a114084/content.htm
    Regards
    Happy Tony

  • Custome Exit Variable Not prepopulating Parameter of CRE Report

    Hi
    I am using a customer exit varibale to pre populate a parameter in a Bex query I have created.  When I run the bex query the customer exit variable populates the parameter just as it is supposed to.  However when I use the bex query in Crystal Reports for enterprise the customer exit variable does not pre populate the parameter.  Is there something I need to do to make sure that CRE recognises the customer exit variable or does CRE not recognises them?  If it doesn't recognise them is it possible to create CRE level Customer Exit Variable?
    Many Thanks in advance
    Neil

    Hi Alun
    Thanks but I'm in BW so Stored procedures are not really an option on this one.  I suppose my primary question is, is there a reason that Customer Exit Variable is not working as it is creating a lot of difficulties by not populating the parameters in the same way it does in the bex query I am using to develop my Crystal report.
    Thanks
    Neil

  • 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

Maybe you are looking for

  • Cannot add multiple members of a failover cluster to a DFSR replication group

    Server 2012 RTM. I have two physical servers, in two separate data centers 35 miles apart, with a GbE link over metro fibre between them. Both have a large (10TB+) local RAID storage arrays, but given the physical separation there is no physical shar

  • Setting isolation level fails

    Hi, Im using Kodo 3.0.0 on Oracle 8.1.7. I tried to define the isolation level in the kodo.properties: e.g.: kodo.jdbc.TransactionIsolation: serializable Unfortunately Oracle throws an exception which says, that "set transaction" has to be the first

  • Purchase Order IDoc Output Error

    I'm having a problem creating IDoc output for a vender PO.  I have the vender setup in WE20 with outbound parameters: Partn.funct. VN Message Type: ORDERS Basic Type: ORDERS05 Application: EF Message Type: NEU Process Code: ME10 In the PO Output cond

  • RFC Adapter - JCO Exception - Please Urgent

    I am developing a scenario from File--RFC integration.  I am using File and RFC adapter to perform this transaction. The File Adapter is picking the file properly and the trnaformation (Mapping Program) is also happening properly.  But the RFC is thr

  • I can't watch received video messages on iPhone

    Someone in a group message sends a phone number to call a client - there doesn't seem to be a way to copy the phone number to the iphone dialer, or to tap the number to call from iphone, or even to tap to call from skype if we had skype credit. Is th