Update Rule routine to get Totals of the key figure

Hey BW folks....
i have  a requiremnt in the report wherein I have to get the total salary of all the employees in the cost center. As cost center has many employees I want to calculate total salary of the those employees in tht cost center only.So  basically total salary will be depending the no.of employees in tht cost center.I tried  doing it in query not working. So Wht abap code I will have to write in the update rules to achieve this
eg:
|        salary(kf) |  total salary
cc1           |e1   |   $5000    |  
|e2   |   $3000    |
|e3   |  $2000     |
|-- |--$10,000(for tht cost center only)
cc2   so on and so forth
Suggestions will be reciprocated with lots of points
Nick

You should try doing it in query; update rule will not guarantee you correct results.
What is this other KF that you are using to multiply, is it a KF in the cube?
Try defining a CKF with 'constant selection' on Cost-center, this should give you the total value per cost center for each row (I think). You can then use this in your formula
sal_kf * other_KF / CKF

Similar Messages

  • Update Rule routine to get last 4 characters of a field

    I am aware I can do this using a formula.  However, can someone assist in writing the routine which gets the last four characters of a field.  The field is part of the COMM_STRUCTURE? Thanks

    Hi,
    For determining the length of the field, you have to use first the statement DESCRIBE so you get the figure into a variable (I do not have a SAP system right now, so errors can occur in the following):
    <b>data length type i.
    describe comm_structure-field length into length.
    length = length - 4.
    result = comm_structure-field+(length)(4).</b>
    However, please shift your field is RIGHT JUSTIFIED earlier than using these statements. Please consider the instruction SHIFT. That will insure you that you get the right characters.
    Regards

  • Problem in the update rule routine in BIW production

    hi,
      I have encountered a problem in the update rule, the problem is, there is a routine to calculate the age of a person, age is a key figure,
    The problem is that the key figure is not being calculated.
    we had encountered the same problem in the bw developent, we reinstaled the update rule, and the age was calculated correctly. Where as in production we cannot instal from business cotent, should we transport the perticular update rule once again?
    if there is any other solution, please let me know.
    Thanks in advance.
    regards chetana.

    I think retransporting is the only option available to you. You cannot modify anything in your production system.
    IF you have a chance to speak with basis people,ask them to open the system status to modifiable for few minutes.
    and make necessary changes in production and bring it back to normal (This is not a best practise in all situations).
    hope this helps.
    Praveen

  • Update Rule Routine Problem

    Hi
    i have wriiten a update rule routine.
    in that routine i am fetching comp code ,GL Acct. from SKB1 table and match those records wth Data Package records.
    Data Package has both Open and Closed items. so i need to match the Comp Code and GL Account which i have fetched from SKB1 with Data Package Comp Code and GL account which records will be matched they will go to Target ODS otherwise Delete from Data Package.
    But data is not coming properly in Target ODS.
    i have debug the routine and found , there are 10 records(Comp Code + GL Acct.) has been fetched from SKB1
    and Data Package has Total 416 Records. Only 20 Records has been gone to Target ODS while I have seen the 216 Comp Code and GL Account combination has been successfully matched with 10 Records of SKB1
    Below is the code in Start routine.
    Note: Data Package has Multiple Records for a Combination of Company Code and GL Account which is present in SKB1.
    How can i resolve this problem.
    ********Logic to Fetch Open items GL Account**************
    *Fetch data from SKB1*********
    SELECT /BIC/ZMCFBUKRS
           /BIC/ZMCFSAKNR
           FROM /BIC/AZOCFSKB100
           INTO TABLE TB_ZOCFSKB1
           FOR ALL ENTRIES IN DATA_PACKAGE
           WHERE /BIC/ZMCFBUKRS = DATA_PACKAGE-COMP_CODE
           AND  /BIC/ZMCFSAKNR = DATA_PACKAGE-GL_ACCOUNT
           AND /BIC/ZMCFXOPVW = 'X'.
    ***Fetch records from FI GL Data Package which match with
    ***internal table TB_ZOCFSKB1
    LOOP AT DATA_PACKAGE INTO WA_DATA_PACKAGE.
    READ TABLE TB_ZOCFSKB1 INTO WA_TB_ZOCFSKB1 WITH KEY
    /BIC/ZMCFBUKRS = WA_DATA_PACKAGE-COMP_CODE
    /BIC/ZMCFSAKNR = WA_DATA_PACKAGE-GL_ACCOUNT
    binary search.
          IF sy-subrc ne 0.
            DELETE TABLE DATA_PACKAGE FROM WA_DATA_PACKAGE.
          ENDIF.
    ***Clear Work Area****************
          CLEAR WA_TB_ZOCFSKB1.
          CLEAR WA_DATA_PACKAGE.
        ENDLOOP.
    ***Refresh internal table*********
       REFRESH TB_ZOCFSKB1.
      ENDIF.
    if abort is not equal zero, the update process will be canceled
      ABORT = 0.
    Edited by: AtulMohan Mishra on Feb 9, 2011 11:22 AM

    Hi,
    It is very important that you SORT the internal table before you do a READ with Binary Search.
    SORT TB_ZOCFSKB1 BY /BIC/ZMCFBUKRS /BIC/ZMCFSAKNR.
    You are sure to miss results unless you do.

  • Update rule/routine for 0PUR_C04

    hi experts,
    can someone give the update rule/routine for uploading 0ORDER_VAL(effective order value) into the cube 0PUR_C04 and the calculations for it?
    and also some explantion on how this effective purchase order value 0ORDER_VAL is calculated*??
    thanks

    Hi Surya,
    If you are using standard content for 0PUR_C04, you can get the update rule in standard update rules, which you can see in Business content on Metadata repository. For standard content four data source used to fill cube. Purchasing Group (2LIS_02_S011 ), Purchasing Data (2LIS_02_HDR), Pur.Data  (2LIS_02_SCL) and Purchasing Data (2LIS_02_ITM). The mapping for different update rules are done as:
    2LIS_02_S011: Direct Mapping
    2LIS_02_HDR: No Update
    2LIS_02_SCL: Routine (mm_convert_effwr)
    fill the internal table "MONITOR", to make monitor ent *ries
    IF ( COMM_STRUCTURE-PROCESSKEY = '001' or "Bestellu *ng
    COMM_STRUCTURE-PROCESSKEY = '011' or
    COMM_STRUCTURE-PROCESSKEY = '021' or
    COMM_STRUCTURE-PROCESSKEY = '004' or "LP
    COMM_STRUCTURE-PROCESSKEY = '014' or
    COMM_STRUCTURE-PROCESSKEY = '024' )
    AND COMM_STRUCTURE-BWAPPLNM EQ 'MM'
    AND COMM_STRUCTURE-ORDER_VAL <> 0.
    perFORM LOC_CURR_CONVERT
    USING COMM_STRUCTURE-ORDER_VAL
    COMM_STRUCTURE-DOC_DATE
    COMM_STRUCTURE-ORDER_CURR
    COMM_STRUCTURE-LOC_CURRCY
    COMM_STRUCTURE-EXCHG_RATE
    CHANGING RESULT.
    if the returncode is not equal zero, the result will not be updated
    RETURNCODE = 0.
    else.
    RETURNCODE = 4.
    endif.
    if abort is not equal zero, the update process will be canceled
    ABORT = 0.
    2LIS_02_ITM: No Update
    Hope this will give you some lead.
    Regards,
    Kams

  • 0PS_C02 update rules are not getting activated when i install 4rm BI conten

    Hi All,
    In BI Dev. sys for PS module-  Project System - Dates 0PS_C02 cube-  update rules are not getting activated when i install from the business content and its giving the error  " IC=0PS_C02 IS=0PS_DAT_PRJ error when checking the update rules                Message no. RSAU461" .
    I deleted the inactive update rules(6 nos) and installed again from BI Content, then the same issue raising.
    Can anyone help me out as i stuck up with this to move to go-live.
    Thanks,
    Sakali

    Hi Vassu,
    here are some of the reasons for getting error in update rules activation.
    1. Check the formula or routines that are used in Update rules and check is there any syntax errors.
    2. check whether the mappings are correct or not.
    3. check the info objects which ur used for mapping are in active or not..
    (or) if the info object may be deleted which ur using for mappings.
    Thanks
    Sai Chand.

  • Update Rule Routine not deleted properly

    Hi all
    I have deleted a routine from an update rule, removed the key figure from the infoprovider and reactivated both the ODS and the update rule.
    The update rule therefore no longer contains the datafield.
    Unfortunately the the code for the routine still exists in the system (RSAABAP and other tables) and references in this routine to other fields are preventing me carrying out other actions, so I need to properly remove the routine from the system.
    I cannot go back to the old generated code for the update rules as there is no version management.  I have tried putting the field back on the ODS and recreating the routine, but the system generates a new key for the routine so it looks as though I have lost the link completely.
    Any suggestions?  Is there a way of deleting an object type R3TR ROUT consistently without doing it through the Update rules change screen?
    Regards
    Hayley

    Hi,
    Let me give the solution, we are also having the same issues..
    thanks in advance
    sree

  • Why data in PSA doesn't  change when update rule routine is modified?

    Hello guys,
    why data in PSA is not changed after I modifiied the update rule routine. I created a infopackage which is only to PSA, but it shows me any change. If I changed this infopackage to the one which is assigned to "PSA firstly, and then to Infoobject", then I saw the changes in infoobject, but in PSA, still nothing changed.
    I can't figure out the reason. Any hint is welcome!
    Thanks in advance.
    Regards,
    Liying

    HI..
    1) PSA data is like of source system data
    2)Update rules are how you update your keyfigures to Data Tragets.
    Since you have put upto PSA that is the first data staging in BW so there wont be any change of the data even if you write routines at update rules.
    Hope it is clear
    Reg
    Ram

  • HT1222 Wheb I try to update iTune I am getting a message "the site has not a valid signature" and the downloading is stopped. How can I fix IT?

    Wheb I try to update iTune I am getting a message "the site has not a valid signature" and the downloading is stopped. How can I fix IT?
    I am using windows 7 64

    That suggests that the installer is getting damaged during the download.
    I'd first try downloading an installer from the Apple website using a different web browser:
    http://www.apple.com/itunes/download/
    If you use Firefox instead of IE for the download (or vice versa), do you get a working installer?

  • Can i use the key figure total delivery time in days in rows and how is can

    Dear all,
              Can i use the key figure total delivery time in days in rows and how is can.but all the key figures r used in rows but i cannot use in column.i want bothin rows and in column  at a time ,can this is possible,and how.

    Hi,
      yes you can.You will have to use structure in the row.
    Right click on the row and create a new structure.
    In this structure you can add key figure.
    Maximum number of structure a query can have is two
    Please assign points if it helped you.
    Regards,
    Senoy

  • Populating the key figure in the Cube

    hi frineds,
         I need to populated the custom key fiugre added by me in the cube using the update rule. But if i see the tables of the cube it is seperate for every dimension and key figure. how can i select the particular record from the key figure table with out the reference of the dimensions table.
    Thanks
    Prem

    so you want to
    1. read particular record from cube
    2. populate the amount there.
    but populating the amount directly to infocube is not advisable and not feasible as well.
    my suggestion will be virtual infoprov based on transformation
    you will have to write your logic there and you can populate the amount based on billing number (you said you have amount against billing number).
    at query runtime based on transformation/logic your amount will be populated.
    only drawback reduced query performance

  • Fiscal year in the columns outside the key figure structure

    Dear Experts
    I have a report requirement to show the keyfigures in the columns from year 1 to year 10 and in each year there are 4 keyfigures each restricted to 1 quarter for 4 quarters.
    So, there are too many keyfigures to create.
    I am using fiscal year in the columns outside the Key figure structure containing the keyfigures restricted at each of 4 quarters.
    So, when the report displays, all the 10 years will automatically be displayed.
    The problem is one of the 4 quarter level keyfigures needs to be restricted by calendar year.
    How can I read what is the fiscal year for each column at runtime so that I can reference this value to determine the calendar year ?
    As you know, each FY spans 2 Calendar Years. So, i need to restrict this on the 4th keyfigure by calendar year but while having the FY outside the keyfigure structure i can get all the FY, I am not sure how to access this value at runtime so that eg.
    if FY for column 1 is 2010, i can set calendar year to be 2010 to 2011.
    Hope you can give me some clues.
    Thanks you Gurus!
    Best regards
    John

    Dear Sunnybt
    Copy Riyes,  I find your response interesting. Please could you elaborate your idea of using condition in more detail.
    Sorry for my late response.
    Allow me to clarify my statement, which you are right, is unclear.
    By :
    "if the current QuarterFY is less than the current QuarterFY"
    I mean :
    eg. user enters FY range : 2009 to 20NN  (eg. 2017)
    KF_column1_FY2009_Q1______KF_column2_FY2009_Q2____KF_column3_FY2009_Q3______KF_column_FY2009_Q4______KF_column_FY2010_Q1______KF_column2_FY2010_Q2____KF_column3_FY2010_Q3______KF_column_FY2010_Q4_____KF_column_FY_NNNN_Q1
    For each column, where the FY can be any year range entered by user,
    the Text Description of the Column should show either 'Actual' or 'Plan' based on what is the current FY Quarter at runtime.
    If the FY Quarter (eg. 1st column is 200101) is before current FY Quarter (i.e 201103), then the Description of this column should be "Actual" , else "Plan".
    In my current design, I am unable to use customer exit text variable to meet this requirement.
    So, I like to check with you for fresher ideas.
    If not , I would use a workbook, which I am avoiding as the user needs to drilldown and I believe drilldown is not possible in workbooks where report layout needs to be rigid or cell positions fixed. Of course, unless there is a way out of this which I do not know.
    Best regards
    Bass

  • Setting the values of the key figures

    Hi,
    I have a problem in a query. There is a variable chosen with a range for 0calmonth. For the two of the key figures, I need to restrict the key figure to the first period and for the other key figure I need to restrict to the last period. However, what I need more is that if in the restricted period there is no value for that key figure it should get the first period that it has a value. For example:
    Our variable set as: 02.2006   -  05.2006
    And our data is
         CalMonth          KeyFig1     KeyFig2
    A     02.2006                 0            7
    A     03.2006                 0           8
    A     04.2006                 4            9
    A     05.2006                  5            0
    I want to see in the query as:
                  KeyFig1    KeyFig2
    A              4                9             
    When I add the results with first value and last value, I can see these figures in the general results section. But this time I have to hide the key figures and show only the results section.
    Any idea on preparing such a query?
    Thanks in advance...

    Hi,
    try using conditions:
    http://help.sap.com/saphelp_nw70/helpdata/en/43/2695d2fd2f0d23e10000000a1553f7/content.htm
    http://help.sap.com/saphelp_nw70/helpdata/en/43/b57138c1afbd20e10000009b38f889/content.htm

  • Select the Key Figures to be presented in a query before execute the it

    Hi,
    I want to select(through checkbox) the Key Figures to be presented in a query before executing the query. I'm creating BEX queries and web templates (I'm working on BEX 7.0).
    I haven't found clear post about this so if you have implemented something like this please help me and share your solution.
    Kind regards,
    Ana

    Hi,
    If you set a property of your KF as "Hide and can be shown", you will get a filter option for these KFs after executing the report in the navigational block of web report.
    When you click on that filter, you will get the list of KFs, then you can select the desired KFs using check box.
    Regards,
    Yogesh.

  • Web templete showing "EA" in the Key figure but not in Bex Report

    Hi,
    When I exucute my query in BEx , the report works fine , but while exucuting in Web , "EA" is getting added after every Key figure Value..
    Can you pls help us with any input ?

    Ajay,
    I think you did't understood the problem correctly .
    My Bex report don't have any Quantity Key figure So in bex report no Unit( If I think EA is Unit )  is coming . Same should come while executing in Web . But the Problem is in Web some EA symbol is coming .
    N.B : Our system just undergone SP upgrade .

Maybe you are looking for