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.

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

  • 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

  • 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 - ABAP Code

    Hi Friends,
    I have a scenario in one of the query and need to write a customer exit for the same. Here is the scenario:
    I am using one input variable XXX to get input from user which feeds value to one of the charateristic lets say "CHAR1" in query. I have one more characteristic "CHAR2" which has to get the value from the same variable XXX. This is not allowed in BI7.0 as the variable is Hierarchy Node type. It gives error that "Variable XXX is used for two different characteristics."
    So i need to create one more vaiable YYY which will get the value from XXX and then YYY will feed value to CHAR2. I would appreciate if some one could tell me step by step how to write customer exit and give me the piece of ABAP code i need to write in my case.
    Your help will be appreciated in terms of points.
    Thanks,

    Hi Manmit,
    The following link can guide you on how to write customer exits (this has example as well)
    [http://help.sap.com/saphelp_nw70/helpdata/EN/61/579b3c494d8e15e10000000a114084/frameset.htm]
    Hope this helps.
    Cheers,
    Sumit

  • 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

  • Doubt Regarding Customer Exit

    Hi All ,
    In customer exit MM06E005 we have a screen area named INCLUDES in the components screen , in that we have two customer includes .
    My doubt is that whether it is mandatory that we can add only the field that are added in that customer includes i.e CI_EKKODB  CI_EKPODB  or we can add any others from other customer includes such as CI_COKB in the table EKKN..

    Hi,
    You can add fields in other cusomer include also but then this userexit will not be useful for you since its using CI_EKKODB and CI_EKPODB.
    REWARD IF USEFUL

  • 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

  • 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

  • Regarding Customer Exit

    I am doing Function Exit for Transaction CO12.
    When the Wage Group is initial it should display message like "Enter Shift A/B/C in field Wage Group".
    i am getting this one. after display this message screen should go to previous screen ( What we entered data) . I am getting this one but data is clearing and fresh CO12 transaction is opening.
    I want that data also.
    Please sugget.
    Regards
    Rami

    Dear Rami Reddy,
    This is a functio Exit.
    i don't think you need to use LEAVE SCREEN.
    see from the Standard Code of SAP the funtion module will get called and it come to your code, after executing the FM it will contine processing further.
    in Function Exits IT is not adviceable to use LEAVE SCREEN or CALL SCREEN unless suggeted by the FM documentation
    Most importantly you are using the LEAVE SCREEN with in a loop.
    please analyze your code with peace of mind.
    regards
    Ramchander Rao.K
    Edited by: ramchander krishnamraju on Nov 20, 2008 8:18 AM

  • Regarding Customer exit to calculate fiscal week

    Hello All,
                 I have a requirement to calculate the fiscal week from fiscal period. Here i used the FM 'UMC_FISCPER_TO_CALWEEK' to calculate the fiscal week. But the problem here is i created variable on fiscal year /week so when i pass the fiscal period i should get fiscal week, here i am getting calweek which make no sence. Is there any function module to calculate the Fiscal week if we pass fiscal period.
    Thanx in Advance
    Anil

    We cant calculate fiscal week from just fiscal period. we need date or this.
    You can try this function  ZFI_GET_FISCAL_WEEK_QUARTER or some other similar function. However, the input should be a date.
    Looks like there is no funciton to calculate fiscal week. we may need to write our own code for this based on other FMs.
    Re: Get Week number in a particular Fiscal year
    ~ Arun KK
    Edited by: arun kk on May 8, 2008 10:22 AM

  • 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

Maybe you are looking for

  • 2 node cluster down and can't boot

    HI, Due to power problem my 2 node cluster (both the node) got down all of a sudden abruptly. Now i can not boot any node. Is giving following error: Rebooting with command: boot Boot device: /pci@1c,600000/scsi@2/disk@0,0:a File and args: SunOS Rele

  • How to change image resolution in oracle forms.

    Hi Experts, I am working on oracle forms 10g (Windows7 OS). Can we get the image resolution of an image item in oracle forms? Can we resize the image in terms of resolution? I have a requirement where user can upload only 1280x720 size images. Either

  • More QT AVI stuff

    Hi, I realize this is the most boring topic in the world, but i just got my new imac, upgraded to QT 7 Pro and now I can't play all the old AVI movies i USED to be able to play on my old mac. I've been at this for an hour or so and downloaded so many

  • ERRORS IN WAVE HEURISTIC. PPDS

    Hi all, I´m trying to balance resources with Wave heuristic, and I´m getting the following errors. I have used PPM Could anyone try to help me please? thanks in advance: Order has incorrect requirements quantity Message no. /SAPAPO/OM023 Diagnosis A

  • Stuck with the jwdsp1-1 web services tutorial

    I'm busy trying to complete this tutorial: http://java.sun.com/webservices/docs/1.1/tutorial/doc/JAXRPC.html#wp72279 but at the stage of 'Compiling the Service Definition Code To compile HelloIF.java and HelloImpl.java, go to the <JWSDP_HOME>/docs/tu