Help with Customer exit variable

Hi Guys,
     I need your urgent help. I have a requirement where I need to create a variable (on CALDAY) in a report which should use the input value given for another variable (created on CALMONTH). To put in words more clearly, CALMONTH is a variable that is mandatory for input but the CALDAY variable should not appear on the selection screen. I was told that I should write a customer exit to make this happen. So can someone please explain me the process of creating a customer exit and give me the code.
WHEN CALMONTH values are selected to be 07/2006 - 08/2006... CALDAY values should be 07/01/2006 to 08/31/2006.
CALMONTH is user entry, mandatory, range and multiple selection variable.
  Early reply is highly appreciated and duely rewarded. Please let me know if I am not clear about the requirement. Thanks a bunch in advance.

Let us say, user enters multiple ranges for the month, you would want corresponding date ranges for the same, right?
data : w_date like sy-datum.
case I_VNAM.
when 'ZCALDAY'. " Calday var
loop at i_t_var_range into LOC_VAR_RANGE         
     where iobjnm = 'ZCALMONTH'.
  WA_RANGE-SIGN = 'I'.     
  wa_date+2(6) = loc_var_Range-low.
  wa_date+0(2) = '01'.
  wa_range-low = wa_date.
  if loc_var_range-high eq space.
    WA_RANGE-OPT = 'EQ'.     
  else.
    wa_range-opt = 'BT'.
    wa_date+2(6) = loc_var_range-high.
    wa_date+0(2) = '01'.
    wa_date = wa_date + 31.
    wa_date+0(2) = '01'.
    wa_date = wa_date - 1.
    wa_range-high = wa_date.
   endif.
   append wa_range to e_t_range. clear wa_range.
endloop.
endcase.
This should do.

