Variables coding for replacement path customer exit

i have to look up values in query for restricted keyfigure ..
the values are stored in an ods table as below, as the values changes often during the year.:
zdate123.......value1.....value2
1/1/10............90..............91
1/2/10............94..............87
in a query i have to grab all the data for Value1 for different dates,
so i created a variable ZVAR_VALUE1
and write the customer exit for it as below
    DATA: l_s_table TYPE /BIC/AZODS00.
    data: l_s_range_low,    l_s_range,    l_s_range_sign,    l_s_range_opt.
    DATA: v_today type sy-datum.
    v_today = sy-datum.
CASE i_vnam.
  WHEN 'ZVAR_VALUE1'.
    IF i_step = 1.
      CLEAR L_S_RANGE.
      SELECT SINGLE /BIC/ZVALUE1 INTO l_s_range FROM /BIC/AZODS00
      WHERE /BIC/ZDATE123 EQ v_today.
      APPEND l_s_range TO e_t_range.
    ENDIF.
this gives error
WInitial RANGE-OPT for customer exit variable zvar_value1 is corrected..
Error for variable zvar_value1...
i tried replace variable with query but i cannot use it in restricted keyfigure as it gives error...variable cannot be used in structure
can anybody help correct the code??

thank you
    DATA: l_s_range TYPE rsr_s_rangesid.
  and it works
but now in query outpu t the value comes up as 0.00 for everything
this is my code exactly as below
ATA: l_s_table TYPE /BIC/AZODS00.
DATA: v_today type sy-datum.
v_today = sy-datum.
CASE i_vnam.
WHEN 'ZVAR_VALUE1'.
IF i_step = 1.
CLEAR L_S_RANGE.
SELECT SINGLE /BIC/ZVALUE1 INTO l_s_range FROM /BIC/AZODS00
WHERE /BIC/ZDATE123 EQ v_today.
l_s_range-low = l_s_table-/BIC/ZVALUE1 .
l_s_range-sign = 'I'.
l_s_range-opt = 'EQ'.
APPEND l_s_range TO e_t_range.
ENDIF.
and there exist the value for today for Value1 in ods

