I need example for VARIABLES with Customer Exit.

hi every body i need example for Variable for Customer Exit.

Hi,
You can define 'Formula' variables in your customer exit..for example..
you need to calculate no of machine running hours per month, in order to
caculate the machine total utilization time..in this context.. you need to know
how may hours are there in an month by month..
you can define a variable and write the code in the customer exit for deriving the total no. of hours available for that month and get that value into a variable for further calution like deducting the down time and set up time so on..in your
calculated KF..
Hope this helps..
Assign points if useful..
Cheers,
Pattan.

Similar Messages

  • Variables with customer exit

    Please search the forums before posting
    i want an example for variables using customer exit with steps
    Edited by: Arun Varadarajan on Mar 15, 2009 7:25 PM

    Hi,
    You can define 'Formula' variables in your customer exit..for example..
    you need to calculate no of machine running hours per month, in order to
    caculate the machine total utilization time..in this context.. you need to know
    how may hours are there in an month by month..
    you can define a variable and write the code in the customer exit for deriving the total no. of hours available for that month and get that value into a variable for further calution like deducting the down time and set up time so on..in your
    calculated KF..
    Hope this helps..
    Assign points if useful..
    Cheers,
    Pattan.

  • Formula Variable with customer exit

    Hi,
    can we use Formula variables with customer exit based  on characteristics(ex Bill date)? if yes, can you guys help me on this.
    Thanks
    kri

    Yes , you can use a formula variable with customer exit based on characteristics .
    Depends on the requirement what you want to show in the formula variable ,
    Eg : if you want to show the max fiscal year period , in that case :
    create a new formula in the keyfigure section of your query , go to edit , you can see formula variable below the keyfigures ,
    right click on the same and create new formula variable :
    Write the code for the formula varible in the backend as we do for normal customer exit varaible :
    for this e.g the code will be :
    FORM get_variable_value
          tables E_T_RANGE      type RSR_T_RANGESID
          using I_VNAM          type RSZGLOBV-VNAM
                I_VARTYP        type RSZGLOBV-VARTYP
                I_IOBJNM        type RSZGLOBV-IOBJNM
                I_S_COB_PRO     type RSD_S_COB_PRO
                I_S_RKB1D       type RSR_S_RKB1D
                I_PERIV         type RRO01_S_RKB1F-PERIV
                I_T_VAR_RANGE   type RRS0_T_VAR_RANGE
                I_STEP          type I.
      DATA L_S_RANGE LIKE LINE OF E_T_RANGE.
      DATA loc_var_range LIKE rrrangeexit.
    Data  : l_inPer TYPE string.
    IF i_step = 1.
    Select min( distinct FISCPER )
            from /BIC/A(DSO name)
            into l_minper  .
        l_s_range-sign = 'I'.
        l_s_range-opt = 'EQ'.
        l_s_range-low = l_minper  .
        APPEND l_s_range TO e_t_range.
    endif.
    drag the formula variable in the new formula created and exexcute the query , you will be able to see the output .
    This is just an example , your code will differ as per your requirement .

  • Prob in text variable with customer exit

    Hi to all
    I am working in PA module in HR ,In my Report i have to count total number of trainee and lateral in given Date range that From date to To Date , Before that i have to calculate a Total Employee Strength before one day of From date , suppose user enter a 1st of April 2007 to 1st of jun 2007 , so Employee strength should be calculated on the 31march 2007, for that i have written custome exit , now i am getting a value also , for Display that date have a created a text variable with customer exit , but i am not able to get that date , it should be display strength as on 31march2007 , instead of it is displaying Strength as on 00.00.0000.I am giving a cod also
    ls_range-sign ='I'.
    ls_range-opt = 'EQ'.
    ls_range-low = 'EB1A'.
    append LS_Range to e_t_range.
    WHEN 'ZPA_DATE'.
    if i_step = 3.
    READ TABLE I_T_VAR_RANGE INTO L_S_VAR_RANGE WITH KEY VNAM = 'ZPA_DATE'.
    IF SY-SUBRC = 0.
    ZTEST = L_S_VAR_RANGE-LOW.
    ztest1 = ZTEST - 1.
    export p = ztest1 to MEMORY ID 'VALUE'.
    ENDIF.
    endif.
    WHEN 'ZFRMDAT'.
    if i_step = 3.
    ls_range-sign ='I'.
    ls_range-opt = 'EQ'.
    ls_range-low = ztest.
    append LS_Range to e_t_range.
    endif.
    when 'ZPA_CDAT'.
    if i_step = 3.
    ztest1 = ztest - 1.
    ls_range-sign ='I'.
    ls_range-opt = 'EQ'.
    ls_range-low = ztest1.
    append LS_Range to e_t_range.
    endif.
    when 'ZPA_VAR3'.
    if i_step = 3.
    ztest1 = ztest - 1.
    import p = ztest1 from memory id 'VALUE'.
    concatenate ztest16(2) ztest14(2) ztest1+0(4) into date separated by '.'.
    move date to temp.
    move 'Hello' to temp.
    ls_range-sign ='I'.
    ls_range-opt = 'EQ'.
    ls_range-low = temp.
    append LS_Range to e_t_range.
    endif.
    Please help me to come out
    Thanks

    Hi Stefania,
    to me it looks like your local variable num_mese is not defined with the correct data type.
    Try to change
    if num_mese = 09 to if num_mese = <b>'</b>09<b>'</b>,
    same for 10 -> '10', 11 -> '11'.
    If that does not help please let me know your coding where you define the type of num_mese (DATA statement).
    Regards
    Stephan

  • Characterstic variable with customer exit

    Can u some bady help me.
    How to express about Characterstic variable with customer exit
    Edited by: chenna reddy on Aug 7, 2008 9:48 PM

    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

  • Formula Variable with customer Exit (ABAP Code)

    Hi Experts,
    Please advise me wether i am going in the right way to achieve my requirment else please advise me any alternate approach and update me with the abap code for my customer exit as i am not familiar with ABAP.
    My Requirment:
    Data :
    Emp_ID----Start_Date(DATS)---End_Date(DATS)
    I had a user entry (intreval) VARIABLE created on Start_Date
    User will enter the date intreval he want to analyze...
    Ex: 01.01.2008 to 01.02.2008
    Now i want to use the No of Days between user entered date intreval in my calculaction of a keyfigure
    In the above example it is 31 days
    So i created a Formula Variable of Customer Exit now i need a code that will
    pass the user entered dates to
    FM: FIMA_DAYS_AND_MONTHS_AND_YEARSImport parameters Value
    I_DATE_FROM 01.01.2008
    I_DATE_TO 01.02.2008
    I_FLG_SEPARATE ' '
    Export parameters Value
    E_DAYS 31
    E_MONTHS 1
    E_YEARS 1
    and need to pass the E_DAYS (31) to the result of formula
    User Entry Variable (Intreval) : ZST_VAR
    Formula Variable (Customer Exit) : ZND_EXIT
    Code
    WHEN 'ZND_EXIT'.
        DATA: low_date2 TYPE d,
        high_date2 TYPE d,
        num_days TYPE N,
        new_low_date2 TYPE d.
        IF i_step = 2.
          LOOP AT i_t_var_range INTO ls_varrange WHERE vnam = 'ZST_VAR'.
            CLEAR l_s_range.
            l_s_range-sign = 'I'.
            l_s_range-opt = 'EQ'.
            ls_varrange-low = low_date2.
            ls_varrange-high = high_date2.
    CALL FUNCTION 'FIMA_DAYS_AND_MONTHS_AND_YEARS'
      EXPORTING
        I_DATE_FROM          = low_date2
        I_DATE_TO            = high_date2
        I_FLG_SEPARATE       = ' '
      IMPORTING
        E_DAYS               = NUM_DAYS
      l_s_range = NUM_DAYS.
      APPEND l_s_range TO e_t_range.
      EXIT.
      ENDLOOP.
      endif.

    Hello,
    Before the WHEN statement it shoud have a CASE statement. In the user exit coding place your WHEN statement anywhere between CASE...ENDCASE statement.
    your code should look like
    DATA: low_date2 TYPE d,
    high_date2 TYPE d,
    num_days TYPE N,
    new_low_date2 TYPE d.
    Case i_vnam.
    WHEN 'ZND_EXIT'.
    IF i_step = 2.
    LOOP AT i_t_var_range INTO ls_varrange WHERE vnam = 'ZST_VAR'.
    CLEAR l_s_range.
    l_s_range-sign = 'I'.
    l_s_range-opt = 'BT'.
    low_date2 = ls_varrange-low.
    high_date2 = ls_varrange-high.
    CALL FUNCTION 'FIMA_DAYS_AND_MONTHS_AND_YEARS'
    EXPORTING
    I_DATE_FROM = low_date2
    I_DATE_TO = high_date2
    I_FLG_SEPARATE = ' '
    IMPORTING
    E_DAYS = NUM_DAYS
    l_s_range-low = NUM_DAYS.
    APPEND l_s_range TO e_t_range.
    EXIT.
    ENDLOOP.
    endcase.
    Thanks
    Chandran

  • Text Variable With Customer Exit Logic/ABAP Code

    Hi Experts,
    Could you please help me with the Logic/Code that i need to use in Calculacting The TEXT Variable Using CUSTOMER EXIT
    I had a rolling report in which there are 14 Calculacted Keyfigures  (Not Restricted KF),Which are
    M-1,M-2,M-3,M-4,M-5........M-14
    In MAY2009
    M-1 represents (Current Month -1)  APR2009
    M-2 represents (Current Month -2)  MAR2009
    M-3 represents (Current Month -3)  FEB2009
    M-4 represents (Current Month -4)  JAN2009
    M-5 represents (Current Month -5)  DEC2008
    M-6 represents (Current Month -6)  NOV2008
    M-7 represents (Current Month -7)  OCT2008
    M-13 represents (Current Month -13)  APR2008
    M-14 represents (Current Month -14)  MAR2008
    In JUNE2009
    M-1 represents (Current Month -1)  MAY2009
    M-2 represents (Current Month -2)  APR2009
    M-3 represents (Current Month -3)  MAR2009
    M-4 represents (Current Month -4)  FEB2009
    M-5 represents (Current Month -5)  JAN2009
    M-6 represents (Current Month -6)  DEC2008
    M-7 represents (Current Month -7)  NOV2008
    M-13 represents (Current Month -13)  MAY2008
    M-14 represents (Current Month -14)  APR2008
    Currently the Description of CKF is named as M-1,M-2..M-14.My requirment is to develop Text Variables that displays the description as MMMYYYY

    Sample code, NO syntax check...!!
    CASE i_vnam.  " Variablenname
      WHEN 'M-1'. "For Variable <M-1>
       Data: l_peri type E_BUPER, "Declare variable for Period
                l_year type E_GJAHR "Declare variable for year
        IF i_step = 2.
          DATA l_s_range LIKE LINE OF e_t_range.
          CLEAR l_s_range.
          CALL FUNCTION 'DATE_TO_PERIOD_CONVERT' " By providing Date this FM gives period and year
           EXPORTING
             I_DATE           = SY-DATUM "System Date
             I_PERIV         = V3 "Fiscal Variant
          IMPORTING
             E_BUPER       = l_peri "for period is date is today period = 005
             E_GJAHR       = l_year. "for Year = 2009
          l_peri = l_peri - 1. "To reduce 1 from period (005 - 1 = 004)
          IF l_peri = '004'       "Check value of period.
          Concatenate 'APR' l_year into l_s_range-low. "concatenate 'APR' & Year into Low.
          l_s_range-sign   = 'I'.
          l_s_range-opt    = 'EQ'.
                APPEND l_s_range TO e_t_range.
        ENDIF.
    For M-2 subtract 2 and repeate same.

  • Text Variable With Customer Exit ABAP Code

    Hi Experts,
    Could you please help me with the Logic/Code that i need to use in Calculacting The TEXT Variable Using CUSTOMER EXIT
    I had a rolling report in which there are 14 Calculacted Keyfigures (Not Restricted KF),Which are
    M-1,M-2,M-3,M-4,M-5........M-14
    My requirment is to get the MMM.YYYY based on Sy Date as a title of the column
    In MAY2009
    M-1 represents (Current Month -1) APR2009
    M-2 represents (Current Month -2) MAR2009
    M-3 represents (Current Month -3) FEB2009
    M-4 represents (Current Month -4) JAN2009
    M-5 represents (Current Month -5) DEC2008
    M-6 represents (Current Month -6) NOV2008
    M-7 represents (Current Month -7) OCT2008
    M-13 represents (Current Month -13) APR2008
    M-14 represents (Current Month -14) MAR2008
    In JUNE2009
    M-1 represents (Current Month -1) MAY2009
    M-2 represents (Current Month -2) APR2009
    M-3 represents (Current Month -3) MAR2009
    M-4 represents (Current Month -4) FEB2009
    M-5 represents (Current Month -5) JAN2009
    M-6 represents (Current Month -6) DEC2008
    M-7 represents (Current Month -7) NOV2008
    M-13 represents (Current Month -13) MAY2008
    M-14 represents (Current Month -14) APR2008
    Currently the Description of CKF is named as M-1,M-2..M-14.My requirment is to develop Text Variables that displays the description as MMMYYYY

    Amrit I think u72720 wanted to know how to get MMYYYY in the column headings.
    this can be achieved using text variable easily.
    steps
    1. Right click and go to properties and click the button next to description box.
    2. Add any existing text var from the list
    3. now right click on this var in the desription box and select 'new variable'
    4. give var name description
       processing type ->replacement path
       replace with char-> fiscal period (or calmonth if that is what restricted in your column)
       select value as 'Key'
    finish creation and use this var in all the selection column headings (remove M-1, M-2 etc)
    you will get mmyyyy decriptions for every column depending on month of that column

  • 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

  • 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

  • Passed i_step = 2,3(Hierarchy Node Variable with Customer-Exit)

    Hellow !
    I want to insert the following ststement to force the variable to be executed with i_step = 2 or 3.
    CASE I_VNAM.
    when 'ZTEST'.
        CLEAR loc_var_range. REFRESH loc_var_range.
        CLEAR: l_s_range, ytest001.
    LOOP AT i_t_var_range INTO loc_var_range.
       SELECT * FROM ytest001
                  WHERE bname = sy-uname
                        AND node   = loc_var_range-low.
            IF sy-subrc = 0.
              l_s_range-low = loc_var_range-low.
              l_s_range-high = '0HIER_NODE'.
              l_s_range-sign = 'I'.
              l_s_range-opt  = 'EQ'.
              APPEND l_s_range TO e_t_range.
             else.
              l_s_range-low = '#'.
              l_s_range-sign = 'I'.
              l_s_range-opt  = 'EQ'.
              APPEND l_s_range TO e_t_range.
             endif.
    ENDLOOP.
    However, Passed customer-exit(Enhancements for Global Variables in Reporting)  i_step =2,3
    Regards,
    Don

    Hi,
    in addition to Anil's valid input, make sure that ZTEST is NOT ready for input. Indeed "ready for input" vars cannot be changed via customer exits.
    hope this helps...
    Olivier.

  • Validation of users entries for variables in customer exit

    Hi,
    I like to validate the user's entries a queries variables popup and open the variables popup once more if there are unwanted entries. I think I have to raise an exception in the customer exit for reporting, but corresponding function exit does not provide an exception. Can someone provide me a solution? Is there a solution without modifying the function module? (EXIT_SAPLRRS0_001)
    Kind regards,
    Simon

    Hello,
    you can take help of foll code structure to call an exception in the screen.
    IF i_step = 3.
    LOOP at i_t_var_range INTO l_s_var where vnam = 'needed_variable_name'.
    if needed_variable_name-low NE 'ABC'.
    CALL FUNCTION 'RRMS_MESSAGE_HANDLING'
    EXPORTING
    I_CLASS = 'RSBBS'
    I_TYPE = 'E'
    I_NUMBER = '000'
    I_MSGV1 = 'Please enter Correct values'.
    raise again.
    ENDIF.
    ENDLOOP.
    Hope this helps.
    Also in case of any mulitple condtions you can play around the code.
    Regards,
    Shashank

  • Hierchies and hierchies node with customer exit?

    hi friends,
    what scenerio we use hierchies and hierchies node  variable with customer exit ?
    Thanking u
    suneel.

    Hierarchy variables represent hierarchies. You can use them wherever
    hierarchies can be selected.
    Hierarchy node variables represent a node in a hierarchy. You can use them as
    an alternative to hierarchy nodes as fixed values for restricting a characteristic.
    If you use a hierarchy node variable, you can make selections by hierarchy
    node when you use the query.
    The Customer Exit processing type for variables enables you to determine
    values for variables by means of a function module exit. The function
    module used is EXIT_SAPLRRS0_001.
    You create a project in transaction CMOD by selecting the SAP
    enhancement RSR00001 and assigning this to the enhancement project.
    Activate the project.
    WHEN 'HIERARCHY'.   " Hierarchy variable
             CLEAR L_S_RANGE.
             L_S_RANGE-LOW  = 'MY HIERARCHY'. " hierarchy name
             L_S_RANGE-SIGN = 'I'.
             L_S_RANGE-OPT  = 'EQ'.
             APPEND L_S_RANGE TO E_T_RANGE.
    -> Only dependents of hierarchy 'MY HIERARCHY'
          WHEN 'HNODE'.   " Hierarchy node variable
             CLEAR L_S_RANGE.
             L_S_RANGE-LOW  = 'DEPT1'.  " Node name
             L_S_RANGE-HIGH = '0HIER_NODE'.   " InfoObject
             L_S_RANGE-SIGN = 'I'.
             L_S_RANGE-OPT  = 'EQ'.
             APPEND L_S_RANGE TO E_T_RANGE.
    -> Node 'DEPT1', that cannot be posted to
          WHEN 'HNODEVAL'.   " Hierarchy node variable
             CLEAR L_S_RANGE.
             L_S_RANGE-LOW  = 'LEAVE1'.  " node name (node is a leaf)
             L_S_RANGE-SIGN = 'I'.
             L_S_RANGE-OPT  = 'EQ'.
             APPEND L_S_RANGE TO E_T_RANGE.
    -> Node 'LEAVE1' (leaf)
    Regards
    Naga

  • 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

  • Formel Variable - how to fill with Customer Exit from control table

    Hello Experts,
    I have create in BEx-Analyser a formel Variable ZEXRATE1 filled through Customer Exit. In BW I had a "control tabel" with keyfigures.
    In the query definition I have include 0FISCPER, 0FISCVARNT and 0VTYPE. This
    are the keys which should give the values for the selectstatement to select my keyfigure from the "control table" to fill ZEXRATE1.
    If it possible to do with Customer Exit (CMOD -> RSR00001 -> ZXRSRU01) or do I have to implement a Bapi. Perhaps someone can give me a code example.
    Regards Dieter

    Hi,
    Code may look like this
    WHEN 'ZEXRATE1'.
    check i_step = 2.
        LOOP AT I_T_VAR_RANGE INTO L_S_RANGE.
          CASE L_S_RANGE-IOBJNM.
            WHEN 'ZFISCPER'. GV_ZFISCPER = L_S_RANGE-LOW.
            WHEN 'ZFISCVARNT'. GV_ZFISCVARNT =  L_S_RANGE-LOW.
            WHEN 'ZVTYPE'. GV_ZVTYPE =  L_S_RANGE-LOW.
          ENDCASE.
        ENDLOOP.
        SELECT SINGLE RATE into INTO GV_RATE
                  FROM ZTABLE
                  WHERE 0FISCPER = GV_ZFISCPER
                  AND   0FISCVARNT = GV_ZFISCVARNT
                 AND 0VTYPE = GV_ZVTYPE   .
    Assumptions : ZTABLE name of control table
                          ZFISCPER name of variable represents fiscal period
                          'ZFISCVARNT' name of variable representing fiscal year variant 
                          'ZVTYPE'. name of variable representing value type
    Hope that helps.
    Regards
    Mr Kapadia
    Assigning points is the way to say thanks in SDN.

