Deleting data package entries in start rout/update rule

in my logic in the start routine , i wish to delete all records form data_package where data_package-fieldx = somevalue .
can i do it using a single statement in one shot ? if yes , how ?
or do i have to loop through the entire package , check the condition and then delete .

create internal table with 2 fields, billno and item
loop at datapackage
read internal table to see if it is there,
if not, add the record,
if yes, delete the datapackage.
endloop
This way, your datapackage will have only the 1st record for each set.
Good Luck,
CL

Similar Messages

  • Deleting Data Package with Abap - error in Abap statement

    Hi,
    I am trying to delete data with abap but my logic is not working and it failed with error message Error in an abap/4 statement  when processing
    requirement
    - Delete data package when plant = INDIA
    - Delete data package when Area = 01 OR Group =  J001 in customer master data table.
    Logic
    Data: T_Data TYPE DATA_PACKAGE_STRUCTURE Occurs 0 WITH HEADER LINE.
    data: lt_BI0_PCUSTOMER LIKE /BI0/PCUSTOMER OCCURS 0 WITH HEADER LINE.
    LOOP AT DATA_PACKAGE.
    MOVE-CORRESPONDING DATA_PACKAGE TO T_DATA.
    Refresh lt_BI0_PCUSTOMER.
    select * from /BI0/PCUSTOMER into TABLE lt_BI0_PCUSTOMER
    WHERE CUSTOMER = T_DATA-SOLD_TO.
    Read table lt_BI0_PCUSTOMER WITH KEY CUSTOMER = T_DATA-SOLD_TO.
    IF sy-subrc EQ 0.
    LOOP AT lt_BI0_PCUSTOMER.
    IF lt_BI0_PCUSTOMER-AREA= '01' or
    lt_BI0_PCUSTOMER-GROUP = 'J001'.
    DELETE T_DATA.
    APPEND T_DATA.
    endif.
    ENDLOOP.
    ENDIF.
    ENDLOOP.
    DATA_PACKAGE[] = T_DATA[].
    * Delete data package when Plant EQ INDIA
    DELETE DATA_PACKAGE WHERE PLANT = 'INDIA'.
    thanks
    Edited by: Bhat Vaidya on Oct 19, 2010 8:41 AM
    Edited by: Thomas Zloch on Oct 19, 2010 9:55 AM

    Hi,
    DELETE DATA_PACKAGE WHERE PLANT = 'INDIA'.
    Above syntax for delete data from internal table
    For deleting the database table write statement as follows
    DELETE From DATA_PACKAGE WHERE PLANT = 'INDIA'
    Your are missing the from keyword from statement.
    What could i have understand, if it is your solution of Query.
    Exactly you want to delete data from database table or internal table ?

  • Start routine update rules

    Hi Gurus,
    We are nw04s BI SP10 and I've completely implemented Note 981194.  I can't seem to get my start routine update rules to convert using Transformation Erzeugen.  I tried several scenarios, and still no success.
    If somebody has code for BI 7 transformation start routine for datasources 2LIS_03_BX, BF and UM to the 0IC_C03 cube, I would greatly appreciate an email to [email protected] .  Points will be assigned.  I can cut/paste the routines from the update rules, I just need the start routines.
    Kind Regards,
    Alex

    Alex
    Don't trust the converter - you have to check it all from end to end anyway so might as well do it manually.
    I did the whole of _BF yesterday.
    Here's the start routine. 
    *<2004s code>
        field-symbols:
               <fs_SOURCE_PACKAGE> type tys_sc_1.
    only movements from to evaluated stocks are concerned
    if stock-category is not intitial -> Delete from data-packag
    or Header of generic article      -> Delete from data-packag
        loop at SOURCE_PACKAGE assigning <fs_SOURCE_PACKAGE>.
          if not <fs_SOURCE_PACKAGE>-bsttyp is initial
          or ( <fs_SOURCE_PACKAGE>-bwvorg = '450' and
               <fs_SOURCE_PACKAGE>-bwapplnm = 'IS-R' ) .
            delete SOURCE_PACKAGE.
          endif.
        endloop.
    *</2004s code>
    Cheers
    Guy

  • How do i get at the data in the data package of the start routine

    I have some very simple code in my start routine but it says data-package is not a table but it is SAP code that defines it this way.  here is my code
    SELECT DOC_NUM S_ORD_ITM CH_ON CREATEDON INTO TABLE T_ORD_BKG_DATA
    FROM DATA_PACKAGE.

    Hi,
    The data package is not a DB table, but an internal table.
    You will have to use a LOOP statement to get at all data :
        LOOP AT SOURCE_PACKAGE INTO w_SOURCE_PACKAGE.
          IF w_SOURCE_PACKAGE-myField = '98'.
          something to do
          ENDIF.
        ENDLOOP. " SOURCE_PACKAGE
    Hope that helps.
    Dieu

  • Convert ABAP code in start routine/update rule to transform. start routine

    Dear BW ABAPers,
    I have created a custom purchasing info cube (YCP_PURC1) based on 0CP_PURC1 standard cube. I would like to convert this new data flow to BI7 (from 3.x), and convert the standard update rule to transformation. I would need to rewrite the below start routine from the standard update rule to a start routine ABAP code in the newly created  transformation / start routine. My ABAP knowledge is limited. Will you please help?
    *this is the start routine from the update rule. As a side note, the data source is 2LIS_02_SCL.
    LOOP AT SOURCE_PACKAGE.
        IF (     SOURCE_PACKAGE-cppvlc  EQ 0
             AND SOURCE_PACKAGE-cppvoc  EQ 0
             AND SOURCE_PACKAGE-cpquaou EQ 0 ).
          DELETE SOURCE_PACKAGE.
          CONTINUE.
        ENDIF.
    no_scl is initial ( e.g. for good receipts, billing)
    value has to be set depending on storno
        IF SOURCE_PACKAGE-no_scl IS INITIAL.
          IF SOURCE_PACKAGE-storno = 'X'.
            SOURCE_PACKAGE-no_scl = -1.
          ELSE.
            SOURCE_PACKAGE-no_scl = 1.
          ENDIF.
          MODIFY SOURCE_PACKAGE.
        ENDIF.
      ENDLOOP.
    if abort is not equal zero, the update process will be canceled
      ABORT = 0.
    Many thanks and look forward to your kind feedback.
    Kind regards,
    Csaba

    Dear All, Durgesh,
    thanks to you all for your valuable input. Mainly the ABAP part was more interesting for me.
    Durgesh, thanks for your input, it was useful. I just had to change the info objects to data source fields and add the lines before the loop:
    DATA: I_PACKAGE TYPE TYT_SC_1.
        FIELD-SYMBOLS <i_package> TYPE tys_sc_1.
        I_PACKAGE[] = SOURCE_PACKAGE[].
        LOOP AT SOURCE_PACKAGE assigning <i_package>.
          IF ( <i_package>-BWGEO EQ 0
          AND <i_package>-BWGEOO EQ 0
          AND <i_package>-BWMNG EQ 0 ).
            DELETE SOURCE_PACKAGE index sy-tabix.
            CONTINUE.
          ENDIF.
    no_scl is initial ( e.g. for good receipts, billing)
    value has to be set depending on storno
          IF <i_package>-NOSCL IS INITIAL.
            IF <i_package>-ROCANCEL = 'X'.
              <i_package>-NOSCL = -1.
            ELSE.
              <i_package>-NOSCL = 1.
            ENDIF.
          ENDIF.
        ENDLOOP.
    Points have been assigned accordingly.
    Thanks,
    Csaba

  • Language :SMLT:delete unimported packages entry

    Hi Exceprt ,
    In language installation using SMLT ,how to delete entry under "imported packages " in SMLT
    The reason why we want to delete this is ,we had wrongly strarted language with cd of NW04 but then canceled the job in system ,deleted the job and done with SRM cd 's
    Now this enrty of unimported package is present in system . Though there is no harm keeping that entry there but it does not look good to give this to customer
    Thanks in advnace
    -Ganesh

    Hi,
    Though this is old post, hope you wiill reply.
    How did you solve this.
    I am also facing same issue. Language import was aborted in middle and want to remove the entries.

  • Start Routine / Update Rule ABAP

    Hello Gurus
    I am trying to write the code to do the following but I am not getting very far:
    Two parts:
    Load from DSO1 to Cube1
    Only when DSO1-Product also exists in DSO2
    Also lookup a field, FIELD1, from DSO2 which is not in DSO1, but is in DSO2 (based on Product which exists in all three)
    There may be more than one FIELD1 per Product.
    Any help appreciated.
    NB I am in 3.5

    okay , here is how it can be done..
    Step 1:Create an Internal table for SOURE_PACKAGE, DSO2
    Step2: populate the data in the internal table of DSO1 & DSO2
    Step3: create a type to store the list of products and the list of additional fields present in DSO2. move the entries to this table from DSO2.
    Step4: create a range that stores the list of products present
    Loop at IT_Source_package
    delete source  where product = range
    move corresponding values from type table to IT_source_package
    Endloop.
    Append IT_Source_Package to Source_Package
    hope this helps.
    Srivatsan.S

  • Process: Start Routine, Delta, Update Rules

    Hi SDN,
    Can someone point to detailed discussion on the events related to loading, such as:
    Start Routine is exectued before each data package, or entire load?
    Update rules are applied row by row or the entire KYF column in a data package is processed first?
    When is delta determined, before Start Routine is executed, or, after it is executed, and before update rules are applied? This is important to know if we are dropping records from the data package.
    If you have the answers, would love to hear and appreciate.
    Thanks.
    Saf.
    P.S. I always award points.

    Thanks Farhan,
    If you don't mind, can you outline how delta is determined, between ODS and ODS and ODS and Infocube. If I am correct, records in the sender object are marked as sent. Can I look at the field where the flag is?
    Also, you are saying that only those records make up the data package which are new, in case of a delta load. That means, if there were no new records, Start Routine would not even execute, or it still will but do not have any records processed?
    I already awarded the points.
    Thanks.
    Saf.

  • Reason for Error in Manual Update of Data Package

    Hey,
         Sometimes while loading huge amount of data, one of the data package doesnt get uploaded. For those data packages we do a manual update of the data package and it works well.
       My question is why do we get this error,
    Is it to do with the system contention or any IDOC issue?
    Please help me out to find the root cause of this, so that we can avoid the manual update of the data packges.

    We usually get this issue , when we are doing a lot of processing in the Update Rules. The Data package processing gets timed out.
    If it is happening very often then you would need to sit with your Basis person and modify the Timeout settings for your system.

  • Diff between Start ,transfer,update routines

    hi
    Plz tell me what is the difference between Start routine,transfer routine and update routine. Send me some real time examples.I would be very glad.
    Regards
    Ajay

    Hi!
    it is simple all of them are small program used in ETL process while loading in to BW.
        <b>Start routine:-</b> is used in Transfer rules and update rules, this abap code is  executed before starting the load and used in scenarios where we want to perform some operations on all the data example deleting some records before processing records in Update rules or transfer rules.
    <b>Update routine:-</b> abap code used in update rules to transform or finding some field. ex:- may be you want to retrieve the field data from some data base tables based on the other data present in the infosource
    <b>Transfer Routine:-</b> similar to the update routine but used in transfer rules.
    with regards
    ashwin
    <i>PS n: Assigning point to the helpful answers is the way of saying thanks in SDN.  you can assign points by clicking on the appropriate radio button displayed next to the answers for your question. yellow for 2, green for 6 points(2)and blue for 10 points and to close the question and marked as problem solved. closing the threads which has a solution will help the members to deal with open issues with out wasting time on problems which has a solution and also to the people who encounter the same porblem in future. This is just to give you information as you are a new user.</i>

  • Date to Calendar Week in Update Rules

    Hi Experts,
    Does anyone of you know how/where BI/BW do the mapping when translating date in to a week in update rules?
    Thanks in advance,
    Rose

    Hi Kazmi and Ram,
    In Update Rules, in Time Ref tab, we can specify the source field e.g. posting date,  to get the calendar Year/Week time characteristics.   My question is where does the update rule get the week basing on the source date?
    This question is brought up to me because week days can be different from country to country.  e.g. in US  it is sunday to saturday and in Norway it is Monday to sunday.  If we do reporting that consolidates data from US and Norway and probably and use week as part of that report, then we have an issue.
    Can you please let me know how then the update rules mapped the date to week.  If you have similar issues, can  you please let me know how you address it?
    Best Regards,
    Rose

  • Update Rule 8ZCDSDS03 and 80CDS_DS07 for data mart

    Hello Guru´s
    My proble is this
    8ZCDSDS03 Update rules to Data marts for cube 0SD_C03
    80CDS_DS07 Update rules to Data marts for cube 0SD_C11
    are in gray i don´t know why. do you have and explanation or a solution for that.
    whit best regards
    agt

    Hi Antonio,
    Any time you make a change to a cube, check the update rules feeding it and activate them. Also check if this InfoCube is supplying data to other data targets and check the 8* update rules and activate if required.
    Right now you can double click the grey rules and activate them and transport the active rules (if required)
    Hope this helps...

  • Using "Master Data Attribute of" in the Update Rule

    Hi,
    In my update rule of, i want to replace the master data attribute of my characteristic instead of using its source characteristic. For example. <i>InfoObject ZSTORECODE</i> has an attribute <i>ZSTORENAME</i>. My objective is to use the Store Name instead of a Store Code.
    I initially thought of using <i>"Master Data Attribute of"</i> in the update rules. However, I always end of with having an error of <i>"No Values."
    </i>
    Hope you guys can help me with this!
    Thanks,
    Raomon

    DATA: V_NSTC_SN2,
    V_KFC_COSTC LIKE RSGENERAL-CHAVL.
    V_KFC_COSTC = DATA_PACKAGE-KFC_COSTC.
    CALL FUNCTION 'RSAU_READ_MASTER_DATA'
        EXPORTING
          I_IOBJNM                      = 'KFC_COSTC'
          I_CHAVL                       = V_KFC_COSTC
    *   I_T_CHAVL                     =
    *   I_DATE                        =
    *   I_FLG_WHOLE_TABLE             =
          I_ATTRNM                      = 'NSTC_SN2'
      IMPORTING
    *   E_STRUCTURE                   =
    *   E_TABLE                       =
          E_ATTRVAL                     = V_NSTC_SN2
        EXCEPTIONS
          READ_ERROR                    = 1
          NO_SUCH_ATTRIBUTE             = 2
          WRONG_IMPORT_PARAMETERS       = 3
          CHAVL_NOT_FOUND               = 4
          OTHERS                        = 5
    RESULT = V_NSTC_SN2.
    Another Example Code:
    index on infoObject

  • Update Rule Timestamp to mutiple data targets show serial processing

    All,
       I just noticed something very strange.  One of our ODS has two infocubes as data targets.  What I observed is that even though there are mutiple work processes spawned to process multiple data packets to the cubes the update rule is processed serially within each of them to the targets.
    In turn I am saying that within EACH data packet updates data to the different targets serially.  Is it true or is there any RSADMIN paremeter for this to make it go parallel?
    Source
    |
    |Packet 1Update Rule ACube AUpdate Rule B--Cube B
    |    
    |Packet 2Update Rule ACube AUpdate Rule B--Cube B
    |
    |Packet 3Update Rule ACube AUpdate Rule B--Cube B
    |
    |
    |....
    Thanks

    Assuming that it does it (and there is no way around)..
    It is not really that much of inefficiency. You have a fixed amount of resources (CPU, DBMS, memory) which is flexibly distributed at two levels already (work processes, data packets in parallel); introducing a third level might make it complex without bringing much benefits.

  • Problem in a update rule BW 3.X

    Hi, i have data in a ODS, and i want to pass these data to another ODS
    In the update rule, i have two datapackages. The first package contains 70000 registers and the second 50000 registers.
    In my start routine i have a counter variable , this variable gives me the max id of the active data in the table of the ods,  it takes the 7000 value, but if i want the 7001 value , the variable gives me 1, because of the parallel of two packages.
    How can i make the init delta from a ods to other ods in update rule, so the two data packages run secuencially
    Thanks
    Reward POints

    a

