Routine /Formula in update rule

Hello
I am trying to use formula function in update rule but its giving me error
scenerio here is
I tried with routine syntax wise itz correct but not working
here is the example
fill theIF 'KNART' eq 'ZP01'. internal table "MONITOR", to make
result value of the routine
RESULT = 'KNVAL'.IF 'KNART' eq 'ZP01'.
ENDIF.
if abort is not equal zero, the update process will be canceled
ABORT = 0.
$$ end of routine - insert your code only before this line -
ENDFORM.
trying to update with knval( avleble in commication structure) only if other(KNART is eq zp01) i found sysntaxwise code is correct but its giving me shortdump at teh time of loading
any input will be great help
cheers
Praveen

Hi
I tried with this code though its syntax wise correct but again its not working
IF COMM_STRUCTURE-KNART eq 'ZP01'.
RESULT = COMM_STRUCTURE-KNVAL.
ELSE.
RETURNCODE = 1.
ENDIF.

Similar Messages

  • How to calculate the runntime of a routine in an update rule

    I'm facing a performance problem with the loading of an ODS.  After some analysis I'm almost sure that the problem is due two routines (in the update rule) that are looking into master data tables 200.000 times ( quantity of records loaded every day).  But before moving that logic back into the extractor I need to be sure that the runntime will be reduced.  Is there any way to obtain the amount of time spent by those routines?.  I have been checking into the transactions ST03N and STAD but I'm not able to find this information.
    Thank you very much in advance.
    My best regards.
    Pablo Mazzucchi

    Hi,
    For performance problem you can try to get the look data in an internal table at start routine and use them and read for the fields you need which will help you in decreasing the run time vs hitting the database direclty for getting the look up information.
    This will bring you a noticable change in run time of data load.
    Lets wait if some other has routines to get run time of the routine
    Thanks,
    Arun.

  • How to get the PSA name in a Start Routine in the Update Rules of a Cube.

    Hi all.
    I have an InfoSource that loads data directly in an Infocube.
    In the Start Routine of the Update Rules I need to retrieve the PSA table name for that InfoSource, to access it and check some data.
    I can't use the PSA name you seen in the DataFlow because it will change once the update rules are transported to another system.
    Please advice.
    Thanks!!!

    Hi,
    we do it as follows:
    first get the request ID:
    DATA: tp_request(30)   VALUE 'REQUEST'.
    FIELD-SYMBOLS: <wa> TYPE ANY, <tp_req> TYPE ANY, <tp_dtp> TYPE ANY.
    READ TABLE datapak ASSIGNING <wa> INDEX 1.
    IF sy-subrc <> 0. ABORT = 4. ENDIF.
    ASSIGN COMPONENT tp_request  OF STRUCTURE <wa> TO <tp_req>.
    IF sy-subrc <> 0. ABORT = 4. ENDIF.
    requnr = <tp_req>.
    then we get the table with
    SELECT odsname_tech FROM rstsodspart WHERE request = requnr.
    you may need to adjust this code, I've just pasted the relevant parts...
    another way is to get this info from RSTSODS where the different versions are maintained...
    let me know if you need further detail about this stuff...
    hope this helps...
    Olivier.
    Message was edited by:
            Olivier Cora

  • Filtering records using a start routine inside the update rules for a dmart

    Hi
    I am using a start routine inside the update rules. I want to filter out all records that have 0 in all three fields. My problem is that it not only filters these records, but also filter records with negative values, which I do not want. Only 1 field has a negative value, the other 2 have 0.
    I have tried:
    DELETE DATA_PACKAGE where  /BIC/ZBILLCONS = 0 and /BIC/ZBREVPRIM = 0  and /BIC/ZBREVSUBO = 0 .
      DELETE DATA_PACKAGE where ( /BIC/ZBILLCONS = 0 and /BIC/ZBREVPRIM = 0  and /BIC/ZBREVSUBO = 0 ).
    also tried:
    delete DATA_PACKAGE where /BIC/ZBILLCONS IS INITIAL and
    /BIC/ZBREVPRIM IS INITIAL and  /BIC/ZBREVSUBO IS INITIAL.
    The records are going to 1 cube and 1 ODS, I only have the start routine in 1 update rule. I  view the filtering in the PSA.
    Has anyone ran into this before?

    Try
    delete data_package where /BIC/ZBILLCONS = '0' and /BIC/ZBREVPRIM = '0' and /BIC/ZBREVSUBO = '0' .
    OR
    delete data_package where /BIC/ZBILLCONS EQ '0' and /BIC/ZBREVPRIM EQ '0' and /BIC/ZBREVSUBO EQ '0' .
    Good luck!

  • Formula in Update rule(Urgent)

    Dear Gurus,
    Iam written Formula in update rule
    Get source system type is SUBSTRING( Source System, 2, 1 )
    And Get Client Formula is RIGHT( Source System, 3 )
    Above formula  syntax is correct.
    But when iam loading data getting below error.
    Formula in InfoObject /BIC/CLIENT : The argument 'R3DCLNT240' cannot be interpreted as.
    In Help node it is showing below message.
    This is a specific error message of processing from the handling of incorrect data data records. It enables the jump into the error requests or the PSA maintenance, depending on whether the generation of an error request was desired, and whether or not it was possible.
    How to solve this problem?What does it mean?
    Thanks in advance
    Ramu

    Hi Ramu,
    Instead of using Formula why don't u try with Constant in Update rules for R3DCLNT240.
    Try with this and hope it may works.
    Thanks & Regards,
    Reddy.

  • How can I view the code for a routine in an update rule

    on loading data for 0PLANT_ATTR, I am getting an error for No Local Currency found in Plant 1000 and SAles Org 6000. 
    in looking at the update rules for this, I see that there is a routine for the update of the local currency:
    Perform GET_LOCCURRCY_FOR_PLANT
    USING COMM_STRUCTURE-PLANT
    COMM_STRUCTURE-SALESORG
    CHANGING hlp_monitor
    RESULT
    hlp_subrc.
    How do I see the code behind this?  I want to make sure that I understand everything that needs to be populated in Master Data so that I can ask my functional consultant to update all the necessary fields.
    Thanks
    JP

    Hi Riccardo,
    When I double click on it, I get a message at the bottom that says program reindexed. 
    After looking again, I found that when I double clicked on the comm structure, then the routine, I was able to see it.
    Thanks
    JP

  • ABAP assistance - start routine logic in update rule

    I have used an existing update rule and have based my logic around the same.  The purpose of the rule is to look up customer master data and get a subset of customer numbers from the transaction records so that the values for customer number from the transactional data will not be updated if it does not match with existing master data customer numbers.
    The loads are full and we drop the data before we load.
    I have listed the logic below (the number at the front is to be considered as the line number) and a list of open questions that I have thereafter:
    Start routine logic:
    1  DATA: l_index LIKE sy-tabix.
    2  DATA: BEGIN OF ls_customer,
    3        customer TYPE /BI0/OICUSTOMER,
    4        objver TYPE RSOBJVERS,
    5     END OF ls_customer,
    6      lt_customer LIKE TABLE OF ls_customer.
    7  REFRESH: lt_customer.
    8  LOOP AT DATA_PACKAGE.
    all customers from data package
    9    ls_customer-custno = DATA_PACKAGE-custid.
    10  ls_customer-objver = 'A'
    11    APPEND ls_customer TO lt_customer.
    12   ENDLOOP.
    12  SORT lt_customer.
    13  DELETE ADJACENT DUPLICATES FROM lt_customer.
    14   IF NOT lt_customer[] IS INITIAL.
    15    SELECT /BI0/OICUSTOMER RSOBJVERS
    16      FROM /BI0/PCUSTOMER
    17      INTO CORRESPONDING FIELDS OF TABLE lt_customer
    18      FOR ALL ENTRIES IN lt_customer
    19      WHERE ls_customer-custno = DATA_PACKAGE-custid
    20      AND ls_customer-objver = 'A'
    21    SORT lt_customer BY customer ASCENDING                    
    22  ENDIF.
    Questions
    Line
    1 - what is the purpose of this line? What is it that is being declared
    2 - in some code I have seen this line with OCCURS 0 at the end what does this mean with and without the term?
    4 - I am using the Data Element name is this correct or should I use the field name?
    3 - 5 here I declare an internal structure/table is that correct?
    6 - here I declare a work area based on the internal table is that correct?
    7 - What would happen if I avoided using the REFRESH statement?
    8 - 12 - Is this syntactically correct, I am trying to get a set of data which is the customer numbers which match the master data customers and the master data record is án active version and than appendíng to the work area?
    13 - My understanding is this will reduce the number of records in the work area is this correct and needed?
    14 - 22 I am trying to identify my required set of data but feel I am repeating myself, could someone advise?
    Finally what logic would I actually need to write in the key figure object, could I use something like:
    Result = lt_customer.
    Thanks
    Edited by: Niten Shah on Jun 30, 2008 8:06 PM

    1. This line is not required
    2. OCCURS 0 is the OLD way of defining an internal table with that structure.  As it is, it just defines a flat structure.
    3. Data element is usually best
    3-5 Yes
    6. No.  Here you are declaring a table of the type of the flat structure.  Just as the ABAP says!
    7. Nothing.  But by putting this in, you ensure that you know the state of the table (empty) before you start looping through the data package
    8-12. You can tell if it is syntactically correct by pressing Ctrl-F2 when in the editor.  Looks ok.
    13. Ensures your list of customers contains no duplicated.  The code up to this point is building a list of all the unique customers in the data package.
    14-22. Goes to the database and brings back ONLY those customers which are found in the master data.  Looks ok.
    This is a start routine (that's why you've got a data package).  You don't use result.  You should update the datapackage.  But this you haven't done.  Double click on the table name /BIC/PCUSTOMER to get the correct field names.
    So you have to loop through the data package again, and check if the customer in the datapackage is lt_customer.  If it is, fine, otherwise you blank it and report an error, or set an error message or whatever.
    I wouldn't do it like this.  I'd do something like this:
    STATICS: st_customer TYPE HASHED TABLE OF TYPE /bi0/oicustomer
                                  WITH UNIQUE KEY TABLE_LINE.
    * st_customer retains its value between calls, so only populate if empty
    * In one run of the infopackage, this will mean you do only one read of
    * the master data, so very efficient.
    IF st_customer IS INITIAL.
      SELECT customer FROM /BI0/PCUSTOMER
                              INTO TABLE st_customer
                              WHERE objvers EQ 'A'. " Only active values
    ENDIF.
    * Go through data package
    LOOP AT DATA_PACKAGE.
    * Check whether the customer exists.
      READ TABLE st_customer TRANSPORTING NO FIELDS
                  WITH TABLE KEY table_line = DATA_PACKAGE-custid.
      CHECK sy-subrc IS NOT INITIAL.
    * If you get here, the customer isn't valid.  So I'm just setting it blank
      CLEAR DATA_PACKAGE-custid.
      MODIFY DATA_PACKAGE. " Updates the datapackage record
    ENDLOOP.
    Even this is not fully optimised, but it's not bad.
    I strongly suggest that you get yourself sent on the basic ABAP programming course if you're going to do a lot of this.  Otherwise, read the ABAP documentation in the help.sap.com, and, from the editor, get the cursor on each ABAP keyword and press F1 to read the ABAP help.
    matt

  • 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

  • Formulas in Update rule active Program

    Hi,
    I would like to know whether is it possible to see the formulas applied in the update rule active program generated .
    for exampkle: (IF TRANINDIC = 0, NET_VALUE,0).....This formula has been applied for a specific kefigure in update rule.
    I just wanted to see the above formula in the update rule activer progrma...so is it possible to see....if it is possible please let me know some tips and tricks to check the same.
    Thanks
    Sujan

    Hi,
    In rsa1 open upadate rules. and in the main menu. check for option generated program under menu options.
    you can get the program.

  • ABAP routine/lookup in update rule

    Hello Gurus, I am trying to do a lookup from 2 ODS's into one. I am trying to join sales and delivery data.
    My current idea is that I will use the 2LIS_11_V_SSL extractor that has SO, SOitm, DO, DOitm data and bring that into an ODS that has those four items as the key.
    During that update, I will need specific fields (mostly key figures - Net Price from the SalesOrder ODS, and Del. Qty from the DelOrder ODS).
    The SO and DO ODSs each have a key of SO/SOitm and DO/DOitm respectively.
    What I am trying to do is write a routine for each of the necessary fields to do a lookup on the source ODS and bring in the field value according to the SO/SOitm or DO/DOitm key.
    A simplified example
    <u>Target ODS</u> Initially coming from 2LIS_11_V_SSL (keys)
    <b>SO
    SOitm
    DO
    DOitm</b>
    Net Price
    Del. Qty
    <u>SO ODS</u>          
    <b>SO              
    SOitem</b>          
    Net Price       
    <u>Del Order ODS</u>
    <b>DO
    DOitm</b>
    Del Qty.
    I have the 4 key fields coming from another extractor, need to lookup the key figures from the other ODSs on the load
    If I could get some example code on how to do this I would greatly appreciate it! I was told an internal table might do the trick, but after scouring the forums I can't find anything that seems close enough.
    Thanks!
    Justin
    Message was edited by: Justin  Molenaur
    Message was edited by: Justin  Molenaur

    Ajay (or anyone else)...one more question
    Is there a way to limit the number of times that the net price field may be written.
    for example, a SO item may be associated with multiple delivery order items, so you only want to write the net price field once PER sales order item. If we did it just like above, everytime a sales order item had multiple delivery order items, there would be multiple net price values for each delivery order item, which is not correct (see spreadsheet).
    Sales Order     Sales Order item     Delivery Order     Delivery Order item     Net Price (SO)     Del Qty (Del)
    1     10     100     10     15     150
    2     10     101     10     25     200
    <u>2     20     101     20     <b>50</b>     250
    2     20     101     30     <b>50</b>     299</u>
    3     10     102     10     23     213
    4     10     102     20     27     476
    So the challenge would be to create a counter(?) or something that will only allow a SOitm to have only one net price.
    Thanks for you help!
    Justin
    Message was edited by: Justin  Molenaur
    Message was edited by: Justin  Molenaur

  • Date not coming in proper format after applying formula in Update Rules

    Hi All,
    I have two time characteristics "Goods Issue date" and "Goods Return date" and One key figure "No. of days elapsed".
    The key figure "number of days elapsed" is being calculated by taking difference of "goods issue date" from "goods return date", but the format for that is not coming proper for example:-
    Goods Issue Date is 21.06.2006
    Goods Return Date is 22.08.2006
    According to formula No. of days elapsed shud be 62
    but it is coming as 04.03.0001.
    Please help as it is a urgent requirement.
    Much Appreciated,
    Sunil Morwal.

    Dear Sunil,
      Kindly check if creating 2 new KeyFigures (DATE) will be of help by assigning the said "two time characteristics" values.
      From these 2 new KYFs, apply your formula..
      Hope this helps..
      Thanks.
    Message was edited by: Arnold Padiernos

  • Multiple selection in formula in update rule

    Hi Guru's,
    I want to make an exclude selection of two banks (ZCHBANK) of the whole bankselection (ZCHBNKSEL). I made an transformation between these two info objects and now I made a formula IF(BIC/ZCHBANK = (3.896) , 'N', 'J' ). Now I become a list of MD with all banknumbers with the sign J and only for banknumber 3.896 N. This is what I want. But now I want to have more banknumbers which not have to go through. So in other words bank 3.896, 3.202 and 3.980 must be excluded. I am struggling with the formula to exclude more than one banknumber.
    I already tried the next formula's but nothing seems to work:
    IF(BIC/ZCHBANK = (3.896) OR (3.980) , 'N', 'J' )
    IF(BIC/ZCHBANK = (3.896) , (3.980) , 'N', 'J' )
    IF(BIC/ZCHBANK = (3.896) , 'N', 'J' )OR IF(BIC/ZCHBANK = (3.980) , 'N', 'J' ).
    IF(BIC/ZCHBANK = (3.896) , 'N', 'J' ) IF(BIC/ZCHBANK = (3.980) , 'N', 'J' ).
    IF(BIC/ZCHBANK = (3.896) , 'N', 'J' )AND IF(BIC/ZCHBANK = (3.980) , 'N', 'J' ).
    IF(BIC/ZCHBANK = (3.896) , 'N', 'J' )& IF(BIC/ZCHBANK = (3.980) , 'N', 'J' ).
    Can anybody tell me how I can make a formula so three of banks of whole the bank selectionwill become 'N' in the formula and all the other banks will become 'J' ?
    Thanks in advance.
    Regards,
    Jens

    Hi there,
    Try this one:
    IF(((BIC/ZCHBANK = 3.896) OR (BIC/ZCHBANK = 3.202) OR  (BIC/ZCHBANK = 3.980)), 'N', 'J' )
    Diogo.

  • Diff between the Start routine and Update rules?

    Hi Gurus
    Diff between the Start routine and Update rules?
    Thanks in advance
    Raj

    Hi,
    Routines are like conditions or business rules that could be applied to filter the data while entering the BW system or could be used to apply certain conditions on the info objects itself.Update rule level you manipulate your data and  write your start routine.
    There are 4 types of routines
    1. Start routine- Could be used at two levels (transfer rule level and the Update rule level)
    This Start routine written at the transfer rule level helps filter the necessary data coming from the source system.
    For Example: If you decide to extract data that contain only quantity greater than 500 , then you could specify the Start rouitne to achieve this.
    The Start routine at the Update rule level provides similar functionality but at this point it helps direct specific data to 
    different data targets.  For Example: If there 3 data targets being fed from the Infosource, you may want to apply some condition to each data target, like send year 2000 data ti Data target1, 2001 to data target 2 and so on.  This can be achieved by using Start routine at the Update rule level
    2. Transfer Routine: This feature is available at the transfer rule levels
    While performing the transfer rules operation, there are 4 features available to the developers to create business rules on top pf the Infoobjects.
    1. You could do a one to one mappping of the Infoobject
    2. Provide a constant value
    3. Include a formula
    4. Write an ABAP routine.
    These 4 options refers to the transfer routine
    3. Update Routine:
    The limitations of just having 4 options in the transfer routine is overcome at the update rule level. There are various other 
    sophisticated features avaialable apart from the 4 options mentioned above. These business rules could be specified pertaining to each data target.
    4. Conversion Routine: It provides functionality to do Currency and unit conversion.
    Regards.

  • Start Routine in Update Rule

    I want to replace all '# ' values showing up in a report with  space. For this I plan to write a Start Routine in the Update Rules which should scan all the data coming in into the cube and replace all  null or '' with space.
    What is the best way to write this routine. It should check all data in all the fields of the data load coming in.
    Thanks

    Hi,
         The space is shown as # in the BW Reports, to confirm check the value in the cube for this field, so
          you need to change that to some other character like X or Y or explain your end users that SAP
          designates a space as # and it will be displayed that way in the reports.
    Regards,
    Raj

  • How to debug start routines of update rules from ODS to InfoCube

    Dear gurus,
      I have an update rule from ODS to InfoCube. I wrote a start routine in the update rule. Now I want to debug it. I went to monitor and simulate update the data package and only got the prompt "No data exists in the corresponding PSA table". So how can I debug this start routine?
      Thanks in advance.
    Jin Ming

    Jin,
    In order to use PSA between ODS and InfoCube, you may have to use an exclusive InfoPackage and load separately. In that InfoPackage, choose the radio button to use a PSA.
    I think you are currently updating the InfoCube directly without using a separate InfoPackage.
    Look for an InfoSource under DataMarts (search for 8<ODS Technical name>) and create your InfoPackage there.
    Good luck.

Maybe you are looking for

  • Performance problem, statspack report included.

    HI, on my 9.2.0.8 cpu_count=12 EE I've got job which takes 5h , there is strange top sql reported: STATSPACK report for DB Name         DB Id    Instance     Inst Num Release     Cluster Host E1        2020101010                E1            1 9.2.0.

  • Best practice to host websites on xserve with mac os x server leopard.

    Hi Guys, I'm trying to optimize the xserve to host multiple joomla sites... Can some one help me with "hidden manuals or using your experience" about best practices out there...!! It'd be great on your part... Cheers

  • Install os x

    I was told I could free up several gigs of hard drive space by doing an erase and custom install without the extra languages and drivers, etc. Is this true, and about how long would it take?

  • JVM 1.5.0_07 crash

    Hi, We are using vertex O series in Sun OS. We have configured JCO to connect to other system and the connector is crashing and it is creating a file hs_err_pid<pid>.log with the following contents. Earlier it creates the same files frequently but wi

  • Reversing process or Subcontract Challan

    Hi,   I want to know how to cancel the subcontrcat challn also in status of challna therte are reverse , cancel  and delete  what is exact diffrenece in all this i want to cancel my challan and also material docuemnt  what is use of reverse process