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!

Similar Messages

  • 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

  • Error while maintaining the Update Rules for the Infostructure

    Hi,
    I have added 2 new characteristics for the existing infostructure S9xx and executed the same. While maintaining the Update Rules for the same, system is giving the error message 1. "Field 'PARVW' unknown" and 2. Error generating program RMCX0011.
    Please guide me in resolving the issue.
    Thanks & Regards,
    Kumar.

    Hi,
    This is with reference to my earlier question that an error is occuring while maintaining the update rules for the existing Infostructure.
    Solution provider for this will be rewarded with good points.
    Regards,
    Kumar.

  • Creating a start routine in the transfer rule

    I'VE CREATE a start routine, seel bleow.  Now I want to get at one of the fieds for a Key figure.    How do i do that?    do I need to add it to the transfer structure
    LOOP AT ROUTEDAY INTO WA_ROUTEDAY.
    CALL FUNCTION 'CONVERSION_EXIT_TSTRG_OUTPUT'
    EXPORTING
       input = ROUTEDAY-ROUTE_DAYS
    IMPORTING
         output = WA_DAYS_OUT.
      WA_ROUTEDAY-ROUTE_DAYS_CONV = WA_DAYS_OUT.
      APPEND WA_ROUTEDAY.
    ENDLOOP.

    Hi Mick,
    check these links
    start routine in transfer rules
    Look up to load master data
    excluding
    Start Routine in Transfer Rules
    Sample code in Update Rule to restrict data selection?
    Append Datapak - transfer start routine
    Excluding Blank field in Infopackage Filter
    Trans Routine ABAP help ..
    Hope this might help you.
    ****Assign Points If Helpful****
    Regards,
    Ravikanth

  • 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

  • Access to unmapped field of ODS in the update rule of CUBE

    Hi Gurus,
    I have 8 fields in ODS out of which only 5 are mapped to the characteristics in the CUBE. I have to write a start routine in the update rules of the cube. But, I need to access one field, which is in ODS but not mapped to characteristic in the cube.
    So, is it possible to use that field in the logic of start routine. Or do I have to create a new characteristic in the CUBE for that 6th field also.
    Thanks,
    Regards,
    aarthi
    [email protected]

    Hi
    You certaily should insert your infobject field in the cube to populate it. After This you can choose if populate it by direct mapping or by routine.(start routine or transfer routine)
    A classic example of start routine to populate infobject from master data
    tables : /bi0/pcostcenter.
    data : lt_data_package like DATA_PACKAGE occurs 0 with header line,
    lt_costcenter like /bi0/pcostcenter occurs 0 with header line.
    select * from /bi0/pcostcenter into table lt_costcenter.
    lt_data_package[] = DATA_PACKAGE[].
    loop at lt_data_package.
    read table lt_costcenter with key costcenter = comm_structure-costcenter.
    if sy-subrc = 0.
    lt_data_package-/bic/zpcaccgh = lt_costcenter-/bic/zpcaccgh.
    modify lt_data_package.
    endif.
    endloop.
    DATA_PACKAGE[] = lt_data_package[].

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

  • How to determine InfoCube name within the update rule start routine?

    We are attempting to delete all the records where all key figure values are zeroes. We have about 15% of such records and we really don't need them.
    We have yearly InfoCubes. We copy the InfoCube and update rules at the end of every year. So, we don't want to hard code any field names within the update rules.
    If I could determine the target InfoCube name within the update rule start routine, I can find out all the key figures dynamically. But, I don't see a way of finding out the InfoCube name.
    If you would share any ideas, I would really appreciate.
    Thanks.
    Sudhi Karkada.

    Hi Sudhi,
    I dont know if this is what you are looking for.
    if you want to delete a record from being inserted when all the Key figure values are ZERO then you can use a Update Routine for some characteristic in the below way
    If looking for the InfoCube:
    if COMM_STRUCTURE-KF1 = 0 and COMM_STRUCTURE-KF2 AND....
      RETURNCODE = 4.
    else
      RESULT = COMM_STRUCTURE-ChanracteristicObject.
    endif.
    If it is to an ODS / InfoCube in the start routine.
      DELETE DATAPACKAGE where KF1=0 and kf2=0 and .....
    Hope it helps.
    Regards,
    Praveen.
    ENDLOOP.
    Message was edited by: Praveen

  • HT3939 if I purchased iPhone 5 GSM A1429, then I tried to use CDMA SIM card inside the same phone, does it'll work and provide me signals ???

    Hi All,
    Regarding iPhone 5, at the latest model, if I bought an unlocked one from UK Apple Store,  iPhone 5 GSM   A1429, then I tried to use CDMA SIM card inside the same phone, does it'll work and provide me signals or not. ??
    Thanks for your answering.

    The answer is complicated. None of the major carriers offer PAYG service in the US, but if you buy a contract-free phone for full price you can get a plan that can be canceled at any time from any of the major carriers (AT&T, Verizon, Sprint and T-Mobile). There are smaller resellers that offer PAYG service (StraightTalk, for example), but they are hard to deal with.
    The most liberal is the GSM carrier T-Mobile. They have "unbundled" the phone from the service, so if you bring your own phone or pay full price for a phone the monthly cost will be lower.
    The other 3 will charge you the same monthly cost whether you pay full price for the phone or get a subsidized phone.
    Verizon iPhone 5 series phones are unlocked out of the box for international use (thanks to a condition the FCC imposed on Verizon when they were allowed to buy a substantial chunk of spectrum). They are the only phones sold in the US that will work on LTE bands in the UK and Europe.
    Sprint is not a good choice, because they give you a hard time if you want to unlock your phone.
    AT&T phones are locked, but they will unlock the phone if you pay full price or pay off your early termination fee. However, they will only work on GSM in the UK, not on LTE (4G).

  • Strat routine code in transfer rules for the Extractor - 0CO_OM_CCA_1

    Dear SDNers,
    I have a scenario to implement a start rouine code in the transfer rulesfor the Extractor - 0CO_OM_CCA_1 , please give a light on this.
    Scenario:
    The extractor 0C0_OM_CCA_1 brings in Cost Center transactional data for costs and allocation into the SAP BI data warehouse. A cross reference table will be created in SAP BI for Profit Center. These tables will have CRM (CARDIAC RHYTHM MANAGEMENT) Profit Centers stored in them.
    In the transfer rules for 0CO_OM_CCA_1, add ABAP code in the start routine to block CRM (CARDIAC RHYTHM MANAGEMENT) data. The code will have the following logic:
    Check Cost center master data table u2018/BI0/QCOSTCENTERu2019
    This table u2018/BI0/QCOSTCENTERu2019 being time dependent, use the last day of the fiscal period from transactional data as the date to select from u2018/BI0/QCOSTCENTERu2019.
    Go to the Profit center reference table and identify if the data belongs to BSC Boston Scientific/CRM (CARDIAC RHYTHM MANAGEMENT).
    Block CRM (CARDIAC RHYTHM MANAGEMENT) data.
    Best Regards,
    Satya
    Edited by: satya prasad on Sep 8, 2009 8:16 AM

    You could give this a try:
    DATA: wa_qcostcenter TYPE /bi0/qcostcenter,
          wa_ppcxref TYPE /bic/ppcxref,       "Custom Profit Center Cross-Reference table
          l_tabix TYPE sy-tabix,
          l_last_date TYPE d.
    LOOP AT data_package.
      l_tabix = sy-tabix.
      CALL FUNCTION
        'LAST_DAY_IN_PERIOD_GET'
      EXPORTING
        i_gjahr = data_package-fiscper+0(4)
        i_periv = data_package-fiscvarnt
        i_poper = data_package-fiscper+4(3)
      IMPORTING
        e_date = l_last_date.
      SELECT SINGLE
      FROM
        /bi0/qcostcenter
      INTO
        wa_qcostcenter
      WHERE
        costcenter = data_package-kostl
        AND dateto <= l_last_date
        AND datefrom >= l_last_date.
      IF sy-subrc EQ 0.
        SELECT
        FROM
          /bic/ppcxref
        INTO
          wa_ppcxref
        WHERE
          profit_ctr = wa_qcostcenter-profit_ctr.
        IF sy-subrc EQ 0.
          IF wa_ppcxref-data = 'CRM'.
            DELETE
              data_package
            INDEX
              l_tabix.
          ENDIF.
        ENDIF.
    ENDLOOP.
    Edited by: Dennis Scoville on Sep 8, 2009 4:32 PM

  • 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

  • Do I need to use a voltage adapter in the U.S. for my European Macbook?

    do I need to use a voltage adapter in the U.S. for my European Macbook?

    If using the Apple supplied charger unit, you will simply need a plug adapter for the US power system.

  • Hello, I bought my iphone in japan. And now I'm in Brazil and I use it here, I need the unlock code for me to use here. please

    Hello, I bought my iphone in japan. And now I'm in Brazil and I use it here, I need the unlock code for me to use here. please

    williamjapa wrote:
    Hello, I bought my iphone in japan. And now I'm in Brazil and I use it here, I need the unlock code for me to use here. please
    Only the carrier to which the phone is locked can authorize an unlock. None of the Japanese carriers will do that. Sell the phone and buy one that works in Brazil.

  • I just update my iPhone which was previously jailbreaked when i update it after downloading all the file it start to show the apple logo for a moment and it went and completely turned off i tried to connect through iTunes but it doesn't show any iPhone

    i just update my iPhone which was previously jailbreaked when i update it after downloading all the file it start to show the apple logo for a moment and it went and completely turned off i tried to connect through iTunes but it doesn't show any iPhone connected to itunes

    No support for jailbroken phones will be given in this forum or from Apple.
    Unauthorized modification of iOS has been a major source of instability, disruption of services, and…

Maybe you are looking for