How to Write a CUstomer Exit for a variable in BEx

Hi,
How to write a customer exit variable in bex Query designer
Do i need developers key for this (If so what type of key do i need so that i can ask basis tean to generate)
Info Object: ZEXP_DTE (Expiry Date)
Variable on ZEXP_DTE :
ZEDTE
Type: Customer Exit
Can any one please tell me how to write a code in CMOD from this (Step-by Step)
Expiry Date > Current Cal Day
As arun said
'l_s_range-low = SY-DATUM.
l_s_range-opt = 'I'.
l_s_range-sign = 'GT'.
APPEND l_s_range TO e_t_range.'
I want to insert the above code for the above customer exit but as i am new to BW as  ABAP please explain me what are the steps involved in CMOD
Thanks

Hi,
To write customer exit for a variable, you require Access key.
Contact your BASIS to get that.
Access Key,BASIS?
To write Customer exit,
User Exits
User Exit for Variable
/thread/809285 [original link is broken]
Hope these helps u...
Regards,
KK.

Similar Messages

  • How to find the customer exits for a particular transaction

    hi
    how to find the customer exits for a particular transaction

    Hi jyothsna vankadari ,
    ther is a convenient way to find all BADIS called. You may know that BADIS are the newer version of EXITs.
    I would suggest you to go for BADI.
    Follow the below steps to find out what all BADI's are called when you press any button in any transaction.
    1) Goto se24 (Display class cl_exithandler)
    2) Double click on the method GET_INSTANCE.
    3) Put a break point at Line no.25 (CASE sy-subrc).
    Now
    4) Execute SAP standard transaction
    5) Press the required button for which you need to write an exit logic, the execution will stop at the break point.
    6) Check the values of variable 'exit_name', it will give you the BADI name called at that time.
    7) This way you will find all the BADIs called on click of any button in any transaction.
    Regards,
    Clemens

  • How to create customer exit for characteristic variables and for text vars.

    hi friends,
      can anybody tell me how to create customer exit for characteristic variables and for text variables in bw ides system.
    thanks,
    sree

    Hi,
    Please have a look at:
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/f1a7e790-0201-0010-0a8d-f08a4662562d
    Krzys

  • How to write customer exit for the variable

    Hi Experts,
    I have a requirement to create the variable, the scenaria is like this..
    I need to create the variable which gives the period/year values,if yours enters the values 05.2007 then the variable should return the first monthe the year i.e.01.2007.
    I hope it can be done by writing the customer exit..but iam unware how to achieve this.
    Please explain me step by step and cope for customer exit to done this.
    Points will be awarded
    Suraj.

    hi Suraj,
    there should variable sap exit for first month,
    for customer exit, check this how to doc for steps
    https://websmp210.sap-ag.de/~sapdownload/011000358700002762582003E/HowToDeriveVariableValue.pdf
    your code may look like
      INCLUDE ZXRSRU01                                                   *
      DATA: L_S_RANGE TYPE RSR_S_RANGESID.
      DATA: LOC_VAR_RANGE LIKE RRRANGEEXIT.
      CASE I_VNAM.
      WHEN 'your 1st month variable'.
        IF I_STEP = 2.                                  "after the popup
          LOOP AT I_T_VAR_RANGE INTO LOC_VAR_RANGE
                  WHERE VNAM = 'your user input variable'.
            CLEAR L_S_RANGE.
            L_S_RANGE-LOW      = LOC_VAR_RANGE-LOW(4)."low value, e.g.200001
            L_S_RANGE-LOW+4(2) = '01'.
            L_S_RANGE-SIGN     = 'I'.
            L_S_RANGE-OPT      = 'EQ'.
            APPEND L_S_RANGE TO E_T_RANGE.
            EXIT.
          ENDLOOP.
        ENDIF.
      ENDCASE.
    hope this helps.

  • Customer exit for query variable to calculate amount since 1998

    Hi Experts,
    I am trying to fetch the expenses since 1998 till last fiscal year in Bex Query.
    I have created a variable ZFYRVAR1, processing type customer exit, Interval, Mandatory. I unchecked 'Variable is ready for input' box. There is no 0CALYEAR in the infocube. We have 0FISCYEAR and 0FISCPER in the InfoCube.
    We wrote following code to populate the variable. It is throwing a warning message.
    Value " is too long for variable ZFYRVAR1.
    The column remains empty and nothing is populated. Can somebody tell me whats wrong with the code. I also defined another variable instead of l_year. like
    zyear like /bi0/pfiscyear-fiscyear.  but same error.
    Any help is appreciated.
    data: l_s_range type rsr_s_rangesid.
    data: l_year(4)     type n.
    case i_vnam.
    l_year = sy-datum+0(4).
      l_s_range-high = l_year - 1.
       l_year = 1998.
      l_s_range-low = l_year.
      clear e_t_range.
      l_s_range-sign = 'I'.
      l_s_range-opt  = 'BT'.
      append l_s_range to e_t_range.
    endcase.

    Hi Sheo,
    Hope the sample code below helps you. You can debug it in RSRT to be sure.
    DATA: L_S_RANGE TYPE rsr_r_rrrangesid.
    DATA: l_yearh(4) type c,
          l_yearl(4) type c.
    IF I_STEP = '2'.
      if i_vnam = 'ZFYRVAR1'.
         *Please check your user profile to make sure l_year is in the format YYYYMMDD.
         l_yearh = sy-datum(4).
         l_yearh = l_yearh - 1.
         l_yearl = '1998'.
         l_s_range-high = l_yearh.
         l_s_range-low = l_yearl.
         l_s_range-sign = 'I'.
         l_s_range-opt = 'BT'.
        APPEND L_S_RANGE TO E_T_RANGE.
        exit.
      endif.
    ENDIF.

  • User exit for Date variable in Bex

    Hi All,
    I have a report based on an ODS which displays employee and its records. 'BegDate' is the only field in the variable selection screen. The requirement is to display all the records for which the 'Begdate' should be less than equal to the given date(in the variable selection screen). Obviously, I need to go with a user exit in background. I want to know -
    1. What should be the properties that has to be set to the date variable ?(I need only one selection box and not two which we generally have for ranges)
    2. Based on the date, how should I fetch the records? I need to fetch it from the active table of my ODS ?
    3. What is the correct syntax? I am getting some different results through my exit. Please specify the exit code clearly.
    Regards,
    Srinivas

    Why do you want to have an exit for this? As far as I understood you have a variable which contains a single date and you want to display all entrys where a given InfoObject has a value less than or equal to the value.
    You can do this the following way.
    Choose Restrict on your InfoObject
    Right at the top there is a box where you can choose Value ranges (or similar, only have the German client at hand)
    Next you get three boxes at the right middle side. Choose Less than or Equal in the top of the three. One of the boxes disappears.
    Press the button with the two squares right besides the lower box.
    In the drop down box at the top you can choose variables. Finally select the standard single value variable you want to use.
    Best regards
    Dirk

  • Writing a User exit for a Variable in Bex Query

    Hi Guys,
    I need some urgent help on this.  I appreciate your help.
    I have a variable ZVAR1 ( Store id) in a query.  This processing type is manual entry.
    There is another variable ZVAR2 (0Orgunit).  The value in ZVAR2 should be populated by converting the ZVAR1 value that the user entered.
    The master data 0orgunit has the marriage between these two.
    So i guess I need to write a user exit to populate ZVAR2 from ZVAR1.  How can I do that.
    Please help me out on this.
    Thanks a lot,

    Hi,
    You can read the value of ZVAR1 from I_T_VAR_RANGE in your exit coding.
    Then perform the required manipulation to populate ZVAR2.
    Thanks,
    Balaji

  • Need help in writing code Customer Exit for reporting Variable

    Hello Gurus,
           I have a requirement.When a authorized user logins to view the report, he should see only customers available in the value help screen.In the value help screen it is displaying all the customers, but data is displayed perfectly fine for the authorized sales rep. By default, Value help screen displaying all the customer numbers.
    How can I restrict in the value help screen?
    Any help appreciated with points.
    Regards,
    PNK

    Hello PNK,
    You can use a variable with Process type Authorization. This enables variables to be filled with values automatically from the user authorization.
    http://help.sap.com/saphelp_sem40bw/helpdata/EN/44/599b3c494d8e15e10000000a114084/content.htm
    Thanks
    Chandran

  • Customer Exit for BW Variables

    Dear all,
    I am a BW Consultant and have a very limited knowledge in ABAP. I have the following scenario:
    My BW query has the following input variables:
    0P_FYEAR      Fiscal Year (Single Value Entry)
    0P_PER3      Posting Period (Single Value Entry)
    and the following text variables:
    ZT_FYEAR     (Text variable for Year)
    ZT_PER3     (Text variable for Period)
    ZT_CQTR   (Text variable for Comparative Quarter)
    Now, I need guidance to write ABAP code in CMOD that will achieve the following results:
    1.     Display last date of Period., e.g.:
    -     Return 31 to ZT_PER3, if January (Period 1) is selected from 0P_PER3.
    -     Return 28/29 to ZT_PER3,  if February (Period 2) is selected from 0P_PER3.
    2.     Display as Period 12.
    Display Period 13, Period 14, Period 15 & Period 16 as Period 12, e.g.:
    -       Return 12 to ZT_PER3, if Period 13 is selected from 0P_PER3.  The same goes for Period 14, 15, & 16.
    -       Otherwise, return the same period to the text variable.
    3.     Quarter-to-date Comparison
    -     If Quarter 1 periods (Period 1, 2 or 3) and Year 2012 is selected from 0P_PER3 and 0P_FYEAR, return Quarter 4 to ZT_CQTR and Year 2011 to ZT_FYEAR.
    -      Otherwise, return previous quarter and same fiscal year to the text variables.
    Would really appreciate your assistance.
    Thanks!

    Hi Fulham,
    For point 3:
    case 0P_PER3.
    when '1' or '2' or '3'.
    ZT_CQTR = '4'.
    ZT_FYEAR = 0P_FYEAR - 1.
    when '4' or '5' or '6'.
    ZT_CQTR = '1'.
    ZT_FYEAR = 0P_FYEAR.
    when '7' or '8' or '9'.
    ZT_CQTR = '2'.
    ZT_FYEAR = 0P_FYEAR.
    when '10' or '11' or '12'.
    ZT_CQTR = '3'.
    ZT_FYEAR = 0P_FYEAR.
    endcase.
    Hope This Helps.
    Ernesto.

  • Customer Exit for Formula Variable

    Hi all, and thanks in advance for your help on this one.
    I'm trying to run a function module to convert the value of a characteristic in my ODS to a formula variable. To do this, I've created a replacement path variable to hold the value of the characteristic, and then I'm passing this value to another module to convert it to factory date.
    Here is my code ZTSTGIDT is the name of the replacement path variable that is set to equal the characteristic key value.
    DATA: CONVERTDATE  TYPE SYDATUM. " Date
    DATA: FAC_DATE     TYPE FACDATE. " Factory Date
    DATA: ZE_T_RANGE TYPE RSR_T_RANGESID WITH HEADER LINE.
        WHEN 'ZFACDY01'.
            CLEAR: ZE_T_RANGE, E_T_RANGE.
    *  Get the Goods Issue date from the formula variable.
        IF I_STEP = 2.
          READ TABLE I_T_VAR_RANGE
          WITH KEY VNAM = 'ZTSTGIDT'
          INTO CONVERTDATE.
          CALL FUNCTION 'DATE_CONVERT_TO_FACTORYDATE'
          EXPORTING
          CORRECT_OPTION = '+'
          DATE = CONVERTDATE
          FACTORY_CALENDAR_ID = 'ZB'
          IMPORTING
          FACTORYDATE = FAC_DATE
          EXCEPTIONS
          CALENDAR_BUFFER_NOT_LOADABLE = 1
          CORRECT_OPTION_INVALID = 2
          DATE_AFTER_RANGE = 3
          DATE_BEFORE_RANGE = 4
          DATE_INVALID = 5
          FACTORY_CALENDAR_NOT_FOUND = 6
          OTHERS = 7.
          IF SY-SUBRC = 0.
              ZE_T_RANGE-LOW = FAC_DATE.
              ZE_T_RANGE-SIGN = 'I'.
              ZE_T_RANGE-OPT = 'EQ'.
              APPEND ZE_T_RANGE to E_T_RANGE.
          ENDIF.
        ENDIF.
    The variable ZFACDY01 does not receive a value from this code, and it seems as if the variable CONVERTDATE never receives a value from the replacement path variable.
    1.) Is it even possible to read the characteristic value in this way?
    2.) Is there another way to read the characteristic value directly from my ODS at runtime for the record in question?
    The much easier solution is to create new key figures for each date that we need to convert to factory days and to do the conversion in the update rules, but doing so would require extensive reloads of many years worth of data. Even though performance will be impacted, we're trying to find a workaround (queries will be batch-run at night, anyway).
    Many thanks (and points!) for the person who can figure this out

    I tried using different I_STEP stages, but the replacement path variable still doesn't seem to be populated when it passes the value to the function module to convert to factory days.

  • Problem in creating include program for customer exit for BC425_01

    Hi,
         I want to write a customer exit for transaction BC425_01. For identifying the include program for exit , i go to System->Status.There I double click on the program name(GUI).Then I perform a 'FIND' in main program for 'customer-function' keyword. I get 3 search results with "CALL CUSTOMER-FUNCTION '001' " , "CALL CUSTOMER-FUNCTION '002' " , "CALL CUSTOMER-FUNCTION '003' ".
    Now i double click on CALL CUSTOMER-FUNCTION '001'  and i am taken to the code of program where this function is called in MODULE cust_check INPUT. I double click on CALL CUSTOMER-FUNCTION '001'  and then I am taken to the function module code which contains a single statement 'INCLUDE ZXBC425G01U01 .' .
    Now I double click on this include program so that I can write my own code. But when i double click on it , a message displayed 'Program names ZX.. are reserved for includes of exit function groups'. Hence I am not able to creates this include program and write my coding.
    Kindly Help
    THANKS

    Hi Amber,
    Then you click enter button.It is asking to create object with that include name ZXBC425G01U01 in a pop-up.You  should select YES option.It will ask package . Give the package name and save.Then include program is created and allowed you to write your own code.
    Thanks,
    Prasad GVK.

  • 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

  • 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

  • How to find CUSTOMER EXIT for a Standard SAP program

    How to find CUSTOMER EXIT for a Standard SAP program

    Hi
    To introduce the techniques of enhancement in standard SAP system. SAP creates customer exits for specific programs, screens, and menus within standard R/3 applications. These exits do not contain any functionality. Instead, the customer exits act as hooks. You can hang your own add-on functionality onto these hooks.
    They do not affect standard SAP source code.
    When you add new functionality to your SAP System using SAP’s exits, you do not alter the source code of standard SAP programs in any way. The code and screens you create are encapsulated as separate objects. These customer objects are linked to standard applications, but exist separately from SAP’s standard software package.
    They do not affect software updates.
    When you add new functionality to your SAP System using SAP’s exits, your objects (called customer objects) must adhere to strict naming conventions. When it comes time to upgrade a to a new software release, customer objects’ names ensure that they will not be affected by any changes or new additions to the standard software package.
    Customer exits are not available for all programs and screens found in the SAP System.
    Any change made to an SAP object in a customer system is called a modification. Customers usually modify their systems for one of two reasons. Either they make changes to the SAP standard in order to adjust the R/3 System to their specific business needs (actual modifications), or they alter individual SAP objects in order to correct an error (as recommended in an SAP error note).
    You should only modify the SAP standard if the modifications you want to make are absolutely necessary for optimizing work flow in your company. Be aware that good background knowledge of application structure and flow are important prerequisites for deciding what kind of modifications to make and how these modifications should be designed.
    SAP application programmers create SAP enhancements in transaction SMOD using function module exits, menu exits, and screen exits.
    Customers are given a catalog containing an overview of existing SAP enhancements. They can then combine the SAP enhancements they want into an enhancement project using transaction CMOD.
    SAP enhancements are made up of component parts. These components include function module exits, menu exits, and screen exits. A specific component may be used only once in a single SAP enhancement (this guarantees the uniqueness of SAP enhancements).
    Customer enhancement projects consist of SAP enhancements. Each individual SAP enhancement may be used only once in a single customer enhancement program (this guarantees the uniqueness of a customer project).
    SAP application programmers preplan function module exits, menu exits, and screen exits for their applications and combine them to create useful enhancements for the R/3 System.
    Customers create their own enhancement projects for their systems using SAP enhancements. You can customize the individual components of an enhancement project by creating your own include programs (for function module exits), texts (for menu exits), and subscreens (for screen exits).

  • Customer exit for difference of weeks

    Hi All,
    I have two formula variables with processing from customer exit.
    1. ZVAR_FV1 = getting current calendar week from system
    2. ZVAR_FV2 = getting user entry week in formula variable
    Now I want to find the difference between the two.
    So if current week is 012011 and user entry week is 502010
    then ZVAR_FV1 = 201101
           ZVAR_FV2 = 201050
    I need the difference of the two weeks as 3
    Can u please advise how can i get that ?  is it possible to find the difference of the two in the query level?  if i need to write a customer exit can u please advise the code for it as I am not an ABAP expert...
    Many thanks!
    Tanu

    Hi,
    As per you mail you have two variables.
    ZVAR_FV1 & ZVAR_FV2.
    Take a new variables ZVAR3 till ZVAR7
    ZVAR3 = ZVAR1_FV1+0(4).
    ZVAR4 = ZVAR1_FV2+0(4) .
    ZVAR5 = ZVAR3 -ZVAR4.
    ZVAR6 = ZVAR5 * 52.
    ZVAR7 = ((ZVAR1_FV1+4(2)) + ZVAR6) - (ZVAR1_FV2+4(2)).
    By the above code you will have your 3 in the variable ZVAR7.
    Thanks & Regards,
    Vishnu

