Filter in Update (or Transfer) Rules without additional table write

Hi
For filtering out records on a master data attribute in Update Rules (in order to not fill them into Data Target) you can use a start routine like the example blow (from Björn - thanks!)
From the coding I guess that it at least creates and writes into one table.
Is there any way to do this filtering purely in RAM, so the Update Rule just passes on the matching records while simply dropping the filtered records without writing any additional tables than normal during the Update Process?
Full points will be assigned!
Thanks,
German
PROGRAM UPDATE_ROUTINE.
$$ begin of global - insert your declaration only below this line  -
TABLES: ...
TABLES: /BI0/PCUSTOMER.
DATA:   ...
DATA: i_t_customer like /BI0/PCUSTOMER occurs 0 with header line.
$$ end of global - insert your declaration only before this line   -
... internal definitions ...
$$ begin of routine - insert your code only below this line        -
fill the internal tables "MONITOR" and/or "MONITOR_RECNO",
to make monitor entries
  DATA: i_l_data_package LIKE LINE OF DATA_PACKAGE,
          i_t_data_package LIKE STANDARD TABLE OF DATA_PACKAGE.
  select * from /BI0/PCUSTOMER into table i_t_customer.
  LOOP AT DATA_PACKAGE.   
    MOVE-CORRESPONDING DATA_PACKAGE TO i_l_data_package.
    read table i_t_customer with key
      CUSTOMER = i_l_data_package-CUSTOMER.   
    IF sy-subrc = 0.
      IF i_t_customer-COUNTRY = 'DE'.
          APPEND i_l_data_package TO i_t_data_package.
      ENDIF.
    ENDIF.       
  ENDLOOP.
  REFRESH DATA_PACKAGE.
  DATA_PACKAGE[] = i_t_data_package.
  REFRESH i_t_data_package.
if abort is not equal zero, the update process will be canceled
  ABORT = 0.
$$ end of routine - insert your code only before this line         -

Really, if it is your requirement, do the filter in the start routine is less expensive in term of memory consumption and performance.
But I suggest to make a code like this:
select * from /BI0/PCUSTOMER into table i_t_customer.
LOOP AT DATA_PACKAGE.
read table i_t_customer with key
  CUSTOMER = DATA_PACKAGE-CUSTOMER.
IF sy-subrc = 0 and i_t_customer-COUNTRY = 'DE'. 
No Customer with country DE will be in data target!!!!
delete data_package.
ENDIF.
ENDLOOP.
And no other code!
regards,
Sergio

