Customer Exit variable in BEX Query

Hello Guys,
I need to write a custmer exit variable in which the requirement is user is provided with input selection of Posting Period, and user wants the output as sum (cumulative) of 0 i.e start to the period provided by user input.
Consider a scenario, if user puts 06 as posting period in selection screen then keyfigure should sum all the values from 00 to 06.
Now, I need to write the customer exit for this.
Can anyone suggest me the same?
your inputs will be heavily appreciated.
Thanks,
Saurabh

Hi ,
Here V1 refers to the selection variables used for user input as posting period .
You can use the following code in CMOD :
read table i_t_var_range into loc_var_range with key vnam = 'V1'.
    if sy-subrc = 0.
      WA_PERIOD = LOC_VAR_RANGE-LOW - 6
"    If WA_PERIOD <= 6  " Take this condition in to consideration while using the code
  "  Endif .
       l_s_range-low  = WA_PERIOD
      l_s_range-sign = 'I'.
      l_s_range-opt  = 'BT'.
    l_s_range-high =  LOC_VAR_RANGE-LOW
      append l_s_range TO e_t_range.
    else.
    endif.
Hope it helps .
Thanks
Kamal Mehta

Similar Messages

  • Problem with customer exit variable in BeX Query

    Hi All,
    We have created a customer exit variable in a query and populated with few patterns in customer exit.
    My query has to bring all the records where the address line is containg the patterns passed through customer exit. Here the query is not working as expected.
    It is bringing the values where the address line is exactly same as the pattern and not bringing the records where the pattern is part of the address line.
    For example: Pattern passed in customer exit = 'HOSPITAL'
    The record where address line = 'HOSPITAL' is shown in the rpeort, where the record with address line = 'HOSPITAL ROAD' is not shown in the report.
    I would appreciate your help on this.
    Regards,
    Rakesh

    Hi Diogo,
    Below is the code I am using in the customer exit.
    SELECT * FROM zae_tt_pbuild INTO TABLE gt_pbuild.
          IF sy-subrc = 0.
            LOOP AT gt_pbuild INTO gs_pbuild.
              CONCATENATE '*' gs_pbuild-pbuild '*' into lv_pattern.
              ls_range-low = lv_pattern.
              ls_range-sign = lc_sign_i.
              ls_range-opt = 'CP'.
              APPEND ls_range TO e_t_range.
              CLEAR: ls_range,
                     lv_pattern.
            ENDLOOP.
          ENDIF.
         ENDIF.
    I have tried using '%' instead of '*' aswell but the result is same.
    Thanks,
    Rakesh

  • Customer Exit Variable in BEx

    Hi,
    I have defined a query with a Structure in Row and Key Figures in column.
    The result of query should look like this:
    Fiscal/Year Period | Quantity per month | Quantity cumulative
    011.2010 (Variable Offset Value -3) | 5 | 5
    012.2010 (Variable Offset Value -2) | 6 | 11
    001.2011 (Variable Offset Value -1) | 7 | 7
    002.2011 (Variable Singel Value, Manual Input) | 8 | 15
    "Quantity cumulative" is defined as follows:
    Quantity cumulative (002.2011) = Quantity 001.2011 + Quantity 002.2011
    Quantity cumulative (001.2011) = Quantity 001.2011
    Quantity cumulative (012.2010) = Quantity 011.2010 + Quantity 012.2010
    Quantity cumulative (011.2010) = Quantity 011.2010
    "Fiscal/Year Period" and "Quantity per month" are OK. But I have problem to define the key figrue "Quantity cumulative".
    I have defined a Customer Exit Variable on Reference Characteristic "Fiscal/Year Period". The Quantity cumulative (002.2011)
    and Quantity cumulative (001.2011) are calculated correct. But it doesn't work for 012.2010 and 011.2010 (because of previous year).
    I would be helpful if you can give some hints.
    Thanks

    Hi,
    Create a formula "Cumulative Quantity" and add only "Quantity per Month" in the formula. Go to formula properties, Calculations tab, check the Cumulated option.
    This works for different years as well.
    Regards,
    Suzitha.

  • 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

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

  • Drill Down and customer Exit variable

    Hello together and A Happy New Year!
    Please help me with the following topic:
    I have a query with 4 selections(fields) in the columns.
    In the first selection (F1) I have resctricion to Posting Period via Period to (a user entry variable).
    In F2 I have restriction to Posting Period via Period to cust (customer exit based on value of V1 - introduced by the user)
    In F3 I have restriction to PP via Period from, Period to (between: user entry variables)
    In F4 restriction to PP fia Period from cust, Period to cust (between: customer exit variables)
    In the query, if I select in the selection screen Period from 1 and Period to 3, for example, when I make the drill down, only  3 (Period to) is displayed instead of 1, 2 and 3.
    If in the query designer I remove from the columns F1 and F2, then the drill down is working properly (having intervals in the other fields: F3 and F4).
    Do you have any idea why drill down is not working properly with all 4 fields in the columns?
    Thank you,
    Iuliana

    Hello,
    Is there anyone who could help me?
    Thank you,
    Iuliana

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

  • Customer exit variable - internal table in BEX

    Hi,
    i am running a report and using variables in it.
    The report runs over a info cube. There are few challenges in it.
    One of the variable is posting date, and when user enters posting date i need to negate it with current system date.
    If the negated value is greater than 28 then i need to exclude documnet type 'YG' and display the query, else i need to include the dcumnet type 'YG' and document type '  '.  The above logic can be well implemented via a customer exit variable(for posting date) using an internal table. We have internal tables like C_T_DATA which is used in data source enhancement, which help us to implement our own desired logic.
    Do we have such kind of internal tables, based on which the report output (result set) is derived?
    i know that we have l_t_range and e_t_range, but dont know their usage, some one can explain in detail about them?
    Thanks in advance.

    Hi Selva & Lakshmin,
    The code given by Selva is almost correct . If my understanding is clear , you also wanted to include  document type ' ' when the negated value is less than 28 .
    Modification in Selvas Code :
    Variable 'V_DOCTYP' must be of type Multiple Single Values.
    DATA : V_DATE LIKE SY-DATUM.
    DATA : V_DAYS TYPE I.
    if i_step = 2.
    when 'V_DOCTYP'.
    READ TABLE i_t_var_range INTO loc_var_range WITH KEY vnam = 'ZV_PDATE''.
    IF SY-SUBRC = 0.
    V_DATE = loc_var_range-low.
    ENDIF.
    V_DAYS = SY-DATUM - V_DATE.
    IF V_DAYS > 28.
    l_s_range-low = 'YG'
    l_s_range-sign = 'E'.
    l_s_range-opt = 'EQ'.
    APPEND l_s_range TO e_t_range.
    ELSE.
    l_s_range-low = 'YG'
    l_s_range-sign = 'I'.
    l_s_range-opt = 'EQ'.
    APPEND l_s_range TO e_t_range.
    clear l_s_range.
    l_s_range-low = ' '.
    l_s_range-sign = 'I'.
    l_s_range-opt = 'EQ'.
    APPEND l_s_range TO e_t_range.
    ENDIF.
    ENDIF.
    Hope the above reply was helpful.
    Kind Regards,
    Ashutosh Singh

  • 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

  • Customer Exit Variable in cell definition in BEx

    Hi,
    I have defined a query with a Structure in Row and Key Figures in column.
    The result of query should look like this:
    Fiscal/Year Period | Quantity per month | Quantity cumulative
    011.2010 (Variable Offset Value -3) | 5 | 5
    012.2010 (Variable Offset Value -2) | 6 | 11
    001.2011 (Variable Offset Value -1) | 7 | 7
    002.2011 (Variable Single Value, Manual Input) | 8 | 15
    "Quantity cumulative" is defined as follows:
    Quantity cumulative (002.2011) = Quantity 001.2011 + Quantity 002.2011
    Quantity cumulative (001.2011) = Quantity 001.2011
    Quantity cumulative (012.2010) = Quantity 011.2010 + Quantity 012.2010
    Quantity cumulative (011.2010) = Quantity 011.2010
    "Fiscal/Year Period" and "Quantity per month" are OK. But I have problem to define the key figrue "Quantity cumulative".
    I have defined a Customer Exit Variable on Reference Characteristic "Fiscal/Year Period". Moreover I have also defined cell definition to define each individual cell for key figrue "Quantity cumulative" restricted by Customer Exit Variable.
    The Quantity cumulative (002.2011) and Quantity cumulative (001.2011) are calculated correct. But it doesn't work for 012.2010 and 011.2010 (because of previous year).
    I would be helpful if you can give some hints.
    Thanks

    Hi,
    try to use this trick with an IF condition in you customer exit. Calling 'var1' the manual input of:
    data: month_difference TYPE N.
    month_difference = 'var1'+4(3) - 4.
    IF month_difference >= 0.
    DO the classic code which you have already used.
    ELSE month_difference < 0.
    DO the replace concatenating manually 'var1'(4) and the single month.
    ENDIF.
    Hope it helps.
    Best regards.
    Simone.

  • How to make BEX Customer Exit Variable inactive through Customer Exit Code

    Hi,
    I had created two variables VAR1 and VAR2 as Customer Exit variables
    If VAR1 is entered then it should automatically make the VAR2 as NO Entry Variable.
    vice versa also required.
    can u help me with any code in CMOD so that we can make it inactive through Customer Exit Code.
    Thanks in Advance.
    Sunil.

    What i want is not commenting the code
    I want to make the BEX Variable as inactive by using the Customer Exit Code
    EX : If value in VAR1 is entered  then VAR2 should become automatically inactive.
           If value in VAR2 is entered  then VAR1 should become automatically inactive.
    how can this be done
    Thanks in advance.
    Sunil

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

  • Problem with Bex Customer Exit Variable

    Hi Friends,
    I have a customer exit variable which is getting filled based on the User Input.  I have written the code inside the If condition checking i_step = 2. The code is working as required.
    But the problem is when I try refreshing the query or change the user variable selection, the Customer exit variable is not changing.  I tried to debug the code and realized that the  values for the exit variable based on the previous selection is not cleared and the i_step = 2  is not being executed for the variable.
    While I close and reopen the query, the code is working fine.  
    Does anyone know why this is happening?  Please suggest..
    Thanks in advance..
    Regards,
    Priya

    Hi Binu,
    Here is the code sample.  I am trying to populate the month based on the input Week number '0I_WEKIN'
    .  For eg.  If I give 37.2011, the month value should be 08.2011.  If I give 39.2011, month should be 09.2011.
      WHEN 'ZC_MONTH'.
        IF i_step = 2.     "after the popup
            READ TABLE i_t_var_range INTO lw_var_range WITH KEY vnam =
        '0I_WEKIN'.
           IF lw_var_range-high IS NOT INITIAL.
              l_week  = lw_var_range-high.
              l_week = l_week - 3.
              CALL FUNCTION 'WEEK_GET_FIRST_DAY'
                EXPORTING
                  week = l_week
                IMPORTING
                  date = l_date.
              lw_range-low = l_date+0(6).
            ENDIF.
            lw_range-sign = 'I'.
            lw_range-opt  = 'BT'.
            APPEND lw_range TO e_t_range.
        ENDIF.
    Regards,
    Priya

  • RSCRM: Query date with customer exit variable

    Hi All,
    Is there any way to run the RSCRM transaction with a query with a customer exit variable for a date characteristic?
    The issue is that the query ran ok but the variable is not being updated when the RSCRM query is running with a background job or a process chain.
    Thanks in advance
    EV

    I do not think you can select Customer Exit variable, if you see the type is selected to Char Value Variables and it is not editable.
    It would be suggested to go for Customer Exit procesing type for your text variable.
    Cheers,
    Neel.

