KPI calculations in Update Rules

hi friends,
i am loading data from 7 different datasources into 5 ODS at Item level, and loading the data from these ODS into 5 cubes which is at the header level, no item data is loaded in the infocubes. from the 5 cubes(sales,delivery,shipment,billing and 1 POD custom cube) i have to load the data in to 1 higher level basic cube(its not a multi provider). at this higer level infocube im calculating the KPI's in update rules. here comes my problem, in the KPI calculation i have to do the validation, some of the KPI's are as follows.
deliv_numb = deliv_numb (pod).
deliv_item = deliv_item (pod).
my question is i dont have item info in delivery cube, in this case how do i compare the
DELIV_ITEM = DELIV_ITEM (POD).
I am reading it this way.
0DELIV_NUMB = COMM_STRUCT-DELIV_NUMB. (POD)
0DELIV_ITEM = /BIC/ZAXXXX-DELIV_ITEM. (POD).
i want to know whether what i am doing is right, or if im wrong can anyone please tell me the correct way of doing it.
friends this is a bit urgent, plz let me know the best way of doing it.
thanx a lot in advance.
Regards
Ananth

Probably you also have 0DELIV_ITEM in your comunication structure even if you don't need it in the final cube.
Otherwise, it's right to use /BIC/ZAXXXX-DELIV_ITEM. (POD) but you have to do the select before.
Hope it help you.
Regards.
Paolo

