Calculating with formula variables of type user exit

I created the following query:
Rows: Characteristic = Employee
Column: KYF = Status
Filter: Year, Month
The KYF ist a formula containing a formula variable. This variable of type user exit should return a value recording to the value of employee and has to be read in a customizing (data-) table by the user exit.
Is it possible to read the values of employee row by row from the internal table which contains the amount of data before processing to output screen and fill the 'Status'-KYF or should I create a virtual keyfigure for this case.
Thanks for all your feedback,
Angelika

Hi,
It seems like Status is master data of Employee.
As per your process, if you do either formula variable or virtual keyfigure you will face query performance problem. More over you cant simply access record by record characteristic value in formula variable. It will be another complex process like you have to call the characteristic value via replacement path.
You have the following choices:
You mentioned master data is availabe in custom table. Try to pull the custom table master data into employee info object. Maintain  status as one of the attribute of the master data. Then you can display Status value simply in the report. This will be global access like you use this Status value n number of info providers which is having Employee as one of the info object in the info provider.
If the previous way is not possible, include the Status in the info provider level and write a simple update routine to populate the values. This will be info provider level.
I am not sure whether you are in development environment or productive. If developement, then you can choose simply any one of the above ways.
Regards,
Vivek

Similar Messages

  • Variable of type user exit

    Hi all,
    I have a variable of type user exit which is used to let the user enter a characteristic value in a popup-box.
    I am able to display the box and let the user enter a value, but then I'm stuck. Where does this value go?? How can I make sure that this value actually is used in the variable??
    I am attaching my current code cause I feel like something is missing with regards to exporting the correct value.
    Thanks and regards,
    TM
    DATA: i_sval Like sval occurs 0 with Header Line.
    data: v_subrc like sy-subrc.
    i_sval-tabname = 'ZASSET_AREA'.
    i_sval-fieldname = 'AREA'.
    i_sval-fieldtext = 'Asset Area'.
    i_sval-field_obl = 'X'.
    append i_sval.
    CALL FUNCTION 'POPUP_GET_VALUES'
    EXPORTING
    NO_VALUE_CHECK = ' '
    POPUP_TITLE = 'Asset Area'
    START_COLUMN = '5'
    START_ROW = '5'
    IMPORTING
    RETURNCODE = v_subrc
    TABLES
    FIELDS = i_sval
    EXCEPTIONS
    ERROR_IN_FIELDS = 1
    OTHERS = 2.
    IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.

    Hi,
    From the code you have written, I observe that after capturing the value in the pop-up, you are not passing the value back to the variable table.
    What I would suggest is, pass the variable value to the upc_var_cha_act table explicitly. This might resolve the problem.
    Sunil

  • BPS Variable for hierarchy type User-Exit

    I try to make this type of variable.
    The variable is NCSTOPU, hierarchy is
    NHSTOPU like
    NHMAIN
    -- 4
        -- 401
        -- 402
        -- 403
      -- 5
         -- 501
         -- 502
         -- 503
    So The ABAP is
    FUNCTION ZCCB_AHR_VAR_HIER.
    *"*"Ëîêàëüíûé èíòåðôåéñ:
    *"  IMPORTING
    *"     REFERENCE(I_TYPE) TYPE  UPC_Y_VAR_TYPE
    *"     REFERENCE(I_AREA) TYPE  UPC_Y_AREA
    *"     REFERENCE(I_VARIABLE) TYPE  UPC_Y_VARIABLE
    *"     REFERENCE(IS_HIE_KEY) TYPE  UPC_YS_HIE_KEY
    *"  EXPORTING
    *"     REFERENCE(ET_HIE_NODES) TYPE  UPC_YT_HIESEL
    DATA ZHIER type upc_ys_hiesel.
    *CHANM  UPC_Y_CHANM
    *HIENM     UPC_Y_HIENM
    *HIEVER     UPC_Y_HIEVER
    *DATETO     UPC_Y_DATETO
    *NODENAME     UPC_Y_NODENAME
    *HIECHA     UPC_Y_CHANM
    *DUMMY_LEAF     UPC_Y_DUMMYLEAF
    *TO_CHADEP     UPC_YTO_CHADEP
    ZHIER-CHANM      = 'NCSTOPU'.
    ZHIER-HIENM      = 'NHSTOPU'.
    ZHIER-NODENAME   = '5'.
    ZHIER-HIEVER     = 'A'.
    ZHIER-HIECHA     = '5'.
    ZHIER-DUMMY_LEAF = ''.
    ZHIER-DATETO     = '99993112'.
    INSERT ZHIER INTO TABLE ET_HIE_NODES.
    ENDFUNCTION.
    But it doesn't work.
    The mistake is
    Selected node 5 does not exist
    The node 5  selected as the start value for characteristic 5 with the specified compound table does not exist in hierarchy NHSTOPU.
    What is the problem?

    Configuration of the variable:
    Variable Type - Hierarchy node,
    Characteristic - NCSTOPU,
    Hierarchy - NHSTOPU,
    Replacement type - user-exit,
    FUNCTION MODULE NAME - ZCCB_AHR_VAR_HIER.
    In the planning level the characteristic NCSTOPU is set with this variable.
    In the Layout  1) the characteristic NCSTOPU - Lead Column,
                         2) Hierarchy in the lead column -  Hierarchical Data Model, BW Hierarchy

  • Formula variable for a user input DATE value

    Hi All,
    I want to create Formula variable for a user input DATE value as I need to use it in a formula to compare between user entry date & date in the DSO. Does any body has any idea about it?
    I tried to create formula variable with manual entry but then I am not getting DATE option.
    Regards,
    Sonal

    Hi ,
    You have to create a formula variable in the formula.
    The formula variable in the general tab would have the reference characteristic as your date characteristic on which you have created a user entry variable or on which you intend to create a date entry variable.
    Give the proceesing type as replacement path.
    Next in Replacement path mention you would replace the variable with value of another variable.
    Mention the variable name.(This is the actual varaible created on the selection screen),
    Also mention you would replace only from value/to value of the variable.
    Check the following help link
    [Replacement path type formula variable|http://help.sap.com/saphelp_nw70/helpdata/en/e3/e60138fede083de10000009b38f8cf/frameset.htm]
    Hope this helps,
    Best regards,
    Sunmit.

  • BW 3.5 - Issue with formula variable with replacement path

    Dear experts,
    I'm facing an issue with formula variable with replacement path.
    Just to clarify, I know replacement paths is raising a lot of questions but I've been using this functionnality extensively in the past, both in 7.0 and 3.5, so I'm not looking for basic information about how to use it.
    I'm trying to setup a simple report that would show total values per plant of Purchase Order < 100 €
    To do so I've setup a calculated key figure as follow:
    VAR1 * ("PO value" < 100 ) * "PO value"
    VAR1 is a formula variable with replacement path on 'purchase order' and value attribute 'constant =1'.
    (The report has to show values summarized by plant but should not show the detail PO by PO, so I'm not looking at a solution based on condition)
    The report as characteristic "plant" in rows and my CKF in columns.
    Now let's take an example. I have 3 POs in Plant 1:
    PO1 -> 150€
    PO2 -> 90€
    PO3 -> 80€
    Because of the variable with replacement path, the result in my query should be:
    plant1 = 170 (even though characteristic "purchase order" is not in my rows, system should evaluate PO one by one and return values only for those two that are below 100).
    But the result coming is 320, which is wrong.
    I've done the same report on many other 3.5 systems and it worked perfectly, and I am not able to get proper support from SAP OSS who keep saying that this functionnality is not ready in 3.5 (although I've provided screenshot of this working on another 3.5 system!!! how frustrating...)
    They have also pointed to problems of Before and After aggregation but that has absolutely no impact. Once again, the scenario is working perfectly on other 3.5 systems with the same query design, so i'm sure it has nothing to do with Query Designer options.
    Would anyone have ever come to an equivalenet problem? I'm wondering whether the DB itself could not play a role in the variable with ref  characteristic 'constant =1' ...
    Any though is welcome!
    thanks

    Hi,
    The text variable is replaced when the exact date is clear for this key figure column according to the restriction.
    To achive this, please make sure that either the variable is directly restricted in the key figure selection, or that the date characteristic is in drilldown.
    Regards,
    Patricia

  • Problem with formula variable

    HI,
    I am facing problem with formula variable with replacement path. my requirement is system date - posting date.
    here i created 2 formula variable one is system date. second formula vaiable with replacement path is posting date. second formula vaiable not populating data. please help on that.
    regards,
    kris

    Hi,
    here is some idea.. here i have taken expample dates 1)notification creation date and 2) notification completion.
    1st:in the query designer at key figure coloumn create
    one local formula.in that local formula create formula
    variable with replacement path.in that take reference character
    notification completion.in the next tab take replace ment
    as key.in the last tab select "date".
    2nd: do the same thing for the notification creation date.
    3 rd : create 3 rd local formula and do the substraction
    for the first 2 local formulas.
    4th:create codition on the difference which u have find with
    on that condition u can create one user entry varibale.
    5th:while u defining the query put these 2 dates,i,e
    notification completion, notification creation date in the character block.
    If not system will ignore the formula variable which u created in
    above steps.
    Hope this wil help u.
    regards....KP

  • Formula variable of type replacement path not working

    Hi Folks,
    I have created formula variable of type replacement path and replaces with characteristic key.I wanted to use charecteristic infoobjects in coluns so that i have created formula variable for that.But when excecuting the query in web it is not displaying values for that formula.
    Can anyone plz solve this,if u come accross this situation before.
    Thanks and Regards,
    Ravikiran
    Edited by: MRK@SAPBI on Jun 11, 2011 1:13 PM

    Thanks vineet, for your quick reply.
    yes,i have used the characteristic in a row and it is a number.
    Still it is not displyaing values.But i need to calculate the couter for the same formula created on that charateristic and need to put condition in the query.
    thanks,
    Ravikiran

  • Variable declaration in user exit?

    Hi,
    How can i declare variable in user exit? Is it the same way we declare in report?
    Thanks & Regards,
    Abhijit

    Well Vamshi,
    I got a question regarding user_exit. How can u declare the variable in Save_Document_prepare user exit? How can you import or export fields in to that subroutine?  And also if version changed then whether the user exit, customer exit and screen exit will work properly?
    Thanks & Regards,
    Abhijit
    Edited by: Abhijit Mandal on May 4, 2009 11:41 AM

  • Formula variable is a user entry ??

    Hi All,
    I have created formula variable as a number and how i can use this formula variable is a user entry variable
    Please help me this
    Regards,
    Ravi

    Thank you very much I have used this formula variable in condition so I was missing some Key figure values, now I am getting total Key figure values 
    I appreciate your help
    Regards,
    Ravi

  • Types User-exit

    Hi my Friends
    Plz can Give me exmples type User-exit.
    - What's la difference betwen Use-exit and Baddi ?
    Said
    <THREAD LOCKED. Please stop asking interview questions. There is already a lot of information out there, refer to the [Rules of Engagement|https://wiki.sdn.sap.com/wiki/display/HOME/RulesofEngagement] on how to ask a good question and learn to search>
    Edited by: Mike Pokraka on Oct 14, 2008 3:16 PM

    Hi,
    the user exit ZXPADU01  is for all infotypes , it should work for all infotypes ,
    one more things is this will  triggered only for create and copy operation only,
    means automatically it will be called in PA40 beacuse this is create opration
    and in PA30 it will be worked for create and copy operation only,
    so try to activate this include and respective function and its function group .
    and try to test by including break-point in this code.
    dynamic actions will be used for creating infotypes and respective default values based on other infotype .
    please do the same and let me know so that we can think for other solution.

  • BW - problem with formula variable (date format)

    Hi,
    (sorry if I'm using different term than yours.. this is my 2nd query.. still new with BW)
    I need to create 1 query: Support Message Aging Report.
    Basically it will have 5 columns: Not Due, 0 Day, 1 Day, 2-10 Days, >10 Days.
    and 1 input selection is: key date.
    the formula is: number of aging day = key date - due date.
    I have no issue on the 1st and 2nd column. For that I just create 1 customer exit.
    My problem is on how to separate the over due support message by day (due date < key date).
    I tried create 2 formula variable for key date and due date. Then from these 2 vars, I can get the number of days.
    Problem comes when the calculation is cross month/year. I suspect maybe because the return from the formula var is in number format and not date... yyyymmdd. Then, I change the dimensions from number to date.. it is working for key date.. dd.mm.yyyy.
    but for the due date, I got problem... it keeps give me warning saying: value 'D' invalid for property dimension of element etc.///
    below are details for both formula variable.. please advice which area should I fix or maybe you can suggest any good idea for my query.. thanks so much
    1. ZKEYDATE - customer exit (value  input data) - dimensions date - NO ISSUE (OUTPUT: dd.mm.yyyy)
    2. ZDUEDATE - replacement path (ref char ZBW02C08) - replacement rule: infoobject, key - dimension date - GOT WARNING...
    ZBW02C08: contains due date and the type is date: yyyymmdd

    If I were you, I'd try two things:
    best way - have the infoprovider changed to have a new key figure for the number of days difference
    - to do this with formulae (especially crossing months and years - what about leap years) is hard to maintain and develop
    other way - make a virtual key figure - i did this once but I forget how exactly. There's a userexit or BADI somewhere which can be used for this.
    Either of these ways allows the calculation to be done in ABAP itself where date1 - date2 gives you the number of days difference.
    By the way though, this is in the wrong forum. I'd bet if this was in a BI forum, you'd have an answer already.

  • Exception color with formula variable(replacement path)

    Hello,
    I tried to define exceptions in a query which "from" and "to" values
    are determined by formula variables with replacement path. I checked
    the values of the formula variables and they are right. <b>But <b>the cells
    are not colored</b></b>. When I set the same values in the field "from" and "to" without variables : the colors appear.
    Could help me to resolve this problem please ?
    Catherine Bellec

    Hi Alec,
    You are right, the user exit permits to color the lines.
    But the value of my variable needs to change for each line of the infocube so I can't do this with the user exit RSR00001 because it concerns global variables.
    That's why I used a replacement path on a virtual characteristic.

  • Zero Suppression Not working in Bex Query with Formula Variable

    Hi Friends,
    I have a peculiar issue here. We upgraded from 3.5 to 7.0 recently. Some of our Bex queries have been behaving abnormally after this. In these queeries,
    we have some key figures which use formula variables (ready for input and mandatory) in 3.5. User can enter either 1 or 0. The actual key figure is multiplied to the formula variable so, the entire column gets the actual key figure value if the user enters a value '1' and the gets the value 0 if the user enters '0' in the formula variables. Zero suppression is activated on the rows and columns and this report. This technique was used successfully to show/hide a column.
    After upgrade, the same query works but, the zero suppression is not working. When the user enters a value of '0' in these formula variables, all the entries in the column for the key figure are displayed as 0 but the column is still displayed. It is like the zero suppression setting is not active at all.
    I created one of those queries in Bex 7.0 to see if that works but, the issue still exits. Have anyone come across this kind of a scenario? Please get back to me if anyone has any idea on this situation.
    Thanks and Regards
    Subray Hegde

    Which SP level are you at in BI 7? There is an OSS Note that would need to be applied if you're on lower than SP10. That note is:
    [OSS Note 964756 - Formula variables with replacement from difference in BI 7.0|https://websmp130.sap-ag.de/sap(bD1lbiZjPTAwMQ==)/bc/bsp/spn/sapnotes/index2.htm?numm=964756]

  • How to display text variable of type customer exit

    Hi to all,
    I have created a query in query designer which display sales value according to plant.
    There i have also used a variable which will take input from user and restricted on 0CALDAY.
    I have also created 2 text variable to display the text for sales based on input in variable.
    I need when user enter the 01.02.2010 - 31.12.2010 value in variable , text variable should display SALES FROM 01.02.2010 TO 31.12.2010
    i knew how to do that by using text variable of processing type customer exit.
    But display of text variable is like SALES FROM 01022010 TO  31122010  ,
    But i need that SALES  01.02.2010 TO 31.12.2010
    i shall be thankfull to you for this.
    Regards
    Pavneet Rana
    Edited by: pavneet rana on Dec 22, 2010 7:46 AM
    Edited by: pavneet rana on Dec 22, 2010 8:03 AM

    Hi,
    Give Description on Sales Amount  as SALES FROM &ZVAR_YEAR1& TO &ZVAR_YEAR2&.
    ZVAR_YEAR1 & ZVAR_YEAR2 are the two text variables. These two variables should NOT be input enabled.
    In the Exit - under I_STEP = 2, write the below code.
    WHEN 'ZVAR_YEAR1'.
      DATA:   l_s_range       TYPE rs_s_range,
                   loc_var_range TYPE rrs0_s_var_range.
      READ TABLE i_t_var_range INTO loc_var_range WITH KEY vnam = 'ZVAR_INPUT_CALDAY'.
      l_s_range-sign = 'I'.
      l_s_range-opt  = 'EQ'.
      l_s_range-low  = loc_var_range-low.
      APPEND l_s_range to e_t_range.
    WHEN 'ZVAR_YEAR2'.
      DATA:   l_s_range       TYPE rs_s_range,
                   loc_var_range TYPE rrs0_s_var_range.
      READ TABLE i_t_var_range INTO loc_var_range WITH KEY vnam = 'ZVAR_INPUT_CALDAY'.
      l_s_range-sign = 'I'.
      l_s_range-opt  = 'EQ'.
      l_s_range-low  = loc_var_range-high.
      APPEND l_s_range to e_t_range.

  • Help with formula variable that will give me period #

    column A = $  for fiscal year period  variable  (using 0RMA_FIP,  SAP delivered variable for period)
    Column B = $ for fiscal year period  variable minus 1  (previous period)
    In Column C,  if fiscal year period entered in 0RMA_FIP was 001/YYYY  (january)  I want column C to be zero,  if not,  it will be a variance between column A & Column B.
    I think know how to do boolean logic:  (FV_Period == 1) *0 + (Column B % Column A)
    What i am having trouble with is creating FV_Period  as a replacement path formula varialbe so that it will contain the value of the period,   1 for January,  or 2 thru 12 for other months..

    While creating the Formula variable with replacement type, you need to mention the offset start and offset length.
    I believe if your Fiscal Period is displayed as 2010009 then
    offset start = 5 and offset length = 3 should give you the value 009 which is required.

Maybe you are looking for

  • Getting error when starting managed server from administration server

              When i start one of my managed server in the cluster i get the following error           The WebLogic Server did not start up properly.           Exception raised: java.lang.ArrayIndexOutOfBoundsException           java.lang.ArrayIndexOutOf

  • How do i check if i have WEP please???

    hey guys!! i got a linksys wireless access point at home and because my imac G5 is pretty new i was impressed that it was so easy to set up to my wireless network. i am sure i set up my WEP with the imac (i have my xbox 360, nintendo DS, PSP & PC on

  • What are the pros/cons of having 1 large BI system versus 2 medium systems?

    What are the pros/cons of having 1 large BI system versus 2 medium systems?  Are there any known limits as to how large a BI system can be until it experiences performance problems? Thanks!

  • Download csv User Reports

    Hello, Idm provides the ability to either run or download a CSV or PDF of each report type under Reports--> Run Reports. However execution on a user report takes over 2 hours for our environment. One would think that IDM would allow for admins to dow

  • Tablespace....contents=TEMPORARY.. how long will data reside here??

    Hello all, While creating a tablespace we have the option, PERMANENT OR TEMPORARY. Well, in the oracle 8.1.6 db that i have; the temporary tablespace is like this... A tablespace was created with TEMPORARY and it is used as the temp tablespace. So un