Customer exit in BEx

Dear all,
I do not have the clear picture regarding where we write the ABAP coding in
BEx.
Thanks
V.G.VG

HI,
In CMOD, you ned to look [or create] for project that contains enhancement RSR00001, where u can find the function module "EXIT_SAPLRRS0_001".
try to follow some steps in 'how to' doc related to this, and sample code may useful for you
https://websmp206.sap-ag.de/~sapdownload/011000358700002762582003E/HowToDeriveVariableValue.pdf
https://websmp206.sap-ag.de/~sapdownload/011000358700002765042003E/HowToVerifyVariableInput.pdf
Regards,
DST

Similar Messages

  • Customer exits in Bex

    Hello BW Experts,
    Could any one give me some pointers / web sites / materials / oss notes for Customer exits in Bex.
    Any help is highly appreciated.
    Thanks,

    Check Out service.sap.com/bw ... See under "SAP BW InfoIndex" there you find a section called "Exit".
    Let me warn you about Custome Exits usage in BEx ... be carefull about performances!
    Hope it helps
    GFV

  • How to get data for current week and previous week using customer exit in Bex.

    Hi everyone,
    I have a scenario in which I need to display data for current week and previous week (based on "sy_datum" the program has to calculate current week and previous week) in Bex using  Customer exit. I have created one variable in Bex Query Designer and I have written code for the variable in CMOD. But it is not working fine, (I know that we can do the same by using offset value in Bex). Can some one guide me how to achieve my requirement using customer exit.
    Thanks in Advance,
    G S Ramanjaneyulu.

    Hi krishna,
    Thanks for your quick reply, can you have a look at my code,
    case i_vnam.
    WHEN 'ZPWK_CWK'.
    ranges : pre_week for sy-datum.
    data : start_date type DATS,
           end_date TYPE dats .
    ************FM TO GET FIRST DATE OF CURRENT WEEK ************************
    CALL FUNCTION 'BWSO_DATE_GET_FIRST_WEEKDAY'
      EXPORTING
        DATE_IN  = sy-datum
      IMPORTING
        DATE_OUT = start_date.   " WEEK FIRST DATE
    end_date = START_DATE + 6.   " WEEK LAST DATE
    END_DATE   = START_DATE - 1.   " PREVIOUS WEEK END DATE
    START_DATE = START_DATE - 7.   " PREVIOUS WEEK START  DATE
    **********PREVIOUS WEEK DATES IN PRE_WEEK******************
    pre_week-SIGN   = 'I'.
    pre_week-option = 'BT'.
    pre_week-LOW    = START_DATE.
    pre_week-HIGH   = END_DATE.
    APPEND  pre_week.
    CLEAR : START_DATE,END_DATE.
    endcase.
    Regards,
    G S Ramanjaneyulu.

  • Search instring value of Variable in customer exit of bex report

    Hello experts-
    I have a situation where I need to search the records based on value  of a variable input in selection screen of bex report and according to that i need to show the results in report.
    Ex- if we have a material characteristics on selection screen,or material number has 10 digits(eg 1234567809). so the user will only type 2-3 digit(i.e 12) on selection screen, In this case I want only those records to be displyed, for which material has these 2 digits in it .
    Eg would be:
    1234567809,
    3451267809,
    9807654312.
    Could you please suggest ABAP logic for the above. Properties of variable and how many variable we have to create.
    Regards,
    Yatendra

    Hello Vineet,
    we have tried putting  ' * ' i n place of '=' in drop down screen.
    we have also tried customer exit code, please check below.
       WHEN 'ZSEARCH'.
         data: lv_string type string.
         data: wa_test type ZTEST_TOOLING.
    if I_STEP = 2.
         LOOP AT i_t_var_range INTO loc_var_range
                   WHERE vnam = 'ZTSEARCH'.
              CONCATENATE '' loc_var_range-low '' INTO L_S_RANGE-LOW.
              L_S_RANGE-SIGN = 'I'.
              L_S_RANGE-OPT = 'CP'.
              APPEND L_S_RANGE TO E_T_RANGE.
         ENDLOOP.
      endif.
    In  this code we have created two variables 1st 'ZSEARCH' which is type of 'customer exit' , and the second one 'ZTSEARCH' type of "user entry/ default value" .
    As we need the value provided by user in  ZTSEARCH (user entry), we loop at  i_t_var_range where vnam = 'ZTSEARCH'.
    But i_t_var_range doesn't contain  ZTSEARCH variable.
    Can you please suggest in customer exit code as well as in selection option.
    Thanks
    yatendra

  • Customer exit in BEx Query

    Hi,
    I've created a BEx query and added a variable MCE9004 in field Ref.org.unit and this variable is mapped to a customer exit code via CMOD step 2 (post_popup).
    Basically how I want it to work is, I will select an org.unit value e.g. org.unit = A1 in tcode RSRT variable selection screen and this value will be passed in the customer exit code as shown below and retrieve the look up values and pass it to the field ref.org.unit via e_t_range.
    CASE i_vnam.
         WHEN 'MCE9004'.
    ****      IF i_step = 2.
           READ TABLE i_t_var_range INTO LS_T_VAR_RANGE
           WITH KEY IOBJNM = '0CALMONTH'.
           l_date = LS_T_VAR_RANGE-low.
           IF l_date IS NOT INITIAL.
             CALL FUNCTION 'SLS_MISC_GET_LAST_DAY_OF_MONTH'
               EXPORTING
                 day_in            = l_date
               IMPORTING
                 last_day_of_month = ld_last_day
               EXCEPTIONS
                 day_in_not_valid  = 1
                 OTHERS            = 2.
           ENDIF.
           READ TABLE i_t_var_range INTO LS_T_VAR_RANGE
           WITH KEY IOBJNM = '0ORGUNIT'.
           SELECT /BIC/ORGUNT_PR FROM /BIC/AMPA5AX0000 INTO lv_org "l_s_range
             WHERE ORGUNIT = LS_T_VAR_RANGE-low
             AND DATETO LE ld_last_day.
             l_s_range-SIGN = 'I'.
             l_s_range-OPT = 'EQ'.
             l_s_range-LOW = lv_org.
    *          l_s_range-HIGH =
             APPEND l_s_range TO e_t_range.
           ENDSELECT.
    ***** To clear value of org.unit field
    ****      READ TABLE i_t_var_range INTO LS_T_VAR_RANGE
    ****      WITH KEY IOBJNM = '0ORGUNIT'.
    ****      IF sy-subrc EQ 0.
    *****        CLEAR LS_T_VAR_RANGE-low.
    ****        DELETE i_t_var_range index sy-tabix.
    ****      ENDIF.
       ENDCASE.
    ENDFUNCTION.
    Once this code has been executed it goes back to the selection screen and there is still an org.unit value on the screen even though I have removed it in my code in red above in i_t_var_range.
    Therefore when I execute the query, the value for org.unit field is not emptied.
    Can you please teach me how to clear that value of org.unit field?
    Let me know if you need further details.
    Thanks,
    Rebekah

    hi thomas,
    yes i get your point but the thing is i need to modify a value in the import table. coz the export table is not for the org.unit field but the ref.org.unit field.
    Basically i pass in org.unit = A1 and e_t_range will have the lookup values to be passed in ref.org.unit field which is B2 and C3.
    Then when i click execute, i want my filter only to have the values B2 and C3 and A1 shud be removed.
    is there any way i could do that?
    please advice.
    Thanks,
    Rebekah

  • Migrating Customer exit  for BEX variables to BADI's

    Hi All,
    I am new to ABAP In the context of BW.
    I am  using exit RSR00001 to populate variables in BEX reports.
    I want to migrate this customer exit RSR00001 to BADI.
    Can any one please tell me how to migrate the same and how it will fire in place of exit?
    Thanks In Advance
    Dhananjay

    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

  • Regarding Customer Exit in Bex

    Hello Expers.
    Here is my scenario: I have variable which accepts the key date from the user. The requirement is to get the calmonth from the date entered by the user. According to my point of view, Writing customer exit is a best option but i do not know is it possible for me to pass the date, entered by the user, to exit? If Yes than please let me know how?
    Help required Urgently

    use the parameter I_STEP which specifies when the enhancement is called.
    The following values are valid for I_STEP:
    ·        I_STEP = 1
    Call takes place directly before variable entry
    ·        I_STEP = 2
    Call takes place directly after variable entry. This step is only started up when the same variable is not input ready and could not be filled at I_STEP=1.
    ·        I_STEP = 3
    In this call, you can check the values of the variables. Triggering an exception (RAISE) causes the variable screen to appear once more. Afterwards, I_STEP=2 is also called again.
    ·        I_STEP = 0
    The enhancement is not called from the variable screen. The call can come from the authorization check or from the Monitor.
    sample code : user enter value of date in say variable ZDATE
    l_s_range TYPE rsr_s_rangesid,
    l_t_var_range TYPE rsr0_s_var_range.
    WHEN 'ZCALM' .
    if i_step=2.
    read table i_t_var_range into l_t_var_range with key vnam = 'ZDATE' .
    if sy-subrc = 0.
    l_s_range-low = l_t_var_range+0(6).
    l_s_range-high = l_t_var_range+0(6).
    l_s_range-opt = 'EQ'.
    l_s_range-sign = 'I'.
    append l_s_range to e_t_range.
    endif.
    endif.

  • Variable with Customer Exit  on BEX

    Hi Experts,
    I have a query with a key figure 0CALDAY, restricted by the variable ZSCAL7 (Acumulated Period). This variable is defined as 'customer exit'.
    How can I see with is the exit that apply?

    Go to CMOD tcode and select project for enhancement RSR00001.
    In the Function module EXIT_SAPLRRS0_001 create click oninclude ZXRSRU01  and there find your variable.
    Hope it helps.
    Regards

  • Customer exit in BEx to derive Cal month

    hey all,
    i need to write  a customer exit, to derive  prev Cal Month value from the given Calday. I have written the code but it derives the current cal month instead of previous. any suggestions ?
    case I_VNAM.
      when 'ZCU_CMTH' .
        if i_step = 2.
          loop at i_t_var_range into l_s_var
                  where vnam = 'ZCCCD'.
            CMTH_YR = l_s_var-low.
            l_s_range-low = CMTH_YR(6).
            CMTH = CMTH_YR+4(2).
            CMTH = CMTH - 1.
            L_S_RANGE-LOW+4(2) = CMTH.
            l_s_range-sign = 'I'.
            l_s_range-opt  = 'EQ'.
            write :/ l_s_var.
            append l_s_range to e_t_range.
          endloop.
        endif.
           clear l_s_range.
    endcase.
    thanks
    Laura.

    Hi,
    Try the following logic to get the previous year month based on calday:
    data :CMTH_YR (4),
             cmth_mn(2).
    case I_VNAM.
    when 'ZCU_CMTH' .
    if i_step = 2.
    loop at i_t_var_range into l_s_var
    where vnam = 'ZCCCD'.
    if l_s_var-low+4(2) eq '01'.
      CMTH_YR = l_s_var-low+0(4) - 1 .
      concatenate CMTH_YR  '12' into L_S_RANGE-LOW.
    else.
      cmth_mn =  l_s_var-low+4(2) - 1 .
      concatenate l_s_var-low+0(4)  cmth_mn into L_S_RANGE-LOW.
    endif.
    l_s_range-sign = 'I'.
    l_s_range-opt = 'EQ'.
    append l_s_range to e_t_range.
    endloop.
    endif.
    clear l_s_range.
    endcase.
    hope it works...
    regards,r
    raju

  • Implenting BADI in place of customer exit in BEX reports in BW

    Hi all,
    I am new to implemrnting BADIS in to BW.
    We have already used user exit  RSR00001.
    We want to use BADI's in place of exit 'RSR00001' .
    Can any one tell me how to migrate the existing exit to BADI using tcode SAPU.
    OR any one can help me regarding implementing BADI's in place of 'RSR00001'  exit.
    Thanks'
    Dhananjay

    I am afraid there is no such BADI template in the place of RSR00001

  • Bex Odata Services with Customer Exit

    Hi All,
    Im using Bex as Odata Services in order to export the result set , everything works fine until i tried to use Customer Exit in Bex...in that moment the Odata Service goes down an shows a few errors.
    Does anybody know how can i manage this?
    Thanks a lot.

    Hi Marcos,
    Can you please explain your scenario and what you have done so far (e.g. share the coding in the user exit)?
    I understand that you get a few error messages. Please share them too and display the error messages on the lowest level (with details on the error).
    Last but not least, on which BW release and SP level are you working?
    Thanks,
    Sander

  • Number of working days in customer exit?

    Hi, this is actually an extension to the following thread.
    How to calculate number of working days
    I have very similar requirement. Determine the number of working days (excluding weekends and holidays) from 2 given dates. But the <b>difference here</b> is that, one of the date in the calculation is the<b> current date.</b>
    1: Creation Date - this is present as infoobject in the ODS.
    2: Current Date - this is 'today''s date.
    And, No. of Working days(Zworkdays)  = Current Date - Creation Date.
    So, as mentioned in the thread 305257 speaks about including the logic in the update rules, I can use system variable sy-datum to get the current date in update routine. But if the load is not scheduled for every day (say,once in 2 days), then when i report this infoobject Zworkdays on Day2, then it will hold Day1 calc rite?
    PLease correct me if I am wrong.
    Could you please help me with other approachs I can follow. One I can think is Customer Exit in Bex for the same.... but I am not sure how to do the same (i am new to Bex and Customer exit). Could any one of you please guide me how to achieve the same. I Have 0CalDate in the ODS also. 
    Any other ideas/inputs is greatly appreciated.
    Thanks in advance
    Ramya

    Hi,
    search for virtual key figures.
    Rgds.
    Juergen
    P.S. Thanks for assigning points
    Message was edited by:
            Jürgen Hemelt

  • Using variable values form parametrized URL in Customer Exit in i_step = 1

    Hello BW experts,
    I call a parametrized URL to a Web Template that has a Query with the variable VAR1:
    http://XXX?...&CMD=LDOC&template_id=TEMP1&VAR_NAME_1=VAR1&VAR_VALUE_EXT_1=2006
    Then I try to access the value of VAR1 in i_step = 1 in the Customer Exit for BEx variables in order to determine the value for a customer exit variable VAR2:
    WHEN 'VAR2'.
        IF i_step = 1.
          READ TABLE i_t_var_range INTO var_range
            WITH KEY vnam = 'VAR1'.
          fl_var_range-sign = 'I'.
          fl_var_range-opt = 'EQ'.
          fl_var_range-low = *some operation with var_range
          APPEND fl_var_range TO e_t_range.
        ENDIF.
    The problem is that VAR1 contains either the default values (if the variable is set to have default variables) or is empty (if there are no default variables defined). It does not retrieve the value in the URL in the Customer Exit, but displays it correctly in the variable screen.
    Is there any way I can acces the URL parameter in the Customer Exit?
    Thanks for any answers in advance.
    Michael

    Gili,
    thanks for your answer. The problem was, though, that the first value determines the behavior of the variable screen by setting the value of a customer exit variable.
    My goal was to have two variable screens. In the first a date is chosen and in the second a node of a time-dependant hierarchy is chosen. If one enters the date in the same screen as the hierarchy, the valid hierarchy for the date is not displayed.
    I solved the problem now in following way:
    <b>1. Saving the value in SAP Memory as a parameter.</b> The parameter has to be defined in SE80. A Dummy Web Template with a query on the same Infoprovider with just the two InfoObjects (Year/Month) displays a variable screen for Month/Year. In addition there is a Dummy Customer Exit variable that is needed in order to pass the variable values (month/year) into SAP Memory. Using JavaScript in the Dummy WebTemplate the second Web Template with the actual query is called without displaying anything else than the variable screen.
    WHEN 'DUMMY_CUSTOMEREXIT_VAR'.
        data: w_date like sy-datum
        IF i_step = 2.
          READ TABLE i_t_var_range INTO var_range
            WITH KEY vnam = 'VAR1'.
        do your peration
        i.e.  w_date(4)+2 = var_range-low.
                 w_date(6)+2 = var_range-high.
          SET PARAMETER ID 'ZBW_PARA1' FIELD w_date.
        ENDIF.
    <b>2. Retrieving the value from SAP Memory</b> Before displaying the variable screen, the chosen date is retrieved from SAP Memory and used to set the date for a customer exit variable for the hierarchy validity date.
    WHEN 'VAR2'.
        IF i_step = 1.
          GET PARAMETER ID 'ZBW_PARA1' FIELD w_date.
        do some operation with     
          APPEND fl_var_range TO e_t_range.
        ENDIF.
    It is quite a comlex construct, but it works....

  • Customer Exit notes

    hey all,
    Can anyone help me, where can i find more information on writing customer exits in BEx. i want a better understanding of what does low, high etc mean.
    thanks
    Laura.

    hi laura to create a customer exit:
    Execute TX CMOD.
    Choose either existing project or create a new one.
    enhancement = RSR00001
    Press the button Components
    Double click on a row with EXIT_SAPLRRSO_001.
    Double click on INCLUDE ZXRSRU01.
    If want information on the fields LOW, HIGH etc.
    1.choose enhancement assignment radio button on tx cmod   window.
    2.click on the display documentation icon(CTRL+F4)
    Message was edited by:
            Karthik Ten

  • Customer Exit  (ABAP) Error

    Hi Experts,
    I developed a Customer Exit Variable (BEx)..ZVDAT
    In Variable definition i defined  'Processing Type-Customer Exit' and in CMOD i have written below code
    My requirment is to display records whose Expiry Date is Greater than and equal(>=)  to Current Sys Date (Current Date)
    The system is not displaying any error but when i execute query it is not displaying the desired
    Please correct any errors in the code below
    IF I_STEP = 1.
    CASE i_vnam.
    WHEN 'ZEDAT'.  "Policy  Expiry Date"
    CLEAR: l_s_range.
    l_s_range-low  = sy-datum.
    l_s_range-opt = 'GE'.
    l_s_range-sign = 'I'.
    APPEND l_s_range TO e_t_range.
    Endcase.
    Endif.

    Hi,
       Use the below code and try your program. I think this is the one you should use at i_step = 2
       not i_step = 1
    CASE i_vnam.
    WHEN 'ZEDAT'. "Policy Expiry Date"
              IF I_STEP = 2. "after the popup
                LOOP AT I_T_VAR_RANGE INTO LOC_T_VAR_RANGE
                WHERE VNAM = 'Your Variable Name'. '
                  CLEAR L_S_RANGE.
                  L_S_RANGE-LOW = 'Policy Start Date'    'Variable Start Date Value entered by User
                  L_S_RANGE-HIGH = Sy-Datum. "high value = input
                  L_S_RANGE-SIGN = 'I'.
                  L_S_RANGE-OPT = 'GE'.
                  APPEND L_S_RANGE TO E_T_RANGE.
                  EXIT.
                ENDLOOP.
              ENDIF.
    Regards,
    Raj