Maybe you are looking for

  • Adobe Illustrator thumbnail view in a Picture Library?

    We are using Adobe Illustrator and we need to see the thumbnails in a picture library.  All of the other images work, but not the AI files.   We got the 16x16 icons added for AI for the details view, but we haven't been able to figure out where the t

  • USB Headset not working with alsa

    I have a razer megalodon usb headset which works fine in ubuntu and windows but for the life of me I cannot get it to work in arch. [exec@turbine ~]$ uname -a Linux turbine 2.6.34-ARCH #1 SMP PREEMPT Mon Jul 5 22:12:11 CEST 2010 x86_64 Intel(R) Core(

  • Soft proofing issue in CS4 using iMac and Epson 3880?

    I have had great success printing to an Epson r1900 never using soft proofing. Purchased a new 3880 and having colour problems. A suggestion was made to use soft proofing. Monitor is calibrated using iOne-looks very good to the eye. Working space fro

  • Need to add select-options on standard Transaction IH08

    Hi All, I have a requirement to add a select-options to the tcode IH08 but when I copy the report program to the Zreport the Enhancement points does not copy. Any help to do that. Thanks, Jatender

  • Adding Dynamic Link

    I wasn't smart enough to buy Production Suite and ended up buying the components separately over the past couple of months. Is there is a way to adde Dynamic Link after buying AE and PP separately? Thanks. Bill