Similar Messages

  • Problem with customer exit variable in BeX Query

    Hi All,
    We have created a customer exit variable in a query and populated with few patterns in customer exit.
    My query has to bring all the records where the address line is containg the patterns passed through customer exit. Here the query is not working as expected.
    It is bringing the values where the address line is exactly same as the pattern and not bringing the records where the pattern is part of the address line.
    For example: Pattern passed in customer exit = 'HOSPITAL'
    The record where address line = 'HOSPITAL' is shown in the rpeort, where the record with address line = 'HOSPITAL ROAD' is not shown in the report.
    I would appreciate your help on this.
    Regards,
    Rakesh

    Hi Diogo,
    Below is the code I am using in the customer exit.
    SELECT * FROM zae_tt_pbuild INTO TABLE gt_pbuild.
          IF sy-subrc = 0.
            LOOP AT gt_pbuild INTO gs_pbuild.
              CONCATENATE '*' gs_pbuild-pbuild '*' into lv_pattern.
              ls_range-low = lv_pattern.
              ls_range-sign = lc_sign_i.
              ls_range-opt = 'CP'.
              APPEND ls_range TO e_t_range.
              CLEAR: ls_range,
                     lv_pattern.
            ENDLOOP.
          ENDIF.
         ENDIF.
    I have tried using '%' instead of '*' aswell but the result is same.
    Thanks,
    Rakesh

  • Authorization (rsecadmin) with customer exit variable

    Hello,
    I need to maintain authorization on 0CALMONTH with a customer exit variable.
    0CALMONTH is "authorization relevant"
    I created a variable of type "customer exit" : ZVAR001 (this variable is OK, I checked its value in a query)
    I created a new authorization object with 0CALMONTH = $ZVAR001.
    When I run my query I have a message due to authorization error.
    If I change my authorization object by replacing my variable ($ZVAR001) by a constant value I have no authorization problem.
    I don't understand why...
    Error logs don't help me to solve my problem : I have the following message "Message EYE007: You do not have sufficient authorization" and system just says I have "0CALMONTH  I EQ $ZVAR001 " but doesn't precise values under variable ZVAR001
    Thanks for your help

    Indeed problem was in costumer exit because I used condition with "I_STEP". Since I have delete my condition I have no authorization problem with my variable....

  • ABAP code Help for Customer Exit variable

    Hello All,
    Can anyone provide ABAP code for a customer exit variable please?
    Requirement:
    0CALYEAR(InfoObject) - ZCALCYR (Variable) <b>Calender year with default value actual year</b>.
    Proiperties of variable: single value,mandatory,ready for input,can'be changed in query navigation.
    i have read some docs on customet exit variables which i got from SDN but i found it's difficult for me to get this as i am not that good in ABAP.
    Thanks,
    Rakesh.

    Hi,
       Just check the below code. You just need to make slight changes I believe. Hope this helps you.
    In CMOD………..
    Sample code
      INCLUDE LXRSRF01                                                   *
    data: l_s_range type rsr_s_rangesid.
    case i_vnam.
      when 'ZCALCYR'.
        if i_step = 1.
         l_s_range-low = sy-datum+0(4).
            append l_s_range to e_t_range.
        Endif.
    Endcase.

  • Problem with customer exit variable that is input ready as well

    Hello all,
    I'm facing an issue with a customer exit variable that again has been defined as input ready. I'm not sure why it is working incorrectly and I#m wondering if this is a bug or if I do s.th. stupid.
    The problem is that in the exit program ZXRSRU01 this varibale does not go into the program code I have prepared for this variable. I have added entry points for all three i_step values 1,2,3, but the code will never be touched and in debugging I can see that it simply pypasses the code for this variable.
    I have tried to enter a value or to leave it blank, no difference.
    When I run another test by just using a customer exit variable w/o input ready capability, then I have no issue, the exit does exactly what I have coded.
    Does this mean, that a customer exit variable along with input readiness dows not work ?????
    You may ask why I need this variable. Well, my intention is to use the input value of this variable A to derive other values for a complete different variable B. Afterwards I want to erase the input given into variable A to have it blank.
    Any comments are appreciated
    Thanks

    Hi Heiko,
    I assume A & B variables are defined on different Characteristics. If you wish to derive B based on A, you can create the Query Characteristic Restriction on B & have a dummy RKF restricted on A whose processing is by Manual Input; where processing of B is by Customer Exit. In istep 2 you can check for B, read A & derive B. There would not be a need to blank out A since the Query would not be restricted on A - you can hide the dummy RKF from showing in the output. Just a thought.
    --Priya

  • Text Variable replace with Customer Exit Variable

    Dear Experts,
    I created a text variable based on replacementh path (instead of customer exit). The reference characteristic is same that as my customer exit Variable and replace it by Key.
    I want to replace it with already Existing Customer Exit Variable but it is not displaying in the List Box even though existing variable option is mandatory.
    Can any one Suggest me the answer for this.
    Regards
    Supraja.K

    I do not think you can select Customer Exit variable, if you see the type is selected to Char Value Variables and it is not editable.
    It would be suggested to go for Customer Exit procesing type for your text variable.
    Cheers,
    Neel.

  • Authorization with customer exit variable (CP, BT, EQ)

    Hi SDN-Experts,
    I have a question concerning the new authorization concept.
    I created an authorization for 0COSTCENTER which also contains the 3 special characters 0TCAACTVT, 0TCAIPROV and 0TCAVALID. I inserted a customer exit variable for 0COSTCENTER. The exit reads datasets from a db table which contains authorizations for the actual user. The authorizations have different formats, e.g. "1000", "1000;1200", "25*" etc.
    The internal table e_t_range is filled as followed in the exit:
      i   eq   1000
      i   bt   1000   1200
      i   cp   25*
    This does not work. It works if I only use "eq" OR "cp". But not both at the same time.
    How can I achieve to use the different authorizations in the db table for the bi authorization?
    Thanks in advance...
    Joerg

    Hi Olivier.
    Yes, the variable is defined as selection option and I did also try to use "EQ" instead of "CP".
    I tested again with another variable which is "ready for input" and is not used in an authorization. The Variable is filled in the customer exit. This is the code:
    WHEN 'ZJGR_COSTCTR_TEST'.
      l_s_range-sign = 'I'.
      l_s_range-opt  = 'BT'.
      l_s_range-low = '0000001000'.
      l_s_range-high = '0000001200'.
      APPEND l_s_range TO e_t_range.
      l_s_range-sign = 'I'.
      l_s_range-opt  = 'CP'.
      l_s_range-low = '0000002*'.
      APPEND l_s_range TO e_t_range.
    The result in the variable screen in BEx Analyzer is the following:
    1000 - 1200;0000002*;
    And it still does not work. It seems that you could not mix EQ, BT and CP. But this is exactly what I have to do with the authorization variable...
    Do you have any other tipps that I might try out?
    Thanks,
    Joerg

  • RSCRM: Query date with customer exit variable

    Hi All,
    Is there any way to run the RSCRM transaction with a query with a customer exit variable for a date characteristic?
    The issue is that the query ran ok but the variable is not being updated when the RSCRM query is running with a background job or a process chain.
    Thanks in advance
    EV

    I do not think you can select Customer Exit variable, if you see the type is selected to Char Value Variables and it is not editable.
    It would be suggested to go for Customer Exit procesing type for your text variable.
    Cheers,
    Neel.

  • Help with user exit variable

    Hello all,
    I need to create a customer exit variable to get a field (0calmonth) from an infoobject attribute and use this field to filter the query.
    I need some help to finish the code:
    WHEN 'my variable'.
        IF I_STEP = 2. "before the popup
          SELECT 0CALMONTH INTO ???    "0calmonth is the attribute.
          FROM /BIC/TZFECHAVAL            "infoobject table.
          WHERE... "conditions.
    Any help? Thanks. Points will be assigned.

    Hi,
    Pls check the below sample code.. and change the code
    WHEN 'Your Variable' .
          TYPES : BEGIN OF ls_batch ,
                  batch TYPE /bi0/oibatch,
                  END OF ls_batch.
          DATA : lt_batch TYPE TABLE OF ls_batch.
          DATA : wa_batch TYPE ls_batch .
          SELECT batch FROM /bi0/mbatch
          INTO TABLE lt_batch
          WHERE batch = 'XYZ'
             OR batch = 'ABC' .
          SORT lt_batch BY batch .
          DELETE ADJACENT DUPLICATES FROM lt_batch COMPARING batch .
          LOOP AT lt_batch INTO wa_batch .
            l_s_range-low = wa_batch-batch.
            l_s_range-sign = 'I'.
            l_s_range-opt = 'EQ'.
            APPEND l_s_range TO e_t_range.
          ENDLOOP.
    Thanks
    Reddy

  • Problem with customer exit variable

    HI i have created a customer exit variable to rread a table based in user input and pass it to my variable , every thing works fine but i get a waring message in my WAD saying
    RANGE-LOW for customer exit variable ZVSO_PRM corrected to #   BRAIN  746
    Does any one have any idea why is it comming
    my code is as follows
    WHEN 'ZVSO_PRM'.
    IF I_STEP = 2.
    DATA: BEGIN OF ZPROD_MODEL OCCURS 0,
    I_PROD LIKE ZCURR_PM_T-/BIC/ZPRODMOD,
    END OF ZPROD_MODEL.
    DATA: BEGIN OF ZREGIO_TABLE OCCURS 0,
    REGION LIKE ZCURR_PM_T-/BIC/ZREGION,
    END OF ZREGIO_TABLE.
    LOOP AT I_T_VAR_RANGE INTO LOC_VAR_RANGE
    WHERE VNAM = 'ZREG02'.
    CLEAR L_S_RANGE.
    ZREGIO_TABLE = LOC_VAR_RANGE-LOW.
    APPEND ZREGIO_TABLE.
    ENDLOOP.
    LOOP AT ZREGIO_TABLE.
    SELECT /BIC/ZPRODMOD FROM ZCURR_PM_T INTO TABLE ZPROD_MODEL WHERE /BIC/ZREGION = ZREGIO_TABLE-REGION.
    APPEND ZPROD_MODEL.
    ENDLOOP.
    SORT ZPROD_MODEL.
    CLEAR L_S_RANGE.
    LOOP AT ZPROD_MODEL.
    L_S_RANGE-LOW = ZPROD_MODEL-I_PROD.
    L_S_RANGE-SIGN = 'I'.
    L_S_RANGE-OPT = 'EQ'.
    APPEND L_S_RANGE TO E_T_RANGE.
    ENDLOOP.
    ENDIF.

    Could it be that the code doesn't find any value in ZCURR_PM_T table for the specified input region?

  • Problem with customer exit variable on date range

    Hi All,
    I have customer exit variable on date range. In the selection screen it has to give the week range  as a default (05/21/2009 to 05/27/2009).
    Earlier its working fine and from yesterday onwards it is not working properly. yesday onwards default date range was not displaying in selection screen.
    Wht would be the problem.
    Thanks in Advance

    Hi Ashish,
    I checked every thing what u told earlier. Every thing is fine.
    And another thing is
    I have routine in infopackage level. Since day before yesterday it was working fine and yesterday onwards it was not working.
    Eg: budat will take the data based on routine for the week. But yesterday onwards it is not picking up the data.however I have the data in datasource for the week.
    Wht would be the problem. I debuged the code and its working fine.
    Sekhar

  • Error With Customer Exit Variable

    Hi,
    I need To Create Customer Exit For Text Variable based on Two Input Variable values.
    can any one correct my code Code is written below based on quarter and Fiscalyearvarient.
    I have to get calmonth Text value.
    I am getting the error as : "I_T_VAR_RANGE" is a table without a header line and therefore has no
    Component Called "0PERIV".
    DATA :  l_s_range TYPE rsr_s_rangesid,
            loc_var_range LIKE rrrangeexit.
    IF i_step = 2.
    CASE i_vnam.
       WHEN 'ZTXT_CML' .
          CLEAR: l_s_range.
          LOOP AT i_t_var_range INTO L_S_VNAM WHERE vnam = 'ZQUAR' AND vnam = '0periv'.
            IF i_t_Var_range-0PERIV = 'IE'.
              IF i_t_var_range-ZQUAR = '1'.
                l_s_range-low = 'APRIL'.
                l_s_range-sign = 'I'.
                l_s_range-opt = 'EQ'.
              ELSEIF i_t_var_range-ZQUAR = '2'.
                l_s_range-low = 'JULY'.
                l_s_range-sign = 'I'.
                l_s_range-opt = 'EQ'.
              ELSEIF i_t_var_range-ZQUAR = '3'.
                l_s_range-low = 'OCTOBER'.
                l_s_range-sign = 'I'.
                l_s_range-opt = 'EQ'.
              ELSEIF i_t_var_range-ZQUAR = '4'.
                l_s_range-low = 'JANUARY'.
                l_s_range-sign = 'I'.
                l_s_range-opt = 'EQ'.
              ENDIF.
            ELSEIF i_t_var_range-0PERIV = 'K4'.
              IF i_t_var_range-ZQUAR = '1'.
                l_s_range-low = 'JANUARY'.
                l_s_range-sign = 'I'.
                l_s_range-opt = 'EQ'.
              ELSEIF i_t_var_range-ZQUAR = '2'.
                l_s_range-low = 'APRIL'.
                l_s_range-sign = 'I'.
                l_s_range-opt = 'EQ'.
              ELSEIF i_t_var_range-ZQUAR = '3'.
                l_s_range-low = 'JULY'.
                l_s_range-sign = 'I'.
                l_s_range-opt = 'EQ'.
              ELSEIF i_t_var_range-ZQUAR = '4'.
                l_s_range-low = 'OCTOBER'.
                l_s_range-sign = 'I'.
                l_s_range-opt = 'EQ'.
              ENDIF.
            ENDIF.
              APPEND l_s_range TO e_t_range.
          ENDLOOP.
      ENDCASE.
    ENDIF.

    Hi Supraja,
    You would have to declare I_T_VAR_RANGE internal table as the table with an header line.
    This you will find in data declaration segment.
    ie
    DATA : I_T_VAR_RANGE type <table name> WITH HEADER LINE.
    or
    Create a work area like l_s_var_range.
    Use work area while performing operations in your code and later append the record to the table i_t_var_range.
    DATA : L_S_VAR_RANGE type i_t_var_range.
    Also, i_step = 3 is the right one, because you are processing the customer exit based on the values of the user input of two variables.
    Modified code below.
    DATA : l_s_range TYPE rsr_s_rangesid.
    DATA : L_S_VAR_RANGE type i_t_var_range,
    loc_var_range LIKE rrrangeexit.
    IF i_step = 3.
    CASE i_vnam.
    WHEN 'ZTXT_CML' .
    CLEAR: l_s_range.
    LOOP AT i_t_var_range INTO l_s_var_range WHERE vnam = 'ZQUAR' AND vnam = '0periv'.
    IF l svar_range -0PERIV = 'IE'.
    IF l_s_var_range -ZQUAR = '1'.
    l_s_range-low = 'APRIL'.
    l_s_range-sign = 'I'.
    l_s_range-opt = 'EQ'.
    ELSEIF l_s_var_range -ZQUAR = '2'.
    l_s_range-low = 'JULY'.
    l_s_range-sign = 'I'.
    l_s_range-opt = 'EQ'.
    ELSEIF l_s_var_range -ZQUAR = '3'.
    l_s_range-low = 'OCTOBER'.
    l_s_range-sign = 'I'.
    l_s_range-opt = 'EQ'.
    ELSEIFl_s_var_range -ZQUAR = '4'.
    l_s_range-low = 'JANUARY'.
    l_s_range-sign = 'I'.
    l_s_range-opt = 'EQ'.
    ENDIF.
    ELSEIFl_s_var_range -0PERIV = 'K4'.
    IF i_t_var_range-ZQUAR = '1'.
    l_s_range-low = 'JANUARY'.
    l_s_range-sign = 'I'.
    l_s_range-opt = 'EQ'.
    ELSEIF l_s_var_range -ZQUAR = '2'.
    l_s_range-low = 'APRIL'.
    l_s_range-sign = 'I'.
    l_s_range-opt = 'EQ'.
    ELSEIF l_s_var_range -ZQUAR = '3'.
    l_s_range-low = 'JULY'.
    l_s_range-sign = 'I'.
    l_s_range-opt = 'EQ'.
    ELSEIF l_s_var_range -ZQUAR = '4'.
    l_s_range-low = 'OCTOBER'.
    l_s_range-sign = 'I'.
    l_s_range-opt = 'EQ'.
    ENDIF.
    ENDIF.
    APPEND l_s_range TO e_t_range.
    ENDLOOP.
    ENDCASE.
    ENDIF.
    Hope it helps,
    Best regards,
    Sunmit.

  • Need help with Customer Exit

    HI Guys,
          I am trying to create a Customer Exit in Bex on employee number (zempno) and the technical name of my Customer Exit is Zempnum.
    What i am trying do is, who ever logs in and executes the query, he should get his relavant data, meaning if the employee login he should get his own data, or if the supervisor logs in he should get all the employess under him.
    When i am trying to execute the query i am getting the below error.
    Error: Error for variable in customer enhancement ZEMPNUM
    Diagnosis:
    This internal error is a deliberate termination, since a program status has arisen, that is not allowed to occur.
    The error has arisen for variable ZEMPNUM in the customer enhancement .
    Procedure:
    Please check your customer enhancement.
    Procedure for System Administration
    Notification Number BRAIN 649
    Below is my code
    *& Include ZXRSRU01
    data : itab like /BIC/AZHRPE00100 occurs 0 with header line .
    data : zuid like /BIC/AZHRPE00100-/bic/zempno.
    data region type /BIC/OIZCDOTREG1.
    break-point.
    case I_VNAM.
    WHEN 'ZEMPNUM'.
    DATA: L_S_RANGE TYPE RSR_S_RANGESID.
    DATA: LOC_VAR_RANGE LIKE RRRANGEEXIT.
    IF I_STEP = 2. "before the popup
    DATA username(20) type c.
    username = sy-uname.
    break-point.
    select single /bic/zempno from /BIC/AZHRPE00100 INTO zuid where /bic/zuserid = username.
    if sy-subrc = 0 .
    select * from /bic/azhrpe00100 into table itab where /bic/zempno = zuid.
    endif.
    CLEAR L_S_RANGE.
    L_S_RANGE-LOW = ZUID."low value, e.g.200001
    L_S_RANGE-SIGN = 'I'.
    L_S_RANGE-OPT = 'eq'.
    APPEND L_S_RANGE TO E_T_RANGE.
    EXIT.
    ENDIF.
    ENDCASE.

    HI,
      This is the update code, but still i am getting the same error.
    *& Include ZXRSRU01
    DATA: L_S_RANGE TYPE RSR_S_RANGESID,
    LOC_VAR_RANGE LIKE RRRANGEEXIT. " This is Global
    data : itab like /BIC/AZHRPE00100 occurs 0 with header line.
    data : temp_zempno like /BIC/AZHRPE00100-/bic/zempno.
    *region type /BIC/OIZCDOTREG1,
    data : itab_empno like standard table of temp_zempno.
    *itab_empno like /BIC/AZHRPE00100-/bic/zempno.
    *break-point.
    case I_VNAM.
    WHEN 'ZEMPNUM'.
    IF I_STEP = 1. "After the popup
    *break-point.
    select single /bic/zempno from /BIC/AZHRPE00100 INTO temp_zempno
    where /bic/zuserid = sy-uname.
    Check if he is the supervisor for any other employees
    add them to the internal table
    Check the syntax below.
    if sy-subrc = 0 .
    if sy-subrc = 0 .
    select /bic/zempno from /bic/azhrpe00100 into table itab_empno where /bic/zspnm = temp_zempno.
    *select /bic/zempno from /bic/azhrpe00100 into table itab_empno where /bic/zspno = temp_zempno.
    endif.
    endif.
    *Add Own Employee number to the internal table
    *Check the syntax below
    Append temp_zempno to itab_empno.
    *By now, all the employee numbers are added
    to the internal tabe
    *now loop at itab_empno and return all the values.
    CLEAR L_S_RANGE.
    loop at itab_empno into temp_zempno.
    L_S_RANGE-LOW = temp_zempno.
    L_S_RANGE-SIGN = 'I'.
    L_S_RANGE-OPT = 'EQ'.
    APPEND L_S_RANGE TO E_T_RANGE.
    EXIT.
    ENDLOOP.
    ENDIF.
    ENDCASE.
    Thanks,
    kris

  • Help with Customer Exit in ECC box

    I have created the project successfully, thanks to Mr. V. but now when I go into CMOD and double click on 'INCLUDE ZXRSAU01'. I get the message that says Would you like to create an object? I am trying to put something there that can point CMOD to programs that I will write for each datasource in SE38 individually.  How can I accomplish that task? thanks.

    Try using this code:
    data:l_found,
         l_prog_name type sy-repid.
    CONCATENATE 'ZBWM_' i_datasource INTO l_prog_name.
      PERFORM execute_user_exit IN PROGRAM (l_prog_name)
        TABLES I_T_SELECT
               I_T_FIELDS
               C_T_DATA
               C_T_MESSAGES
        using  i_updmode
        changing
               l_found
               IF FOUND.
    if l_found = 'X'.
      exit.
    endif.
    Regards,
    Arminder

  • Variable with customer exit

    Hello,
    I have created a query with customer exit variable.this variable calculates cumulative month from the beginning of the year. this variable depends on another regular variable 0PCALMON (single value, mandatory). i also use this variable in the query to show the month itself.
    <b>the problem is as follow:</b>
    until yesterday the 0PCALMON variable pop up normally, but now the variable doesn't pop up  at all!
    Does anyone have an idea?
    Thanks,
    Maya

    Hi,
    The variable may be personalized with some value.
    <b>To remove the personalization for a user:</b>
    Step 1: RSA1 -> Search for ODS 0PERS_VAR
    Step 2: Manage -> Contents ->selective deletion
    Step 3: Put the user to remove the personalization
    http://help.sap.com/saphelp_nw04/helpdata/en/01/42c73c13b0ce5be10000000a114084/content.htm
    Regards
    Happy Tony

Maybe you are looking for

  • New to the Ipod World and Needing Help

    Im use to using the diffrent mp3 player's. I was hoping to know if its possible to sync music from Windows Media Player to the Ipod Nano 5th Generation. I tried and my Ipod says no music but its taking up space.

  • RFC Error message when logging on to SMD

    Hello Experts, While installing SMD, the LMSERVICE and SAPISEM80.SAR, SAPISMM80.SAR have already been installed through SDM. 1- When I type http://hostname:8004/SMD and login with my username j2ee_admin and password, I get a blanck screen with follow

  • Example config fax used 1750

    hi  to  everyone config how to fax in 1750 with the use voip only, and its topology only connect cisco 1750 point to point and a fax machine and how to do so in 1750 if it can send fax and receive faxes

  • Is it possible to "redshift" only certain windows?

    I was curious if it is possible to, for example, only apply a redshift to Chromium windows, leaving panels and terminals undisturbed as they will already be darkly and precisely colored. Is this functionality already available through some means, or

  • Initialising objects when server starts up

    Hi, Is there some area where we can put code so that it gets executed when the server starts up? In our case, we wish to load some settings from a database and then save them to the application bean. Thanks, Tristan