Similar Messages

  • Calculations in Update rules/Start routine/End Routine

    Hi Friends,
    I have loaded data to a DSO and i have three fields in to it. Lets say Filed1, Filed2 and Field3. Field1 and Field2 are being populated through an update rule in transformation. Aggregation type for these two fields are "Summation".
    Now, after the transformation executed, the Field1 and Field2 are filled with values. I want to calculate the value of Field3 as follows:
    Field3 = Field1 - Field2
    Can anyone tell me where can i do this calculation? I know we can do this in End routine and in Query  but i want to know if there is any other place i can do this calculation in transformation? In try to do this calculation in the update rule for Field3 in transformation, i dont see Field1 and Field2 as these are not source fields. I can not write formula also because we can write formula only on source fields not the data target fields.
    Your help will be appreciated in terms of points.
    Thanks,
    manmit

    Hi,
    in the start routine in the global section define the two fields:
    data: g_amount1 type /bic/oi<your keyfigure name>,
    g_amount2 type /bic/oi<your keyfigure name>.
    in the routines to your 2 keyfigures store the result in that fields too.
    routine for field1.
    g_amount1 = result.
    routine for field2.
    g_amount2 = result.
    and in the routine to field3
    result = g_amount1 - g_amount2." or whatever calculation/derivation has to be done.
    kind regards
    Siggi
    Message was edited by:
            Siegfried Szameitat

  • Calculation in update rule/routine in order to modify DATA_PACKAGE

    Hello all,
    I want to load some finance data from two ODS objects into an InfoCube. In the update rule I have build a start routine in order to compare two values of  two internal tables (itab1 and itab2) which gets loaded with data from the both ODS.
    When the value of the itab1 is higher of itab2 then I want to subtract the value from itab2 from itab1.
    After that I want to MODIFY the DATA_PACKAGE in order to update later the cube with an new lower value.
    The DATA_PACKAGE is defined as standard table as well as itab1 and itab 2 but I get the error message that the line type is not compatible.
    How I have to build the MODIFY statement in order to calculate and update values in the DATA_PACKAGE?
    Any helps would be great.
    Best regards from Munich/Germany,
    Stefan Leontiadis

    Hi Stefanos,
    My thought is probably not the best in terms of performance, but it should work.  The problem you'll hit is not having the entire data set from both ODS Object loads in memory at the same time.
    To cover this, you can declare a table in the global section of the start routine, let's call it GT_REF_DATA.  Next, perform a SELECT ffrom <other ODS Object> FOR ALL ENTRIES IN DATA_PACKAGE WHERE <selection> into GT_REF_DATA in the local section of the start routine.
    In the individual update routine, you can do a READ TABLE GT_REF_DATA INTO LS_REF_DATA WITH KEY <selection> to get the record you want to compare.
    Here's where you have to be careful.  If I understand your logic right, you can do:
    IF LS_REF_DATA-field < COMM_STRUCTURE-field.
      RESULT = COMM_STRUCTURE-field - LS_REF_DATA-field.
    ELSE.
    RESULT = COMM_STRUCTURE-field.
    ENDIF.
    That avoids processing everything in the start routine and your MODIFY problem.  If you prefer the start routine, you can work with the DATA_PACKAGE directly.  Just remember that DATA_PACKAGE has a header line, so you can simply LOOP AT DATA_PACKAGE, change the value in DATA_PACKAGE, then MODIFY DATA_PACKAGE.
    The way I prefer to do things is to create a separate internal table that is the same type as DATA_PACKAGE.  I fill the internal table with all values to store to the InfoCube (even those you don't change from DATA_PACKAGE).  At the end of the routine, CLEAR DATA_PACKAGE then APPEND LINES OF itab TO DATA_PACKAGE.
    I know there's lots of options above.  Let me know if I got your logic wrong or you have questions.
    Cheers,
    Adam

  • Unit calculation at routine in update rule

    Hello,
    Can anybody explain me how to calculate unit in update rule routine.
    In update rule routine how to access infocube keyfigure like we access communication structure as comm_structure.
    Is there any sample code?
    Please help me out.
    Thanks,
    Regards,
    Steve

    Hi,
    You can find out the no of routines with standard Update rules.
    one of them is :
    <i>for 'Net weight in kilograms' 2LIS_13_VDITM-->0SD_C03</i>
    IF COMM_STRUCTURE-UNIT_OF_WT NE 'KG'.
        WEIGHT = COMM_STRUCTURE-GRS_WGT_DL.
        CALL FUNCTION 'UNIT_CONVERSION_SIMPLE'
             EXPORTING
                  INPUT                = COMM_STRUCTURE-GRS_WGT_DL
                  UNIT_IN              = COMM_STRUCTURE-UNIT_OF_WT
                  UNIT_OUT             = 'KG'
             IMPORTING
                  OUTPUT               = WEIGHT
             EXCEPTIONS
                  CONVERSION_NOT_FOUND = 1
                  DIVISION_BY_ZERO     = 2
                  INPUT_INVALID        = 3
                  OUTPUT_INVALID       = 4
                  OVERFLOW             = 5
                  TYPE_INVALID         = 6
                  UNITS_MISSING        = 7
                  UNIT_IN_NOT_FOUND    = 8
                  UNIT_OUT_NOT_FOUND   = 9
                  OTHERS               = 10.
        IF SY-SUBRC NE 0.
          CLEAR MONITOR.
          MONITOR-msgno = '009'.
          MONITOR-msgid = 'SDBW'.
          MONITOR-msgty = c_msgty_e.
          MONITOR-msgv1 = COMM_STRUCTURE-UNIT_OF_WT.
          append MONITOR.
          RETURNCODE = 4.
          WEIGHT = 0.
        ELSE.
          RESULT = WEIGHT.
          RETURNCODE = 0.
        ENDIF.
      ELSE.
        RESULT = COMM_STRUCTURE-GRS_WGT_DL.
        RETURNCODE = 0.
      ENDIF.
    With rgds,
    Anil Kumar Sharma .P

  • Error in Update rules while defining CKF at cube level

    Hi,
    I am willing to create a Calculated Key figure at CUBE level using formula function
    <b>Unit Cube: Item Cube / Units</b>
    <b>Definitation</b>
    Item Cube - Total Cube for line
    Units   - Actual destination quantity in alternative unit
    <b>Units</b>
    The Unit for ‘Item Cube’ is Volume unit and
    The Unit for ‘Units’ is Alternative Unit of Measure for Stock keeping Unit
    When i tried to create CKF at Cube level in update rules using formula it is displaying me an error that no unit is available in source system for the CKF Unit Cube
    How can I proceed on this
    Thanks

    Hi
    Have you transferred the global settings from the context menu of source system where all the units from the source is replicated to BW system
    Regards
    N Ganesh

  • Inserting code in final steps of Update Rule transformation

    Hi,
    I am extracting data into a cube from an ODS and doing some aggregation in the process. E.g 3 records in the ODS might become 1 in the cube.
    This is fine for some things like Quantity, but not ideal for things like unit price. One work around is for the ODS to have a counter.
    e.g
    MATERIAL QUANITITY  UNIT_PRICE   COUNTER
    1234     13         $1.50         1
    1234     21         $1.50         1
    1234     45         $1.50         1
    This comes across into  a cube like
    MATERIAL QUANITITY  UNIT_PRICE   COUNTER
    1234     79         $4.50         3
    - unit price can then be calculated by dividing unit price by counter - however it needs to be done within the query.
    I thought perhaps we could perform this calculation when populating the cube, if the items were firstly collected within an interim table before being passed to the return_table.
    i.e
    1. Define key figure using ABAP routine and return table.
    2. Append INTERIM_TABLE within update rules for each read of the ODS
    3. Once all ODS records have been read and inserted at an aggregate level within INTERIM_TABLE, loop through INTERIM_TABLE, perform calculation and append RETURN_TABLE.
    My question is: Is there a simple way to determine that all ODS items have been read (like an "at last" statement) and if so, where can this code be inserted? Can it be simply placed in the update rules routine if I have the appropriate logic to determine that all items have been read?
    Thanks
    Adrian

    Hi Adrian,
       Why cant you use Addition, minimum or maximum in update rules...?? Here you can use Maximum option for Unit Price.
    http://help.sap.com/saphelp_nw04/helpdata/en/3f/0e503c3c0d563de10000000a114084/content.htm
    Hope it Helps
    Srini

  • Feasibility of update rule logic

    I have the following scenario:
    I have a DSO which stores a number of records and stores a value for a revenue KPI.  This DSO mainly stores item data and we now would like to include the records which are in the header DSO but not the item DSO and give them a zero revenue.
    Is it best that I select all the data from the header DSO as part of the start routine logic or is there a better way in which I can collect the missing records?
    Thanks

    Hi,
    Looking up the item DSO will be too much performance oriented and may result in long time for loading.
    Do a look up on header DSO while loading the item DSO and select the records from the header which are not equal to the records in the delta package...and then populate them in the item DSO with the flag.
    But this may require you to reload the whole data in the item DSO again...may be you can do this by creating a self update rule to the item DSO and run it for once to maintain the history
    schedule the delta daily from the data source to manage the changes.
    Thanks
    Ajeet

  • Record in DSO Active Table different from result of Update Rule Simulation

    Hi,
    I have a problem with the update of a particular Data Field for certain records via an Update Routine in 3.x Update Rules, from a Source DSO to one Target DSO.
    The DSO Key is the same in the Source DSO and the Target DSO. The Update Routine for the particular (target) Key Figure performs a calculation based on a number of COMM_STRUCTURE Data Fields and gives the Result. For this specific record, the Result being written to the target DSO is 0.00 (It is an 'Amount' Key Figure).
    Based on the Update Routine (which I have run through functionally), this is the incorrect result.
    However, I have run Simulation for this record and the correct result is simulated into the Data Target. I have also run the simulation with Debugging on the Update Rules. Each component/step of the Update Routine is processed correctly, eventually giving the correct result.
    I have tried to re-perform the load and I continually get the same result. This is occurring for a number of records being updated, but not all. Some records where the result of this Data Field is being calculated correctly are 'identical' in all important areas to the problem records.
    The problem records all appear to be in the same Data Package, however that Data Package also contains records being processed correctly.
    Based on the Simulation/Debugging it appears that the Update Routine is correct, however if anyone is willing to have a stab at this I am happy to send you the code.
    Also, a short time ago, we took a copy back from our Production system to our QA system. As a result, this record exists in the QA system as well. I have performed the load there and the record is processed correctly. The Production and QA systems are in line.
    Thanks and Regards,
    Tom

    Hi Ramesh,
    Thanks for posting a response. This is an Update Routine rather than a Start Routine.
    Also, in answer to the Sudhi's reply/post, Yes, the Update Type has been set to Overwrite.
    The problem is actually only present in Production.  Changes was made through our landscape some time ago (this is not my development).
    These changes have been tested through QA and were working. It is only when a reload has taken place in production that this issue has been occurred. A reload has then taken place in QA and has worked successfully.

  • Update rules, different source and target units (0BASE_UOM-- 0QVVMRA)

    Hi,
    I have a problem with update rules as I'm trying to map two keyfigures with different unit-types together. They are both kilograms (KG) but the source figure is defined as 0BASE_UOM and the target keyfigure is 0QVVMRA (Amount of sales).
    How can I make this connection work? Do I have to use the 'Unit calculation in routine' -option or is there a more simple way? I a routine must ne written, please post an example or link to a thread which has one.
    Thx!
    -miikka

    Hi,
    The Problem is that you are trying to connect a Key Fig for Type Quantity with the Key Figure Amount.
    The Amount Key Fig will have either 0CURRENCY or Fixed Currency.
    Using Update Rules Coding you could transfer the Value but you will have problems with the Currency. You cant store a Unit like KG in 0CURRENCY.
    Regards.

  • 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

  • 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

  • Extraction time while updating the data from update rule

    Hello Friends,
    Can you please tell me that why it is taking more time while updating the data from update rule to data target.
    I believe that it is taking 40% of total extraction time.
    Is there any specific reason for it?
    Prompt reply will be appreciated.
    Regards,

    hi,
    check if you have complex transformation in that update rules, like calculation, read from other tables, etc.
    take a look 'bw loading performance and analysis' doc
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/1955ba90-0201-0010-d3aa-8b2a4ef6bbb2
    and bi performance tuning knowledge center
    Business Intelligence Performance Tuning [original link is broken]
    there e-learning for bw performance
    hope this helps.

  • Attribute or routine first in update rule

    Hi
    In my update rules if i populate a characteristics from master data (Ex: 0MATL_GRP from 0MATERIAL) and write a routine to populate other keyfigure based on the attribute. Will it work when i execute the infopackage.
    My requirement is after populating the 0MATL_GRP only, the key figure should be calculated based on the 0MATL_GRP.
    Hope i am clear.
    Regards
    Annie

    Hi
    Thanks for the replies:
    PB: <b>One more way is..just add 0MAT_GRP in the ODS and in the update rules; select the update method as "Master Data Attr. of" - 0MATERIAL (0MAT_GRP is an attribute of 0MATERIAL), so no need to populate in the start routine.</b>
    Now if i add 0MAT_GRP in ods and in the update rules; select the update method as "Master Data Attr. of" - 0MATERIAL (0MAT_GRP is an attribute of 0MATERIAL)
    And in INCENTIVE keyfigure if i write a routine based on 0MAT_GRP and execute the infopackage, will my requirement be met.
    Condition is: After populating the 0MAT_GRP only my kf routine should run.
    So will execute infopackage will 0MAT_GRP is an attribute of 0MATERIAL) run <b>first?</b> or routine in kf
    Regards
    Annie

  • Short dump in update rules

    I removed from my comm structure some objects that I didn't need there.
    Some of them are not connected in the datasource to any field, they just get filled in the update rules by routines. Others just weren´t used anymore and already out of the cube. Since that when I extract the info to the cube, the requisition freezes in the end of update rules waiting for final response.
    I re-activated the comm structure, the datasources, the cube, but the update rules gives me a short dump:
    Message type x
    Msg classe RSAU
    N.º 001
    Var 1 " "
    Var 4 " "
    The termination occurred in the ABAP program "%_T0ITS2" in "INSTANTIATE".
    the main program was "SAPMRSAU"
    The termination occured in line 0 of the source code of the (Include)
    program " "
    of the source code of program " " (when calling the editor 00).
    Did this happen to someone?! Or knows what could bwe the problem?!
    Thank you
    Joã

    Thank you for forcing me to go there once again.
    I was looking at my routines, and forgot to check the formulas.
    Had a calculated key figure with one of that objects. By correcting this I also correct other error. 2 in 1 :-D
    Thankx

  • 0valstckval - not in update rules

    I inserted 0VALSTCKVAL in a communication structure / transfer structure; however, when I link this to an infocube (also containing this InfoObject) then 0VALSTCKVAL is not present in the update rules. Can anyone explain me why not?

    Hi,
    0VALSTCKVAL is a non-cumulative Key figure. The non cumulative is not stored in the provider; it is always calculated as
    NONCUM = INFLOW - OUTFLOW
    The latest know value is always know by the system (the so-called "marker"); which is the overall sum of inflow - outflow (by all combination of chars posted in your cube).
    Bye
    Dinesh

Maybe you are looking for

  • Text Placement Problem

    I'm having an interesting problem with a regular text box. I'm currently editing a co workers work and have come across two paragraphs of text that do something very weird. At the right edge of inside the text box when I try to add a character (.), t

  • How to provide Hotspot in ALV tree????

    Hi experts, I have provided a double click event in ALV tree display. As of now I am able to open the transactions when I click on some the fields in output. But now I want to have a hotspot on those fields. See plz help me with this. This is my cata

  • Where is the Bounding Box?

    When I select items they do not have a bounding box around them, so it is a pain to resize them.

  • Error "svr.unknown" in Folio Builder panel

    We are unable to log in to the Folio Builder. We tried all of the suggestions here - http://kb2.adobe.com/cps/915/cpsid_91536.html - and nothing worked. Is there an error on Adobes end?

  • Configuring Work Email Address Problems

    Hi, Forgive me if this has been posted (I trawled google but to no avail). I'm having problems setting up my work email on the BB Curve 8520, while my hotmail address set up fine. My boss has his work email set up on his, just by typing email and the