Formula variable with User Exit

Hi,
Can we create a Formula Variable of processing type USER EXIT...which will display a constant Value Y
Any syntax would be helpful
Thanks

Hi,
check this for formula variables with user exits;
http://wiki.sdn.sap.com/wiki/display/profile/Surendra+Reddy
http://sap.ittoolbox.com/groups/technical-functional/sap-bw/customer-exit-to-derive-formula-variable-to-text-variable-sap-bw-35-3030684
Also Check the issues and solution :
Formula Variable with User Exit....Problem
Thanks
Hemav

Similar Messages

  • Formula Variable with User Exit....Problem

    Hi
      My requirment is to create a Formula Variable on User Exit that will give me Current Cal Year...so that i can use that vale in Formulas
    Created Formula Variable with processing Type Customer Exit single Value,Mandator and Unchecked the Variable input ready
    The below code in CMOD
    WHEN 'XXXXXXX'.
    Year  = sy-datum(4).
    CLEAR L_S_RANGE.
    L_S_RANGE-LOW = Year.
    L_S_RANGE-SIGN = 'I'.
    L_S_RANGE-OPT = 'EQ'.
    APPEND l_s_range TO e_t_range.
    But when i execute the query i am getting the below error
    No value could be determined for variable xxxxxxx.
    Incorrect call of OLAP layer CL_RSR_OLAP; error in BW-BEX-ET
    Diagnosis
    This error diagnosis is specific only to the variables 0P_FVAEX or 0P_CTPCA !
    Termination message BRAIN 632 appears:
    Could not determine value for variable 0P_FVAEX (or 0P_CTPCA).
    WHAT WRONG I AM DOING...please update me

    Use the code:
    WHEN 'XXXXXXX'.
         IF i_step = 2.
              Year = sy-datum(4).
              CLEAR L_S_RANGE.
              L_S_RANGE-HIGH = Year.
              L_S_RANGE-SIGN = 'I'.
              L_S_RANGE-OPT = 'EQ'.
              APPEND l_s_range TO e_t_range.
         ENDIF.
    Let me know, if it is work or not!
      - Balajee Kannan

  • 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 .

  • Formula Variable with User Entry

    Hi,
    I'm  confused with Formula Variable with Replacement Path and Formula Variable with User Entry.
    PLz, Explain with an example .....In which senarios  Formula Variable with Replacement Path is used and In which senarios Formula Variable with User Entry is used.

    Hi,
    Suppose you have some key figure sales.
    Now in the report you want to display 10% of sales or may be 20% of sales based on the user input.
    In this case you will define formula variable with user input. Because here percentage will be varying based on user input.
    And suppose you have a key figure price which is attribute of material and you want to use that price for calculation in the report. In this case you will define formula varible with replacement path.
    Let me know if you need more information.
    Regards,
    Mansi

  • 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

  • OLAP Variable with user exit for Infopackage Selection 0fiscper

    Hi Frds/ Guru's ,
                    I have a requirement to use a OLAP Variable for Fiscal year period 0fiscper(Characteristic ) in the Infopackage Selection. . I need to extract the data for Previous Year and Current Year , that is to be automatically selected with a OLAP Variable . The standard one's provided by SAP are not satisfying my requirement,as they are getting populated with SAP Exit and I am not getting the ranges .I am planning to create a variable and use the processing type as Customer Exit and Populate it with ABAP code in respective Enhancement RSR00001.
    Even Can I create a ABAP Routine ? Please suggest me which is better to do in respect to performance of dataload  , will be really glad if anyone can provide some code for doing this as u might have faced the situation sometime .
    I have checked with all the threads available , could get some idea but will be really thankful if u gimme some hints in writing the code , at Exit level and routine level .
    Thanks,
    Krish

    thnx

  • Current Year Formula Variable with SAP-Exit

    Hi Experts ,
    Is there any SAP Exit Formula Variable avaliable that we can use in BEX which gives us the Current Calander Year?
    I am able to find the current fiscal period ie "0F_CUFPE" which provides the current posting period/month.
    On similar basis, I need a FV which provides me the Current Calender Year.
    Please note that I do not need Characteristic Variables for Fiscal Year .
    Regards
    Dipali

    Hi,
    If you're refering to the InfoObject 0CALYEAR, there is an exit variable available called: 0CYEAR - Current Calendar year
    Which will filter on the current year.
    br
    Mikael

  • Numeric  Variable with USER-EXITS

    Hi all,
          I've created a Variable which type is numeric values in BPS0 and it's value is from a USER-EXITS,ex. Z_FUC_A, in my Z_FUC_A there's a export PARA which name is CNT and it's type is UPC_Y_VAR_NUMBER,in Z_FUC_A,I'm sure CNT has got it's value,asume CNT =100.but in BPS0,the Numeric  Variable can't got this value,it's always 0.000000,I don't know why.
          anyone can help me,thanks alot.

    I solve this by myself,thx everybody

  • User input formula variable with greater than/less than operators for KFG

    Hello all,
    I have used a formula in my query that is a difference of two key figures .For e.g:
    Difference = tax from system A  -  tax from system B.
    Now when the users run the report they should be prompted for the 'Difference' threshold for seeing the report say where difference is greater 100 or equal to 10 and so on.Currrently I have created a formula variable with 'user input' and created a 'condition' to display 'Difference' greater than the user entered value.
    However,it is required to have various selection options for setting the threshold of difference.For e.g User should be able to set say 'equal to'/'greater than/less than/not equal to operator for 'difference' in the initial selection screen of the report.
    With the current user-input formula variable I am not getting these 'greater than' etc operators.Any ideas on how to achieve this?

    Ya know, that's all well and good ... BUT ... WHAT IF you do want to sort text type columns with Greater Than and Less Than operatiors??
    SQL does it just Fine ... so WHY does APEX have the limit??? This is an Oracle BUG ... it SHOULD NOT limit the operators ... I realize "they" may be trying to be helpful with proper constraints to field searches ... but ... if SQL can do it, then ... no need for a limit.
    EG ...
    Show the records where
    the "Begin_Year-Wk" data is less than or equal to "2009-09" AND
    the "End_Year-Wk" data is greater than or equal to "2009-04"
    ... to give everything that was running in that 5 week period whether or not it starts within that time frame
    I can run this query perfectly fine via SQL ... but not in APEX ... unless I reconvert a lot of strings back to numbers, and for sorting / formatting / explain-to-user purposes, I really don't want them to be numbers.
    So ... there's gotta be a hidden tweak for operators somewhere ...

  • How to use formula variable in customer exit

    Hi all,
            I just want to use formula varible in customer exit
    For eg,
             I have created formula variable with user manual lnput eg: ZFM_V01 = 30
    Another char variable  with user manual input eg: 0keydate = 28/02/2011
    Required output,
    I just want to read my ZFM_V01 value in customer exit
    Result = 0KEYDATE - ZFM_V01
    EG:
    result = 28/02/2011 - 30
    Required result = 29/01/2011
    Kindly guide me how u get formula varibale value into customer exit(CMOD) and find the required result. please help me.
    Thanks & Regards,
    R. Saravanan

    Sorry, Bhanu,Ashwin need more info
    As my understand ::
    Function module RSW_CURRENCY_TRANSLATION uses the following parameters
    Import parameters
    I_CTTNM : Currency translation key (optional)
    I_AMOUNT: Amount in source currency  (not optional !!) (data type: floating point !!)
    I_SCUR : Source currency (optional) I_TCUR : Target currency (optional)
    I_TIME_IOBJVL : InfoObject for determination of the time reference (optional)
    I_SCUR_IOBJVL : InfoObject for determination of the the source currency (p.eg. 0COMP_CODE) (optional)I_TCUR_IOBJVL : InfoObject for determination of the the target currency (p.eg. 0COMP_CODE) (optional)
    I_PERIV : Fiscal year variant (optional)
    I_RATE : Exchange rate (optional)
    Export parameters
    E_AMOUNT : Amount in target currency (data type: floating point !!)
    E_RATE : Exchange rate
    E_SCUR : Source currency
    E_TCUR : Target currency
    I created a Currency key(ZXX) which takes CAD and converts to GBP on Planned Exchange rate (P) with time reference 0CALMONTH.
    In my case :
    Currency Key : ZXX (Confused here)
    Source Curr :CAD
    Target Curr :GBP
    I need a Variable ,which takes time reference and gives back the exchange rate .
    ,,I am I missing some thing ?
    Sudh

  • Formula variable with replacement path

    HI ,
    1. Is it possible to use "Customer exist- without user entry variable in the formula variable with the replacement ?
    2. if I use two variable for a same time char in one report (one is User entry variable and the other is customer exit variable for calculating current system date), then how it will work ? (User entry variable is there in the "Char restrictions" section and the customer exit variable is customer exit used in formula variable)
    Thanks in Advance.
    Thanks
    Rajesh

    1. Is it possible to use "Customer exist- without user entry variable in the formula variable with the replacement ?
    Yes. use I_step=1
    I_STEP = 1
    Call takes place directly before variable entry. Can be used to pre populate selection variables
    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.
    2. if I use two variable for a same time char in one report (one is User entry variable and the other is customer exit variable for calculating current system date), then how it will work ? (User entry variable is there in the "Char restrictions" section and the customer exit variable is customer exit used in formula variable)
    Yes you can use both the variable of time char to restrict a characteristic but that should not be used on single characteristic.
    You can use the sys defined  0date on one field and the customised one Zsydatum on other char.
    Regards
    KP

  • Date formula variable with replacement path.

    Hi ,
    I have date formula variable with replacement path.
    Variable pop up with date format yyyymmdd. but i want dd.mm.yyyy.
    I have checked my user profile setting and it is dd.mm.yyyy.
    Can u please suggest it .
    Thanks
    Pramod

    Thanks for the rely , but basically i need a variable only for selection.
    thats why i have created formula variable processing my cutomer exit.
    But i think customre exit variable comes with text format .
    any1 has an idea for the same.
    Thanks
    Babu

  • Formula variable in Customer exit

    Hi Experts,
    I need help.
    I create 
         first Formula variable (Z_OPTSEL) for a user entry, mandatory, ready for input, dimension ID = Number and
         second Formula variable (Z_OPT1), customer exit, mandatory, not ready for input, dimension ID = Number .
    User Exit code in ZXRSRU01 is :
    When 'Z_OPT1'.
    case i_step.
    when '2'.
    clear e_t_range.
    read table I_T_VAR_RANGE INTO loc_var_range with key vnam = 'Z_OPTSEL'.
    if sy-subrc = 0.
        if <b> loc_var_range-low = '1'.</b>       
                  l_s_range-low = '2'.
        endif.
        if loc_var_range-low = '2'.
             l_s_range-low = '0'.
        endif.
    endif.
    l_s_range-sign = 'I'.
    l_s_range-opt = 'EQ'.
    clear l_s_range-high.
    APPEND l_s_range TO e_t_range.
    endcase.
    Unfortunately, I get <u>no value in loc_var_range-low</u> (from Z_OPTSEL) so , I never can fill up Z_OPT1 !! What could I do to fix it ?
    Any help would be welcome .
    Thanks

    <FONT FACE = "Tahoma", Font Color = "Blue">
    My Dear Friend<br>
    <u>Please try the below code:</u><br><br>
    Case vnam.<br>
    When 'Z_OPT1'.<br>
    check i_step = 2.<br>
    <br>
    read table I_T_VAR_RANGE INTO loc_var_range with key vnam = 'Z_OPTSEL'.<br>
    <br>
    if sy-subrc = 0.<br>
    Clear l_s_range.<br>
    if loc_var_range-low = '1'. <br>
    l_s_range-low = '2'.<br>
    endif.<br>
    if loc_var_range-low = '2'.<br>
    l_s_range-low = '0'.<br>
    endif.<br>
    endif.<br>
    l_s_range--sign = 'I'.<br>
    l_s_range-opt = 'EQ'.<br>
    APPEND l_s_range TO e_t_range.<br>
    endcase.<br>
    <br><br>
    Hope it helps.<br><br>
    Cheers Abhijit<br>
    </FONT><FONT FACE = "Verdana", Font Color = "Red">
    Removed
    </FONT>

  • Usage of formula variable with custom table for values

    Hi,
    I have the following scenario:
    a customer wants a report regarding payments of invoices with a formula in it to calculate interest results. In order to do so they want to be able to define a interest rate wich can be used to calculate te result by multiplying the rate by time and amount (for every line in the query the same rate should be used).
    As a solution I thought it would be easiest to give the key user access to a custom table via a custom transaction and then use the entered rate in the query by selecting it from this table using a formula variable (using an exit).
    I was wondering if anyone has ever used such a solution, or if one thinks this is possible.

    Hi Brock,
    Its possible, but I haven't tried as requirements didn't imply.
    More simpler idea is why don't you use a flat file loading through the IP to Info providers?
    Or even more better option is why don't you adapt to Virtual Info providers?
    For your suggested custom table using custom transaction, we can surely make it. Its possible in SE93. Try this transaction code. It must definitely help.
    Thanks,
    Arun Bala G
    Edited by: Arun Bala G on Jan 11, 2010 2:16 PM

  • Realtime scenarios for text &formula variable with replacementpath

    Please search the forums before posting
    i want real time scenarios for Text & formula variable with replacement path separately & how to solve it
    Edited by: Arun Varadarajan on Mar 15, 2009 7:26 PM

    Hi Karen,
    This require a text Variable with customer exit which reads the User entry formula variable and populate the coloum heading
    Hope you got it
    Regards
    Happy Tony

Maybe you are looking for

  • How to find out the latest Record in per_all_people_f and per_all_assignme

    Hi , How to find out the latest Record in per_all_people_f and per_all_assignments_f Requirement : Need to find out the latest record in per_all_people_f and per_all_assignments_f to update the attribute column with pre defined value . Its not possib

  • Clean Windows Install Help

    Hi, I really could use some help. My thinkvantage software got buggy and wasn't functioning, even after resotring the computer to factory clean. I erased everything, including the system partition, and started an XP install on a clean partition. I fo

  • SAP BO system temp required size

    Hi all, Based on the title. I would like to ask a few questions. During migration will it take up alot of space in /temp? If yes,what's the /temp size I should allocate in my new environment before migration? Given my current filestore size is about

  • Down arrow disappears on JComboBox

    I have a problem, I�m trying to make a JComboBox in an interface, but when I add it to my JPanel the down arrow wont show: http://img290.imageshack.us/img290/5240/erroruv9.jpg Code looks like this, most of it is not important but the funny part is th

  • Make child node listen for parent's event

    Is it possible?and how?