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.

Similar Messages

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

  • Customer exit text variables form BW queries are not supported in Webi

    HI,
    so I need to  need to modify the headings manually in Web Intelligence.
    Please help me I'm looking for a formular that give me the following result:
    I'm using the next formular:
    =UserResponse([L01 Calendar/month];"CalendarMonth")
    The result is JUN2010.
    Now I want to change this result with a formular in Jun2009 (12 months ago)
    Can anyone help me how to build this formular?
    thanks Peter
    Edited by: P. Teussink on Oct 12, 2010 4:51 PM

    The question really is, what are you trying to achieve?
    If you only want to arrive at the string "Jun2009" based on the string "JUN2010"
    you can do this like this;
    =InitCap(Left(UserResponse("Calender Month");3))+FormatNumber(ToNumber(Right(UserResponse("Calender Month");4)-1);"0")
    Also if you have all month of last year in the report you can use a where logic based on the same principle to only show what the label says.
    However if you want to select this calendar month based on the month inputted by the user, then you will have to create a BEX variable that uses the user exit coding of the input ready calender month to select that month one year ago, like stated above.
    Good luck,
    Marianne

  • What's BADI about Customer Exit Global Variables in Reporting?

    Dear Experts,
    In BW side, about BW variable enhancement, i alway writing code in CMOD  EXIT_SAPLRRS0_001/INCLUDE ZXRSRU01.
    when have many peoples change this exit, will have appear some management issues, such as when have a person changing this exit, i can't chang it. and request management also have management.
    Do you know which BADI can do it and replace CMOD's  exit? Please advise.
    Thank you very much.
    Best Regards
    Steve

    Hi,
    If you still feel that you are facing the issue, then you can create a new include for your project inside the
    Include ZXRSRU01 and you can handle the datasources for your projects there.
    You can also make use of this document Enhancing / Modifying Multiple Data Sources in Parallel which you can get by searching SDN
    Prathish

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

  • 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

Maybe you are looking for

  • Macbook pro keyboard and pad don't work after installing drivers.  Help!

    I just installed windows XP SP2 on a macbook pro 2.66 i7 running 10.6.4. I installed the boot camp drivers and everything from my OSX install disk and now neither keyboard, trackpad, nor usb mouse work. Not sure what to do other than delete the parti

  • Officejet Pro 8600 Plus N911 Tries to Copy from ADF if Lid Covering the Glass is Completely Open

    Hi, I just posted a reply to the following regarding an identical problem that I am having:   http://h30434.www3.hp.com/t5/Scanning-Faxing-and-Copying/Officejet-Pro-8600-N911n-Printer-Tries-to-C... It occurs to me, however, that the original post I r

  • How can I save my login for website ?

    My iPad no longer saves my login even when instructed to "remember me". It used to before the update last week. Is there a setting that is stopping Safari from doing this.

  • Query generated program in sq01

    Hi Experts, Im changing a query (adding new fields) in the infoset and regenerating the program. The program name is getting changed. Im not sure if the name gets changed for every change we make in the query. Is it possible to use the old query name

  • Importing as a single file

    When I import DV from the deck to external hard drive, it created 85 .mov files. I do not want 85 segments, I need one individual mov, that I could just drop into iDVD for a client to look at the footage. Thanks.