Maybe you are looking for

  • An unknown error occurred (1418).

    So my iPod has been a little neglected over the past few months since I've been out of a job. I don't need to take it to work anymore to listen to my music. Very recently I went through an entire reformat and reinstall of my OS and other programs, so

  • I am moving my US iMac and macbook pro to Ireland.  Where can I get the right power cords

    I am moving to Ireland.  I have several mac products.  I have 2 iMac, and 3 laptops, plus all the other "fun" apple stuff.  Apple TV, iPad, iPods, phones) I need to get a power supply for both the iMacs and MacBooks.  Any suggestions, I can't seem to

  • Display Column Chart Y Axis Labels in Kilo(K), Million(M)...

    Hi Folks, I would like to display the Y-axis labels of a column chart in Kilo, Millions etc. I used the below mentioned formula in excel for that set of data. Here is the formula [>=1000000]0,,"M";[>=1000]0,"K";0 Though in embedded excel it displays

  • Error activating logical port for service group

    Hi, I reconfigured the Starter Services because I changed the backend. It all worked fine, but in SOAMANAGER it throws an error when trying to activate logical ports for service group /IWCNT/BPC_SERVICE_GROUP (error is thrown for all 4 service groups

  • Problem adobe air with intel tablet

    i have a problem when i download adobe air on intel tablet (model TM105A)  the file is corrupted