Maybe you are looking for

  • Time Machine, Hard Drive, AirPort Extreme, and possible damage?

    I plugged in an external HD to my AirPort Extreme (gigabit) base station today and started a Time Machine backup to it. After about 8 hours, I had transferred only 12 gigs of my 46 and ended up stopping it. I realize only the initial backup should ta

  • In a query, for the selection field 'KNB1-ZWELS' a match-code isn't availab

    Hi All, Creating a query, for the selection field 'KNB1-ZWELS' a match-code isn't available. Could anyone tell me the reason? Thanks Gandalf

  • Auto complete duplicate last name

    I am using Mail (4.2) on Snow Leopard (10.6.2) with a single email account on Exchange 2007. My address book is sync'd with Exchange (250 entries) and 2 entries in the "on my Mac" address book. for many of my most commonly used addresses (in the comp

  • DeliveryManager API issue

    Hi, I am trying to use the DeliveryManager API for printing from my customised application. The code what I am using is as follows: // create delivery manager instance DeliveryManager dm = new DeliveryManager(); // create a delivery request DeliveryR

  • OIM 11g AD Connector Access Policy Based Provisioning Issue

    Hi, I created Approval Policy for Access Policy Based Provisioning request type for request level (autoapproval) and operational level (used standart beneficiaryManagerApproval process), but when the resource must assigned to User,- throws exception