Similar Messages

  • How do you handle update and delete rules for fact tables?

    I have a fact table with a composite key of 5 columns. Two of the columns are FKs to the date dimension. I was setting the delete/update rules for the FK relationship in SSMS and it had a problem with me creating cascade action on the FKs that connected
    to the date dimension.
    What is the proper way to set up FK relationships in fact tables with SSMS when  you have composite keys as most fact tables do?

    Yeah I understand all that. What I'm trying to do is to protect my database from RI violations that occur by production support people blowing away stuff in a dimension table but forgetting to blow away related records in the fact table. I want those fact
    records deleted automatically so we don't have orphan records which was a real issue at a previous engagement. Production support is usually just people that know SQL and some relational modeling. It's not too likely they will understand the details of dimensional
    modeling enough such that they would know that they had to blow away the fact record first.
    My problem is I have a FK to a role playing dimension (the date dimension in this case). So basically I have to columns in the fact table that have a FK relationship to the PK of the date dimension. When I create both relationships SSMS and try to have both
    of them cascade delete SSMS has an issue with it.
    The error I get is:
    Unable to create relationship '[relationship name]'
    Introducing Foreign Key constraint '[constraint name]' on table '[table name]' may cause cycles or multiple cascade paths. Specify ON DELETE NO ACTION or ON UPDATE NO ACTION, or modify other foreign key constraints.
    I can go ahead and put no action and the table will save fine. The question now becomes how does the cascade delete actually work. Can I just set one part of the key to cascade delete?
    Actually I just realized that this is an even bigger design issue. What DOES happen to a fact record when one of it's dimensions gets deleted and I've got full RI set up on the table?
    Or am I totally thinking about this wrong. Do you set up cascade deletes in a dimensional model? Is there a way to prevent deletes from the dimension table if there are related fact records?

  • Find break-points source code (update rules, transfer rules)

    Hi all,
    Is there any effective and efficient way to find (active) break-points in source code, more specfic update rules, transfer rules or other objects where custom code is implemented? Or in other words look for strings in source code or programs.
    I looked and searched everywhere but could not find any answer.
    RSRSCAN1 (does not work)
    RPR_ABAP_SOURCE_SCAN (does not exist)
    We are on SAP BW 3.5 with SAP Basis 640.
    Thanks all.

    Hi,
    Try this
    1)  if you're checking any program from SE38 ..goto Utilities -> find in the source code-> give breakpoint and search.
    2) else. load data , Goto details tab in the monitor and right click on any of the data packages.
    Simulate update -> choose transfer rules or update rules for debuging.-> It will take you debuging screen. -> Create a watch point with key word "break-point" and execute (F8).
    It will go and stop where there is  "break-point"

  • Routine in transfer rules

    I am using the datasrource 0MM_PUR_VE_01,if the score for Evaluation
    Criteria or the score for subcriterion is Zero then this datasource is
    not picking those particular records
    Vendor    Eval.Crite      Subcriterion score   Score for Subcrit Eval. Crit
    1              Price01           Price Level 01               87
                    Quality02        Line/Stock 02               87
                                          Vendor Audit 03             0
                                          Delivery03 On-Time
                    Delivery01                                           87
                                          Quantity Reliability02      0
                                          Shipping Instructions03
    can be checked with t-code me61
    If the score of the Evaluation criteria or score of subcriterion is 0 the datasource 0MM_PUR_VE_01 is not picking that particular record
    in the above example Datarsc not picking the records of subcriterion Vendor Audit 03, Quantity Reliability02,
    actually this data is coming from table ELBP so whenever the score is zero even tha table is not storing that particular record
    I will have 5 evaluation criterion like Price,Quality,Delivery,Service,Service & the subcriterions for these also are fixed
    so i BW transfer rules I have to write a code in such a way that if the particular record is missing then it shouls treat it as score 0
    Ex:-\
    Eval criter          Score
    Price                  10
    Quality                20
    Delivery               0
    Service                10
    Service                 20
    Now my table wont store the record Delivery as the score is 0
    As my evaluation criteria ar e fixed in the update rules I need thelogic that if particular record is missing then it should show it as 0
    If my requiremnt is not clear pls let me knoe
    as this has to be solved very urgently
    Thanks
    Maya

    Hi,
    If you want it to write in Transfer Rule
    assumption that you have permant/contract in transfer rule as per <b>"  can see the attribute permanent/contract in the transfer rules as it is the attribute"</b>
    and
    Permanant--"p'
    Con--'C"
    Try this code in Employee number
    DATA: ZEMP TYPE TRANSFER_STRUCTURE-/BIC/ZEMPNumber.
    zemp = TRan_structure-/bic/zempNUmber.
    if TRan_structure-/bic/zpercon = 'P'.
    concatenate '7' Zemp to ZEMP.
    else
    concatenate '8' zemp to zemp.
    endif.
    RESULT = zemp.
    Yes to can read from Master Data table.
    you can write code in Start routine in Update rule.
    check out this...
    Re: Start Rou
    Regards,
    San!

  • Unable to activate Transfer Rule

    Hello Experts,
    I am not able to activate Transfer Rule in my System ( BW 3.0).
    I have written one routine and then when I am trying to activate I am getting below error messageu201D
    Object 0NOTIFICATN_ATTR object version not found in table.
    My Data Source name is 0NOTIFICATN_ATTR.
    I have also tried to activate by using   RS_TRANSTRU_ACTIVATE_ALL but still no luck.
    I also checked table TADIR and I can see entry over there.
    Regards,
    Pankaj Naik.

    Hi Pankaj,
    Try to activate the transfer rules by executing the SE38 report  - RS_TRANSTRU_ACTIVATE_ALL.
      Also check the note - 884385 , For 'RSAR' errors while activating update and transfer rules.
    Regards,
    Lokesh

  • Problems in transport of Transfer rules

    Hi
    I am trying to transport my objects from development to production. The problems is that not all the objects are getting transported. the cubes and infoobjects are going fine but the transfer rules and communication structure are all pointing to my development source system and hence fails during transport.
    How can i transport my transfer rules without specifying the source system or point to my prodcution source system?
    Regards
    Sujai

    Source systems are not transport portable. They have to be created in your BW_PRD system.
    Assuming you have the source systems created in your BW_PRD system, example R3_PRD. then you need to do the following.
    In BW_DEV you have datasources mapped to your R3_DEV system. So you need to tell your BW_PRD system that any transport with a source of R3_DEV, change it to R3_PRD.
    Go to your BW_PRD system, log in and go to transaction
    Go to RSA1.
    Then go to the menu bar and select Tools -> "Conversion of Source System names"
    You may have no entries, if you do not, hit "New Entries"
    Then in the "OriginalSource System" box type in the name of your development R3 system, example R3_DEV. then in the "Target Source system" type in the name of your production system, example R3_PRD.
    Save, exit and re-transport all the parts.
    That should do it.
    I made the assumtion that you are in 2004s/BI7.0. If not go to the RSLOGSYSMAP table and do the exact same steps.
    Note: This is normally a basis function, and you will need pretty elivated rights to do this in your production environment (well you should ).
    Hope that helps....
    Ali

  • How to write ABAP Routeines in Update/Transfer Rules ?

    Hi Experts,
    Iam new to BW and i don't have ABAP knowledge.Can any body help me ..to write ABAP Routeines in Update rules/Transfer rules.Give me some basic knowledge with proper example.and what type of routeines we need to write ?
    I will appreciate if some one helps me with proper Documentation.My mail id is [email protected]
    Points will be rewarded.
    Thanks in advance,
    Nayanasri.

    Hi Nayanasri,
    It is not mendatory that u need to write Update routines for all update rules. It depends on the requirement. Without update routine u can always manage. My last implementation was for a small chemical firm where i did not use any of the update routine. Suppose if u want to change the records in datapackage depending on certain conditions, then u can go for this. I'm just pasting one of my update routine program
    PROGRAM UPDATE_ROUTINE.
    $$ begin of global - insert your declaration only below this line  -
    TABLES: ...
    DATA:   ...
    $$ end of global - insert your declaration only before this line   -
    The follow definition is new in the BW3.x
    TYPES:
      BEGIN OF DATA_PACKAGE_STRUCTURE.
         INCLUDE STRUCTURE /BIC/CS8YGTGDCL6B.
    TYPES:
         RECNO   LIKE sy-tabix,
      END OF DATA_PACKAGE_STRUCTURE.
    DATA:
      DATA_PACKAGE TYPE STANDARD TABLE OF DATA_PACKAGE_STRUCTURE
           WITH HEADER LINE
           WITH NON-UNIQUE DEFAULT KEY INITIAL SIZE 0.
    FORM startup
      TABLES   MONITOR STRUCTURE RSMONITOR "user defined monitoring
               MONITOR_RECNO STRUCTURE RSMONITORS " monitoring with record n
               DATA_PACKAGE STRUCTURE DATA_PACKAGE
      USING    RECORD_ALL LIKE SY-TABIX
               SOURCE_SYSTEM LIKE RSUPDSIMULH-LOGSYS
      CHANGING ABORT LIKE SY-SUBRC. "set ABORT <> 0 to cancel update
    $$ begin of routine - insert your code only below this line        -
    fill the internal tables "MONITOR" and/or "MONITOR_RECNO",
    to make monitor entries
    DELETE DATA_PACKAGE WHERE /bic/yverbr NE  'V2'.
    DELETE DATA_PACKAGE WHERE /bic/ydpbasfs = 0 AND /bic/yoplqty = 0.
    ENDFORM.
    Where the delete statement deletes the records when the field /bic/yverbr noe equals to 'V2' or deletes it when /bic/ydpbasfs equals zero.
    If the explanation is not suffecient, pls post further
    Regards
    Sriram

  • Hierarchy without Transfer rules?

    Dear All,
    Can we load Hierarchy without Transfer rules?
    *I know we can do this without Update rules but in the case of transfer rules?!!!
    Awaiting early response.
    Regards,
    KS.

    Hi,
    Here, the question is -> when we load hierarchy from SAP source sys.? do we need or not?
    But in TBW10 it is saying we can do hierarchy with and without transfer rules.
    Regards,
    KS

  • How can I activate the transfer rules for the ODS updating a data target.

    We are on BW 3.5 and I'm loading data into the 0FIGL_O10 ODS  and then uploading the data into the cube 0FIGL_C10. The data loads just fine to the ODS but when I try to <u><b>'update the data target'</b></u> I get a date & time stamp' error on the info-package transfer rules.
    I then Replicate the datasource 80FIGL_O01.
    I must then <u><b>'activate' the transfer rules</b></u>.
    However I cannot get the transfer rules for 80FIGL_O10 in CHANGE MODE to activate them.
    How can I activate the transfer rules for the ODS updating a data target.
    The error text is as follows:
    DataSource 80FIGL_O10 has to be replicated (time stamp, see long text)
    Message no. R3016
    Diagnosis
    DataSource 80FIGL_O10 does not have the same status as the source system in the Business Information Warehouse.
    The time stamp in the source system is 02/15/2007 10:42:33.
    The time stamp in the BW system is 11/07/2006 13:11:54.
    System response
    The load process has been terminated.
    <b>Procedure
    Copy the DataSource again and then activate the transfer rules that belong to it. You have to activate the transfer rules in every case, even if they are still active after the DataSource has been copied.</b>
    Thanks for your assistance.
    Denny

    Hi Dennis,
           Try, using Business Content to activate your data source
           hope this will help you
    How activate business content?
    http://help.sap.com/saphelp_nw04/helpdata/en/80/1a66d5e07211d2acb80000e829fbfe/frameset.htm

  • Unable to collect Update/Transfer rules Info & Data sources from BI content

    Hi,
    We are tyring to activate Infoprovider 0PY_CO2 from BI content by selecting the option - In data before. BI is unable to collect all corresponding objects such as Update rules, Info source, transfer rules and the data source for the selected Infoprovider. Only Info area and associated info objects are being collected for the installation.
    We are experiencing same problem whilst acitvating most of the info providers. However, in some cases, either of these objects get activated but not all the necessary objects that feed data to the Infoprovider (cube or multi provider).
    Also, Infopackages and Info object catalogs are not being collected for any objects activated/installed so fare from the BI content.
    We are trying to activate BW 3.5 content on the BI 7.0 environment. BI Content release is 703 and support pack level is 008.
    Kindly share any pointers to troubleshoot this probelm please.
    Thanks
    Venkat

    Shiv,
    For some Info providers, all associated info objects(including transfer & update rules and info source and data sources) are getting collected and got successfuly installed. But this is true for only 10% of the Info providers that we have installed so far.
    Remaining all the objects, we are unable to proceed further.
    Thanks
    Venkat.

  • Call on update module without addition "in update task"

    Hi, folks!
    Could anyone please explain the behaviour of an update module that is called without addition "in update task" with regards to transactionality and locking? Where is the processing carried out - in the dialog step, I guess? Does a COMMIT WORK AND WAIT make any sense in this context? Will any locks be removed in this way?
    Thank you very much in advance!
    Cheers,
    Thomas

    Hi Thomas,
    Please find the below mentioned piece of code :
      call function 'Z_ZE0EDISTAT_UPDATE' in update task
           EXPORTING
                w_ZE0EDISTAT          =  struct_ZE0EDISTAT
           EXCEPTIONS
                NO_UPDATE            = 01.
    *&   Update Database with changes.
      COMMIT WORK AND WAIT.
    In this case whatever changes which will be done to the table 'ZE0EDISTAT' inside the FM 'Z_ZE0EDISTAT_UPDATE'  will ONLY be reflected in the database table  ZE0EDISTAT' when COMMIT WORK and WAIT statement is encountered. Else updates won't be visible. Hope it will clear some doubt of yours.
    Cheers
    VJ

  • 0SD_C03 transfer rule and update rules do not exist in BI Content

    I am working on SAP BI 7.0 support level 16 and BI Content 703 support level 9.
    I am not finding these objects in BI Content for the Sales Overview Infocube  0SD_C03:
    Update Rules do not exist for 2LIS_11_VAKON,
    2LIS_11_VASCL, 2LIS_11_VASTH, 2LIS_11_VASTI, 2LIS_11_V_SCL,
    2LIS_11_V_SSL, 2LIS_12_VCSCL, 2LIS_13_VDKON.
    Transfer rule does not exist for
    2LIS_13_VDITM, but exists for all other DS.
    7 Transformations exist only for:
    2LIS_13_VDITM
    Can somone help me out with why this is so? Which datasources are to be used for 0SD_C03, 3.x or 7?
    This is an urgent requirement.
    Regards,
    Sony

    Most of the problem has gotten solved by our upgrading to BI Content level 17.
    The others, i made a direct mapping of some of the transfer rules manually.
    It is working fine now.
    Thanks for the replies.
    Sony

  • ABAP Guidelines for transfer rules & Update rules

    Is there any guidelines for abap when using it for transfer rules and update rules? I am looking for some best practise in this area.
    Thank you,

    There is no specific differences in the standards/coding procedure for Transfer Vs. Update Rulse.
    This can only come from a combination of requirement, design and experience! (in no particular order)
    for e.g.
    If the converions are the same for all data targets, you would use the transfer routine, start routine in the Transfer rules.
    If the converions are different for different data targets, you would use the update routine, start routine in the Update rules.
    Key concerns being performance, modularization, reduced effort and ease of maintenance.
    Not sure I have answered you question! Please get back if there is something specific you are interesed in (a scenario perhaps!)
    Rishi

  • Start routine in Transfer Rules for Data Mart update

    Hi,
    Is it possible to create a start routine in a transfer rule of a Datamart update (from ODS to Cube)?
    Thxs.
    LauQ

    Roberto,
    If I read well the content of note 499404 - referred to in 630854 - I conclude that it is recommended to use update rules rather than transfer rules in the case of ODS objects when one wishes to modify data records up to the eventual data target.
    Do you agree?
    Thxs.
    LauQ

  • ?Difference: To create 2 Transfer Rules or 2 Update Rules

    Hi,
    I need to load 2 similar flat files to a single ODS. Only change is that, during the load, in the first file, File1, I want to set a field, FileType, as File1; and during the load of the second file, File2, I want to set FileType, as File2.
    One update rule which loads File1, already exists. I wanted to create the second update rule(for File2), but I encountered problems because I kept receiving a message that the update rule already exists for the ODS.
    I went to the InfoSource tree and under the infoSource for File1, I could see the transfer rule; at this point, I was able to create a second transfer rule where I was able to set the second constant while loading File2, as FileType as File2.
    What is the effect of creating 2 transfer rules for the InfoSource, as against creating 2 update rules for the ODS, which was I originally wanted to do?
    Thanks

    Hi Amanda,
        If both file formats are same, it better to populate File1 or File2 dynamically then a constant. Every time not supposed to create new transfer rules and data soruce for new flat file.
        Instead of constant, write a routine for File Type. Based on file name sinply pass File1 or File2 in routine. Or
        Use function module "BAPI_IPAK_GETDETAIL" to get infopackage details including file name. from flat file name also File type can be derived.
        In this way no need to maintain multiple transfer rules or update rules. Existing flow is enough.
    Hope it Helps
    Srini

