Customer Exit Variable - Variable Value Error BRAIN 000

I created a variable which is processed by 'Customer Exit'. This variable is 'optional' and NOT user input required.
And i have written my code in customer exit under I_STEP EQ 1.
I used the variable in my query as a default value for a free characteristic.
The query runs fine and return me the correct result.
The problem is when i used the same variable as a default value of a free characteristic in another query which has another user input variable for another characteristic, i got a warning message after input a value for another variable.
Variable Value Error BRAIN 000 <<i>my variable name</i>>
How to make it work in the second query?
Please help as I am new to this.
Thanks,
CH

Hi Fernanda,
Try this:
DATA:  LS_RA_SID  TYPE   RSR_S_RANGESID.
DATA:  fst_date LIKE sy-datum.
   CASE i_vnam.
          WHEN 'ZRANGE_PREVMONTH'.
fst_date = sy-datum - 1.
concatenate fst_date(6) '01' into ls_ra_sid-low.
      ls_ra_sid-sign = 'I'.
      ls_ra_sid-opt = 'BT'.
      ls_ra_sid-high = fst_date.
      APPEND ls_ra_sid TO e_t_range.
ENDLOOP.
ENDCASE.
   ENDIF.
Just post here for any queries..
Regards,
Loed

Similar Messages

  • Wrting customer exit in variables

    Hi Guys,
    I have to change the code in customer exit for variables in reporting.i have to give inputrange in 0calmonth(01/06-07/06)and i have to get the output as 0calday(multiplevalues),can any body help me out.
    Thanks
    Kiran

    Kiran,
       check this... i wrote the code as mentioed in my last post...
    data:w_date(8).
    CASE I_VNAM.
      WHEN '0CALDAY Variable Name'
        if i_step = 1.        clear l_s_range.
          read table I_T_VAR_RANGE where vnam = '0CALMONTH Varibale'.
          l_s_range-low = concatenate i_t_var_range-low+'01'.
          l_s_range-sign = 'I'.
          l_s_range-opt  = 'EQ'.
    w_date = concatenate i_t_var_range-high '01' into w_date.
    call function 'SLS_MISC_GET_LAST_DAY_OF_MONTH'
        exporting
             DAY_IN = w_date
        importing
             LAST_DAY_OF_MONTH = l_s_range-high.
          append l_s_range to e_t_range.
        endif.
    endcase.
    check this code and let me know...change the Variable Names and keep capital letters.
    i'm telling you again... if the 0CALMONTH variable range 200605 to 200608. code will populate the values for 0CALDAY like this...20060501 to 20060831.
    all thes best.
    Regards,
    Nagesh Ganisetti.

  • How to find out query name in customer exit for variables

    We use the same customer exit variable in different queries. In the customer exit we want to find out, which query has called the customer exit. With the technical query name we want to read a master data table entry.
    e.g. If we come from query ZG1_TEST1 we want to use selection sel1
    Query name  |  selection
    ZG1_TEST1   |  sel1
    ZG1_TEST2   |  sel2  
    How can we find out the query name in the customer exit for variables?
    Thanks for your help,
    Evi

    Hi Evi,
    check out the structure I_S_RKB1D in your exit. It contains the query.
    Siggi

  • Customer Exit For Variable

    Hi Experts,
    Currently i am using SAP BI 7.0, I dont have much ABAP knowledge.
    Requirement : I need to create a Customer exit on variable to derive Fiscal period from the date entered manually by user.The date is in mm/dd/yyyy format and i need to derive Fiscal period from it.
    Please assist me in doing this.
    Best Regards,

    Hi,
    Assume date entered by the user is captured in user input variable: Variable_Date
    Exit Call after User Input
    <Declaration>
    DATA :  l_date1(7) TYPE c,
              l_year(4) TYPE c,
              l_month(2) TYPE c,
             LS_RANGE_IN_LINE LIKE LINE OF I_T_VAR_RANGE,
             d_date type sydatum.
    <You need to write code in Step2 as you would be reading data entered by user.>
    WHEN 2.
        CLEAR l_s_range.
        READ TABLE I_T_VAR_RANGE WITH KEY VNAM = 'Variable_Date' INTO
                      LS_RANGE_IN_LINE.
            d_date = LS_RANGE_IN_LINE-LOW .
            l_year = d_date(4).
            l_month = d_date+4(2).
            CONCATENATE l_year '0' l_month INTO l_date1.
          l_s_range-low  = l_date1.
          l_s_range-sign = 'I'.
          l_s_range-opt  = 'EQ'.
          APPEND l_s_range TO e_t_range.
    Regards
    Lavanya

  • Allowing customer exit interval variables to be "Ready for Input"

    Hi BI fans,
    I am looking to construct a Pie Chart where the default view will show the Year-To-Date data. At present, we are utilizing a customer exit variable (from the 0FISCPER characteristic) to carry out this task.
    It is also required, however, to allow the user to manually adjust the start <u><b>and</b></u> end date of this period. Is it possible to have a customer exit interval variable which will allow the user to modify the start and end date – and thus facilitate specified time periods?
    I look forward to hearing from you,

    Hi
    Use a BI Content variable like 0I_CFYTD - Year to Date For Current Fiscal Yearm, this variable is a interval variable and will default from fiscal period 1 to the current period.
    If you edit the variable and set it to ready to input then when you run the report at the variable screen you can change the period on which you want to report.
    hope this helps

  • Text Variable(Customer Exit) displays variable name instead of its value.

    Hi Gurus,
    My requirement is to display the year(from variable) as the field name i.e Year end salary 2009.
    I was using the fields name as hardcoded values like 2009 but as per my requirement i need to display it from the variable.
    I tried using Text Variable using customer exit, but I'm getting variable name(zvariable) instead of value(2009).
    Please help me out, many thanks in advance.
    Regards,
    Ankur

    Hi,
    Actually I tried to create a Text Variable with Replacement Path.
    But here the problem is that we have a Characteristic Variable (Customer Exit) which is not listing in the selection box of Replacement Path.
    Hence we tried to create another Text Variable (Customer Exit) and refering to the same Customer Exit code.
    Regards,
    Ankur

  • Customer Exit - Fill variable value - Report is showing wrong records

    Hi Gurus,
    I'm building a query where the user will type a date.
    So I need to show in report just the records where Valid From <= User input date <= Valid To.
    I've created to variables for this:
    ZMSCOG07 (Single, Mandatory) = user input variable used in Valid From characteristic restriction.
    ZMPCOG10 (Single, Mandatory) = customer exit variable to get ZMSCOG07 value and to be used as restriction to Valid To characteristic.
    Then in the query I restricted Valid From characteristic:
    Valid From <= ZMSCOG07
    and Valid To characteristic:
    Valid To >= ZMPCOG10
    Follow my code in CMOD transaction:
    WHEN 'ZMPCOG10'.
        IF I_STEP = 2.
            READ TABLE I_T_VAR_RANGE INTO LOC_VAR_RANGE
            with key VNAM = 'ZMSCOG07'.
            CLEAR L_S_RANGE.
            if sy-subrc = 0.
                L_S_RANGE-LOW = LOC_VAR_RANGE-LOW.
            endif.
            L_S_RANGE-SIGN     = 'I'.
            L_S_RANGE-OPT      = 'EQ'.
            APPEND L_S_RANGE TO E_T_RANGE.
        ENDIF.
    I already tried to put L_S_RANGE-OPT = 'GE' in the variable range and in the query to restrict Valid To characteristic:
    Valid From = ZMPCOG10.
    But it's not working correctly. The report is just considering Valid From restriction and showing to me all the records where Valid From <= ZMSCOG07. It seems that ZMPCOG10 is not being filled. Could somebody help me?
    Thanks in advance,
    Helder

    Hi Helder,
    I understand your requirement but I don't understand the solution you are using. I think it's a bit tricky.
    What I would do is:
    Create three variables:
    - VAR1: Single value, mandatory, ready for input, customer exit. Used to store "User input date"
    - VAR2: Select option, customer exit, not ready for input. Used to store Valid From restriction.
    - VAR3: Select option, customer exit, not ready for input. Used to store Valid to restriction.
    Then, use this code:
    WHEN 'VAR2'.
    IF I_STEP = 2.
    READ TABLE I_T_VAR_RANGE INTO LOC_VAR_RANGE
    with key VNAM = 'VAR1'.
    CLEAR L_S_RANGE.
    L_S_RANGE-LOW = LOC_VAR_RANGE-LOW.
    L_S_RANGE-SIGN = 'I'.
    L_S_RANGE-OPT = 'LE'.
    APPEND L_S_RANGE TO E_T_RANGE.
    ENDIF.
    WHEN 'VAR3'.
    IF I_STEP = 2.
    READ TABLE I_T_VAR_RANGE INTO LOC_VAR_RANGE
    with key VNAM = 'VAR1'.
    CLEAR L_S_RANGE.
    L_S_RANGE-LOW = LOC_VAR_RANGE-LOW.
    L_S_RANGE-SIGN = 'I'.
    L_S_RANGE-OPT = 'GE'.
    APPEND L_S_RANGE TO E_T_RANGE.
    ENDIF.
    I think this should work, and you'll have three independent variables used for one purpose each.
    Hope this helps.
    Regards,
    Diego

  • Customer Exit Prompt Variables in BEx

    Hi,
    I created a BEx query and in that Query I need to have two prompt variables
    1. Flag
    2. Fiscal Month Date
    Both are customer exit varioables ,so basically the abap code for Flag and Date is, by default the flag will be 0 which means whatever the inpurt Date value is ,the result set will be displayed for that date.
    If the flag is changed to 1 by the user and the Date is 3/1/2013 then the result set is today-1 data
    If the flag is changed to 2 by the user and the Date is 3/1/2013 then the result set is previous month data... and so on...
    Can you please advice as how to create date prompt for this customer exit variable ?When I try to create it is giving me an error
    Add a key figure to structure element 'selection 1' in structure 'Key figure'.
    Please advice.
    Thank you.

    Hi,
    Add a key figure to structure element 'selection 1' in structure 'Key figure'.
    this message just means that you have created a 'new selection' by right clicking on the key figure structure. And you haven't yet included any key figure into this local rkf you are trying to create.Double click on this selection 1.This message will go off once you drag and add a key figure into this selection.
    Once this is done , you can rename the 'selection 1'  to a relevant description
    Hope it helps
    Regards,
    Rathy

  • Customer Exit in variables

    plz suggest  what can be done which can fullfill our requirement in variable---
    if user gives iput in variable period -jan08  to oct 08,& Material-XXXXXX
    user should get the output of this in the next variable(inspection Lot) as input values (i.e F4 Help)
    inspection lot (lots to be considered only in that period range and for that particular material for selection)
    Thanks
    Rave
    Edited by: rave king on Oct 14, 2008 11:09 AM
    Edited by: rave king on Oct 15, 2008 6:25 AM

    Hi
    The green square at the corner with = symbol represents the particular variable is selected or restricted with that characteristics info object.
    Also you can double click on ZXRSRU01 include program to view the customer exit codes.
    Or you can go to SE38 and enter the program name ZXRSRU01 and Display the program to see the customer exit codes.
    to control the kind of input selection options displayed in the selection screen you have to configure and choose between different variables you create in the Bex.
    look for options in the Bex variable creation for single value selection only.
    in the customer exit.. stop at I_STEP = 3 and check if user input is correct .. else error out.
    If you can predict the correct user entries the user should make.. then you rather make this variable "not available for selection" and fill it in user exit yourself so the security is not breached. This way user cannot tamper with the values you fill in background. But he can filter further later in the query navigation.
    Regards
    Lakshmi

  • Customer Exit - Fill variable depending on query view name

    Hi
    We're running BW 7.0
    We have a query which is used for broadcasting and as well for user input. That's why we have a variable which is default filled by a customer exit. This variable is the week and is default filled: fist week of year up to actual week.
    But now we have for the same query different selection requirenments.
    The same query should be send by email with
    - first week of year up to actual week
    - previous week
    Because of dynamic variables the calweek needs to be filled by customer exit and worked until now fine - until a second requirenment was coming (separat broadcast only with previous week).
    I don't like the idea to copy the query because of maintenance work.
    I'd like to have several views - and depending on the view name etc. I would fill the customer variable. But I don't get the query view name into customer exit - right?
    Do you have any other ideas?
    How do you handle such requirenments?
    Thx
    Roger

    Hi Helder,
    I understand your requirement but I don't understand the solution you are using. I think it's a bit tricky.
    What I would do is:
    Create three variables:
    - VAR1: Single value, mandatory, ready for input, customer exit. Used to store "User input date"
    - VAR2: Select option, customer exit, not ready for input. Used to store Valid From restriction.
    - VAR3: Select option, customer exit, not ready for input. Used to store Valid to restriction.
    Then, use this code:
    WHEN 'VAR2'.
    IF I_STEP = 2.
    READ TABLE I_T_VAR_RANGE INTO LOC_VAR_RANGE
    with key VNAM = 'VAR1'.
    CLEAR L_S_RANGE.
    L_S_RANGE-LOW = LOC_VAR_RANGE-LOW.
    L_S_RANGE-SIGN = 'I'.
    L_S_RANGE-OPT = 'LE'.
    APPEND L_S_RANGE TO E_T_RANGE.
    ENDIF.
    WHEN 'VAR3'.
    IF I_STEP = 2.
    READ TABLE I_T_VAR_RANGE INTO LOC_VAR_RANGE
    with key VNAM = 'VAR1'.
    CLEAR L_S_RANGE.
    L_S_RANGE-LOW = LOC_VAR_RANGE-LOW.
    L_S_RANGE-SIGN = 'I'.
    L_S_RANGE-OPT = 'GE'.
    APPEND L_S_RANGE TO E_T_RANGE.
    ENDIF.
    I think this should work, and you'll have three independent variables used for one purpose each.
    Hope this helps.
    Regards,
    Diego

  • Customer exit on variable

    Hi
    i am trying to write a customer exit on a variable, but the problem is that i have to get the values of the variable at runtime and do the processing. How can i get the values of the variable in the code?
    thanx
    sujai

    You should understand the concept of  <b>I_STEP</b>  in the coding .
    Go thru :
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/59069d90-0201-0010-fd81-d5e11994d8b5
    Look at below code :
    User Exit: ZVCCYTDX
    Input: ZVCPAXRG
    Output: Jan of Accident Year Range
    Logic Description:
    WHEN 'ZVCCYTDX'.
    <u><b>if i_step = 2.</b></u>
    <b>clear loc_var_range.
    loop at i_t_var_range into loc_var_range WHERE vnam = 'ZVCPAXRG'.</b>
    if sy-subrc = 0.
    curr_year = loc_var_range-low(4).
    concatenate curr_year '001' into jan_accidentyear.
    CLEAR L_S_RANGE.
    L_S_RANGE-LOW = jan_accidentyear.
    L_S_RANGE-SIGN = 'I'.
    L_S_RANGE-OPT = 'EQ'.
    append l_s_range to e_t_range.
    exit.
    **endif.
    endloop.
    endif.
    <b>** Code calculates YTD values from user entered Fiscal Period.</b>
    Message was edited by:
            Jr Roberto

  • Customer exit and variables

    Hello,
    Before posting this question I've search on the forum and already found part of my needs, but I still miss the end.
    I'd like to create a customer exit to calculate the last day of previous month (this is OK, there are lots of threads regarding this) and another one for last day of previous-previous month (this is OK as well)
    I've done the modifications in CMOD, changed the ABAP code and activated it. I've created 2 variables in Query Designer and now I would like to use them in selections. Here I'm stucked because when I try to select any of my 2 variables to restrict dimensions, I don't get them!
    I've noticed that I'm only able to create text type variable while I would like to create characteristic value type variable. How can I do to do so?
    Thanks for your help,
    Benoit

    Hi benoit,
         Actually you dont know how to create variable.
    For Creating variable on any characteristic, Just select that characteristic, Right click on that, select restrict, and there you can see single value, Variable, favourite etc, there in Variable, right click and create variable.
    Or refer this link.
    http://help.sap.com/saphelp_bw21c/helpdata/en/f1/0a5a2ee09411d2acb90000e829fbfe/frameset.htm
    there go to using variable and variables for Characteristic Value.

  • UCCX 8.5.1 - Expression editor and a variable string value error

    I receive the followng error when trying to create a varialbe string value using the expression editor. The string value that I am trying to create is used with the Create URL Document Object. The popup error states 'Unable to parse expression: Couldn't repair and continue the parsing on token #ID 'FindCaseByCaseNumber' (line 1, col:24)'  The string value is "<Message MessageType="FindCaseByCaseNumber" Source="APIMessage" ReferenceNumber="1" NodeID="1" UserID="1"><CaseNumber>"05-CP-001842"</CaseNumber></Message>". The editor will not let me save the string value with quotation marks being used in the string value, exampe "FindCaseByCaseNumber". When I remove the quotation marks from the string value the editor will save the value but then the variable will not work.
    Has anyone encountered this same problem or know what to replace the "" to terminate the string value? I have tried brackets, but this does not work. Any suggestions are greatly appreciated!

    I found my answer. It appears that ${}, #{}, and ' will let you add a sub-variable to a variable string value.

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

  • Customer exit hierarchy variable problem

    Hi together,
    does anyone know, how many entries I can insert into the e_t_range table?
    The reason is the following. We are having a hierarchy on WBS_ELEMT. And we want to create a query which shows only the values which are on level 3. So I want to eliminate level 1 and level 2.
    So I created a custEx variable, where I include every entry from the table /BI0/HWBS_ELEMT with TLEVEL = 3 for the specific hierarchy.
    In the test environment everything works fine, but when I'm in the integration system the hierarchy seems to become to large and I receive an error.
    Does anyone know the maximum number of selections I can do to the e_t_range? Or does anyone hay another idea, how to create a new dynamicly created hierarchy on runtimer?
    Kind Regards
    Stefan

    Hi Satria,
    Instead of following code ---
    CLEAR l_s_range-low.
    IF loc_var_range-low EQ '000000000000030000'
    OR loc_var_range-low EQ '000000000000010130'.
    l_s_range-low = 'MEZBUNITMDI'.
    l_s_range-high = '0HIER_NODE'.
    ELSEIF loc_var_range-low EQ '000000000000040000'
    OR loc_var_range-low EQ '000000000000010160'.
    l_s_range-low = 'MEZBUNITMPI'.
    l_s_range-high = '0HIER_NODE'.
    ENDIF.
    try this ---
    IF loc_var_range-low EQ '000000000000030000'
    OR loc_var_range-low EQ '000000000000010130'.
    l_s_range-low = 'MEZBUNITMDI'.
    ELSEIF loc_var_range-low EQ '000000000000040000'
    OR loc_var_range-low EQ '000000000000010160'.
    l_s_range-low = 'MEZBUNITMPI'.
    ENDIF.
    Note : whenver the option is EQ, the system takes only low value.

Maybe you are looking for