Similar Messages

  • Variable entry for replacement path

    Hi Guys,
    This is my scenario. I have query A which uses a set of results from query B via replacement path. I have a mandatory variable entry for Query A which I have used also for query B. I was under the impression that when I made a user entry for the variable for query A, that value would be copied over to query B and perform the filtering in Query B too. Is this not the case.
    If I need to perform this operation, i.e use the value that I enter for variable entry in Query A in Query B, how can I do that?
    Thanks,
    Doniv

    Hello Doniv,
    we are using this scenario in our queries too, if we define the same variable in the query A and B,
    this value is used for the selection in the query B.
    Did you tried to search in OSS? (this could be the SAP error)
    Regards,
    Kirill

  • Problem in displaying dates for replacement path with text variable

    Hi all,
    I have to display dates in sequence as descriptions for 15 columns based on the the date entered by the user in Bex Report.I managed to display date as description using text variable with replacement path for single column.I could not able to increment date for other descriptions.Could you please help me to solve this issue.Its urgent.
    Ex: User enters 03/09/2007 then in the out put desciptions for the columns should be  03/09   04/09  05/09 ............ 17/09.
    Thanks in advance.
    Regards,
    Mandadi.

    Hi,
       goto the properties of your KF and click on the variable button side to that of the description field and click on new/Create option.Enter the technical name description for the text variable and select Replacement path as the Processing type and in the nxt screen select Fiscal year as the replacement variable and in nxt screen  specify as Key and provide offset values if necessary and click on finish.now select the variable by clickin on the variable button next to the description field.it comes after the description of the KF.Now run the query.
    Thanks,
    Sandeep

  • Variable creation in bw with customer exit

    hi experts,
    how to create a variable in bw with customer exit?

    Hi
    Create a variable with Processing type as customer exit.
    Then Go to Se38 and ZXRSRU01 program in change mode and there you write the necessary coding how your customer exit variable should process.
    else you can access the include function via CMOD also with selecting the enhancement for reports.
    Regards
    RaM

  • How to feed a query using a variable defined as Replacement Path-Query

    Scenario description : BI NetW 2004S - InfoCube with the following characteristics Customer, OrderDate, OrderYear and the following KeyFigure Number of Pieces.
    Objective: I need a query "QB" that shows how many pieces a set of customers has ordered in the year 2008. The set of customers is defined as all customers that in the previous years (the user can select one or more years) have ordered more than 500 pieces within the same year.
    Implementation: In general terms the idea is to build a query "QB" with the characteristic "Customer"  that is restricted (filtered) using a variable that is fed by another query "QA" (Replacement Path-Query).
    In order to have the selection of customers that for each of previous years (2007, 2006, 2005,...) have ordered more than 500 pieces, in the query "QA":
    - I put OrderYear as filter and defined a variable in order to ask the user which year/s he wants to analyse to define the selection
    - I put Customer and OrderYear in row
    - I put the KeyFigure Number of Pieces in column
    - I've defined the following condition: Number of Pieces > 500 with the option Caracteristic Assignment = All Characteristics in the Drilldown Indipendently
    Now if I run the query "QA" it works correctly showing me all customers that in the selected years have ordered more than 500 pieces within of the same year.
    If I run the query "QB" it shows a correct result only if I enter only one year (for example 2006) in the OrderYear field (coming from the query "QA"); if I enter more than one year (for example 2006 and 2007) the selection of customers showed is not the same defined by the first query "QB": I was expecting to see all customers defined from the first query less all customers that have no ordered any piece in 2008.
    Questions
    1) Why is query "QA" working on a different selection of customers when the user selects more than one year?
    2) Cosidering the scenario and the objective described above do you have any other idea?
    Thanks
    Ciao
    Roberto

    Hi Christophe,
         it's ok for me if I consider the customer only once in the final selection of customers that feeds the final query, this is my objective.
    However as test I've created 2 "input" queries, one related to 2006 and one related to 2007, and then in my destination query I've tried to restrict the customer using 2 variables of type replacement path-query (one attached to the 2006 query and one attached to the 2007 query). Unfortunately when I try to check and save the destination query, Query Designer tells me it is not possible to restrict the characteristic in this way.
    Could you please describe me steps you run in to order to restrict a characteristic using more than one variable of type replacement path-query?
    Thank you in advance for your answer.
    Ciao,
    Roberto

  • BW Authorizations - Query variable with processing mode as "customer exit"

    Hi,
    Iam new to BW authorizations and have not yet worked on customer exit before. I was going through the documentation at various sites but I could not get the end to end description on how the query process( when using a variable for an InfoObject) works in case of customer exit.
    Let's assume that I am using  a query variable with processing mode as "customer exit" and at the exit I  write some code to extract user's authorizations from a z table. if this is the case, then when an end user runs a query,how will the the system know what value needs to be filled in the variable for the requesting user. Are the user details  also sent to the code along with the query variable? If so how. If I mis-understood the process then forgive me and let me know the correct process.

    Hi!
    welcome to SDN!
    customer exit variables need programing by user. so if you create a customer exit variable, you got to right a program which extracts values into this variable. we can do what ever we want in program, SAP will not deal anything ´with customer exits.
    with regards
    ashwin
    PS n:  Assigning point to the helpful answers is the way of saying thanks in SDN.  you can assign points by clicking on the appropriate radio button displayed next to the answers for your question. yellow for 2, green for 6 points(2)and blue for 10 points and to close the question and marked as problem solved. closing the threads which has a solution will help the members to deal with open issues with out wasting time on problems which has a solution and also to the people who encounter the same porblem in future. This is just to give you information as you are a new user.

  • Formula date variable ,which is processing by 'Customer exit' with ready in

    Hi ,
    I need to create 1 variable which takes date from user and do some calculation.irrespective of any date char.
    so I have created Formula date variable ,which is processing by 'Customer exit' with ready input .
    But when selection screen pop up date formula variable comes with the format yyyymmdd.
    but i need dd.mm.yyyy. i have checked my profile and it is dd.mm.yyyy.
    Waitin for reply

    Hi Babu
    Did you get the answer to the query....if yes please drop me a mail on this as I have the same requirement and thanks in advance...
    my id   [email protected]
    REgards
    Amit

  • Formula variable of type replacement path not working

    Hi Folks,
    I have created formula variable of type replacement path and replaces with characteristic key.I wanted to use charecteristic infoobjects in coluns so that i have created formula variable for that.But when excecuting the query in web it is not displaying values for that formula.
    Can anyone plz solve this,if u come accross this situation before.
    Thanks and Regards,
    Ravikiran
    Edited by: MRK@SAPBI on Jun 11, 2011 1:13 PM

    Thanks vineet, for your quick reply.
    yes,i have used the characteristic in a row and it is a number.
    Still it is not displyaing values.But i need to calculate the couter for the same formula created on that charateristic and need to put condition in the query.
    thanks,
    Ravikiran

  • Use of variables in "FOR XML PATH"

    Other than using dynamic sql (which we don't want to use) is there a way to use a variable in For XML Path, e.g.
    select
    FOR XML PATH (@BookName), ROOT('Book'), TYPE
    TIA,
    edm2

    In terms of general XML design this is poor.  An element is normally a 'thing', and the attributes are normally the properties of that thing.  Therefore in your case you would have a Book property with a 'name' attribute.  It would be impossible
    to create an XSD for your xml, and makes it awkward for readers of your xml - how do they know the book name beforehand?  Creating this xml in the normal fashion would also make it easy to create without any messing around ( string manipulation,
    other hacks ), eg
    DECLARE @BookName NVARCHAR(20) = 'SomeBook'
    SELECT
    @BookName "@name"
    -- Other book attributes
    FOR XML PATH ('Book'), ROOT('Books'), TYPE
    So now you have a Book item(s) within a Books collection.  Easy!  : )

  • A formula with a formula variable with a replacement path delivers X

    A formula with a formula variable with a replacement path delivers X as a result if the characteristic of the replacement is not in the drilldown
    I have Created on ( date ) on which I have a Formula variable . I have used that Formula Variable in my calculated Key figure .
    Now the Problem is If I use Created on in ROW , The calculated key figure works . But if I don't use in Row , The calculated Key figure shows X . Situation is Users don't want to see Created on in ROW .
    If I use in row and hide also , then number of Records  will be same .
    Pls guide me what shoud I do .
    Is this problem related to support pack .

    hi
    i would like to know how to create the replacement path and authorisation variables.
    what are the steps we need to follow in rsa1.
    Edited by: vasu reddy on Apr 9, 2008 11:28 AM

  • Text Variable replace with Customer Exit Variable

    Dear Experts,
    I created a text variable based on replacementh path (instead of customer exit). The reference characteristic is same that as my customer exit Variable and replace it by Key.
    I want to replace it with already Existing Customer Exit Variable but it is not displaying in the List Box even though existing variable option is mandatory.
    Can any one Suggest me the answer for this.
    Regards
    Supraja.K

    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.

  • User exit/BADI  required for coding for the selection custom fields in RSA3

    Hi,
       I have a requirement  in the Datasource extractor. I need to add custom Z fields  in the Data souce of the  2LIS_02_SCL and need to include in the selection part. So I have added the custom filed in the append structure and include the check in the selection checkbox in the transaction LBWE  under the datasource specified above. For the corresponding custom fields, to be populated in the ALV list, I have written the code in corresponding user exit  ZXRSAU01.
    Now I can view my custom Z fields in the list as well as on the selection fileds  while executing the transaction RSA3. But I need to write code for the selection criteria part.  On entering value in the selection criteria of my custom z field, no  values are selected to the corresponding query. Please let me know where should i write the coding part for the selection criteria of the Z fields for the Datasource.
    On debugging, to my understanding only  the standard fields are alone getting filtered by providnig the values in the selection part of the RSA3 tcode. It is called in Macros : Sel  < Datasorce> .... and  the fetch cursor is included inside the macros.
    Please let me know any user exits or Badi;s available for it.
    Thanks in advance

    Hi shivu,
    you might try the BAdI RSU5_SAPI_BADI. A good introduction can be found in the following document:
    [Enhancing DataSources with BAdI RSU5_SAPI_BADI|http://www.sdn.sap.com/irj/scn/index?rid=/library/uuid/3001894b-b1fb-2910-77ba-e80b6f2053b7]
    The BAdI is called at the time of extraction, so this would be the right place to populate your additional fields.
    Best,
    Chris

  • Formula variable problem on replacement path

    Hi all,
    I created a characteristic value variable for the 0CALDAY (ZVAR1) with the following details.
    - Characteristic Value
    - Customer exit
    - Calendar day
    - Mandatory
    - Variable is ready for input  unchecked
    Now i need to give the calculated value in customer exit by I_STEP 2 in a new formula variable (ZVAR2).
    So:
    1) I create in columns a new Formula (zFormula)
    2) In edit mode I create a formula variable (ZVAR2)
    3) in edit mode of the formula I set the following details:
      - Replacement path
      - Replace variable with: Variable
    Here the problem: when I open the popup on selected box to choose the vcharacteristic value variable I don't see the ZVAR1.
    I don't understand where is the problem.
    May you help me ... regards, Roberto

    Ok solved.
    Roberto

  • Node variable in query - Processing type customer exit?

    We are on NW 2004S. I created a hierarchy for an info-object along with several nodes and child nodes.
    I also created a node variable in a query for this info-object. I have the following questions with regards to using node variables in a query.
    1) Can I use a node variable with processing type 'Customer Exit". My objective is to set the value of the node variable in the user exit.
    2) If answer to first question is "Yes", how would I code the node value in the user-exit - Example code or some pointers to that effect.
    I really appreciate your thoughts on this issue.
    Thanks,
    Sanjay

    Hi Sanjay,
    As far as I'm aware this hasn't changed in NW2004s, (in any case it still works), so:
    1)Yes you can, no difference with other type variables.
    2)In userexit EXIT_SAPLRRS0_001 (include ZXRSRU01).
    There's different options depending on at which stage you want to change it:
    http://help.sap.com/saphelp_nw2004s/helpdata/en/f1/0a56f5e09411d2acb90000e829fbfe/frameset.htm
    If you do a forum search on above technical names I think you'll find plenty of coding samples, but if you want something more specific, I'd be happy to help you out.
    Regards,
    Pieter

  • Bex variable value manipulation in the customer exit

    Hello Experts - I have a situation where I need to manipulate the value of a variable in the customer exit based on certain conditions. I have a customer class variable defined in the query with the processing by Manual Input/Default Value. I need to restrict the values that this variable gets based on values that are selected for another variable (division). For example if the division value is 01, class variable can not have value 'CB'. Any ideas how this can be accomplished. Any input will be appreciated.
    Rgds,
    Venu.

    Mansi & Guy - Thanks for your input. The query is not used interactively and it is used as dashboard query in VC for which the variables are fed via Adobe Flex application. In detail here is my requirement -
    Division is a mandatory field that is selected on the dashboard (You can think this for query)
    Class is a Optional field (users have option to select multiple values).
    If the users choose particular division (say in my case 04) and not any Class, at the query level, I want to exclude CB which I can do it in i_step3 logic.
    In case if the user selects any class, I want to skip the logic of exclusion in the i_step3 (This is because, I can restrict the user what class they can pick based on the Division they choose, so the i_step3 logic wouldn't be required in this case).
    Basically, I do not want to raise messages and this needs to handled based on user selections.
    Appreciate your help,
    Venu.
    Edited by: Venu on Sep 14, 2009 10:03 PM

Maybe you are looking for