Maybe you are looking for

  • I can't upgrade from Snow Leopard to Mountain Lion

    I have a Mac Pro (1.1.1) running Snow Leopard (Mac OS X10.6.8.) I want to buy and upgrade to Mountain Lion. I've followed the instructions on Apples webpage http://www.apple.com/osx/how-to-upgrade/ and have (I thought) met all the criteria to upgrade

  • GR/IR not cleared Error

    Hi Guys, while doing GR/IR clearing for certain documents,we are getting error. The error log says " No clearing procedures were carried out " Please advise.. thanks srikanth..

  • Is there a way where I can get my old version of a particular app back?

    Alright, so, I own this iTouch and it's the 2nd generation one, I know it's old, but I don't wanna upgrade atm cuz i'm happy with the one I currently have. I plugged in my iTouch last night and my applications started updating itself in iTunes and th

  • OATM for R12.1.1

    Hi, We are in the process of upgrade from 11.5.9 CU2 to R12.1.1. We are not on OATM model right now. Is it mandatory for us to convert to OATM before we start the upgrade to R12.1.1? I believe, its not, but wanted to confirm. Thanks Murali

  • Web Dynpro TabStrip - Adding a new tab

    Hi Gurus, Please let me know how to add new tab to existing SAP web dynpro component? Any kind of example would be great. Appreciate all your help. Thanks, GSM