Maybe you are looking for

  • S_ALR_87012168 : specific layout

    Hi, I look for a specific layout in Tcode S_ALR_87012168 : Due date analysis for open items i want to display in one list all the selected customers with thier daily intervals. Please is it possible to make this layout ? if yes, How ? Regards.

  • Error "Failed To Connect To An Exchange Server In The Current Site" While Running Exchange 2013 Shell

    hi I've installed Exchange 2013 on Windows Server 2012 and it reported as successfully installed. I see no issues with Exchange Setup Logs. On trying to connect to Exchange Management Shell I receive errors and I am unable to connect. New-PSSession :

  • ICloud and Outlook2013

    Dear .. I want to sync my outlook2013 calendar with my iphone, but iTunes can not read the outlook account, so I switched to iCloud. It seemed smooth for the first time, outlook synced to iphone. But - Calendar on outlook was moved to a new account i

  • Currency Conversion Problem

    Hi frndz, I am facing a problem with the currency conversion. In my Report i have used two keyfgures. One is directly calculating the values from R/3 side and converting into EURO. the other one is calculating through update rule. These teo keyfigure

  • Blazeds Proxy Service Error

    Trying to call an http service through a blazeds proxy service and getting this error faultCode = "Client.Error.MessageSend" faultDetail = "Channel.Connect.Failed error NetConnection.Call.BadVersion: anyone see this b4?