Maybe you are looking for

  • C6180 does not appear in my list of printers in Printer setup utility (mac OS X 10.4.11)

    My C6180 was printing slowly so I followed the steps in the forum (unplugging, holding down the buttons, etc. ... Shut down, restart, etc.) Now it doesn't appear in my list of available printers when I try to set up again in the Printer Setup Utility

  • Windows 8.1 recurring BSoD (BAD_POOL_HEADER)

    Dump files - https://onedrive.live.com/redir?resid=5D2B2627890829C!462&authkey=!AGLwKEUk2zRCleM&ithint=file%2c.zip I just upgraded my Windows 8 Pro to Windows 8.1 Pro and have been getting these BSoD's as soon as I reach the start screen. Had to rest

  • Error on Online Interactive form:

    hi, i have encountered this error while trying out the Online Interactive form: com.sap.tc.webdynpro.clientserver.adobe.pdfdocument.base.core.PDFDocumentRuntimeException: Severe : PDFDocument is NULL. Exception : Service call exception; nested except

  • Apps won't launch... help!

    My phone was working fine this morning, but suddenly my apps won't launch anymore... I have NetNewsWire, Super Monkey Ball, and Tap Tap currently loaded. The camera seems to crash as well... Safari, iTunes, App Store, Ipod, mail, etc. all seem to be

  • WORKFLOW ITEM forward

    Hello All, When I am trying to forward workflow item using SWIA , I am getting the message like " WS is not a valid object type for a task". It's in statuts "STARTED" and AGENT is "SAP WORKFLOW". How can I forward this item to user as workflow admini