BI 7 Delete in Start routine

Hi,
I want to write start routine in BI 7 transformation to delete records.
Can somobody please tell me eaxct command to delete records.
Thanks
Shilpa

Hi
go to start routine and write in the global area
delete data_package where field name equal to (=,eq) or not equal to (ne) value.
lets say field name is X and value ab.and i want to delte records where x = ab
then the delete statement will be
delete data_package where x = 'ab'.
but if asked to delte x = ab, zb,cv and so on
delete data_package where x = 'ab',
                    and   x = 'zb',
                    and   x = 'cv'.  
only if the value is alphanumeric or jst alphabets it comes betwnn single quotes ' '.
else if its number value it comes directly widut single quotes
equal to can be wrten in two ways = and eq and
not equal is ne.
there will be a fullstop at the end of the delete statement
hope it helps asign points if aplicable
thanks
puneet
Message was edited by:
        Puneet Chawla

Similar Messages

  • How can I replace a start routine

    Hi Friends,
    I am filtering out source data where VALIDTO < SY-DATUM & VALIDFROM > SY-DATUM in a TRFN - start routine
    DELETE SOURCE_PACKAGE WHERE VALIDTO < SY-DATUM OR VALIDFROM > SY-DATUM.
    I want to delete this start routine, and make this filter condition in DTP level. How can I do this?
    Thanks & regards
    Ramesh

    are you sure you are in the right forum ?
    This is for Business Objects product  and your question make no sense in that context

  • Deleting  rows with missing values in field in start routine of update rule

    Hello experts,
    how can I delet rows with missing values in a specific field in the start routine of update rules?
    I think ABAP code should look something like this:
    delete ...  from DATA_PACKAGE where Z_NO = ''.
    thanks in advance for any suggestions!
    hiza

    Write:
    delete data_package where field = value.
    Hope it helps.
    Regards

  • ABAP code in start routine (delete no in)

    In my start routine, I would like to delete some data package whose employee id is not in the selection list.
    but there are some ABAP grammer error in the where condition. Can somebody help this? I tried to read the document for 'WHERE - IN seltab', but still I could not give the right code.
    <p>
      employeeid_itab type table of string.
      select /bic/zpe_employeeid into table employeeid_itab from /bic/pzpe_employeeid.
      DELETE SOURCE_PACKAGE where ZEMP_employee_ID NOT IN employeeid_itab.
    It seems that internal table employeeid_itab could not be directly used after the IN keyword.
    how can I do this?
    Edited by: Ben Li on Feb 22, 2008 2:09 PM

    Hi Oscar,
          Actually I had tried this before, using the code like the following,
          <p>
    Types: EmployeeID(7) type  c.
    <p>
    data: sel_itab type  range of EmployeeID.
    <p>
    select /bic/zpe_employeeid into table sel_itab from /bic/pzpe_employeeid.
    <p>
    delete SOURCE_PACKAGE where zemp_employee_id  not in sel_itab.
    <p>
         The grammer check is OK, but when I debug it, I found that there are records in sel_itab, but all the records just have one charactor, actually, my employeeID have 7 charactors in database. So it does not work, I think I miss something in define  of the range table. Can you please figure out? Thanks a lot.

  • Start Routine logic to delete records which do not satisfy a condition

    Hello,
    Iam trying to code a start routine to delete the records from the source_package if a certain set of conditions are not met.
    It is failing at the last statement.
    Pls help.
    Thanks
    Jagadish
    code is as follows..
    LOOP AT SOURCE_PACKAGE assigning <SOURCE_FIELDS>.
    IF not (
    ( <SOURCE_FIELDS>-/BIC/ZCLSD_DT BETWEEN <SOURCE_FIELDS>-/BIC/ZWEEKOF
    AND <SOURCE_FIELDS>-/BIC/ZNONWKOF )
      AND
      ( <SOURCE_FIELDS>-/BIC/ZCLSD_DT IS  INITIAL )
    DELETE SOURCE_PACKAGE FROM <SOURCE_FIELDS>.
    (is failing at the delete statement.)
    ENDIF.
    ENDLOOP.

    Thanks Pratap,
    I used an internal table to load the records and used a delete statement out side the LOOP.
    By using a Work Area assignment instead of the Source_fields, The delete statement is giving me an error saying "Conversion of Numeric Value to type Object is not valid".
    Here is the code I have modified...
       TYPES: BEGIN OF LINE,
                WO(6) type c,
              END OF LINE.
       DATA: WA TYPE LINE,
             ITAB TYPE TABLE OF LINE.
    LOOP AT SOURCE_PACKAGE assigning <SOURCE_FIELDS>.
    IF NOT (
    ( <SOURCE_FIELDS>-/BIC/ZCLSD_DT BETWEEN <SOURCE_FIELDS>-/BIC/ZWEEKOF
        AND <SOURCE_FIELDS>-/BIC/ZNONWKOF
      AND
      <SOURCE_FIELDS>-/BIC/ZAPRD_DT IS NOT initial )
    Append <SOURCE_FIELDS>-/BIC/ZWO_NBR to itab.
    ENDIF.
    ENDLOOP.
    loop at itab into WA.
    DELETE SOURCE_PACKAGE where /bic/ZWO_NBR = WA-wo.
    endloop.

  • Start routine: DELETE VARIABLE DOES NOT EXIST

    Dear Friends,
    I have written the below code in the start routine.
    LOOP AT DATA_PACKAGE.
    IF DATA_PACKAGE-/BIC/ZSREGIO <> AMR.
    DELETE DATA_PACKAGE.
    ENDIF.
    ENDLOOP.
    when i check for syntax errors, it gives message Delete variable does not exist.
    Need your earliest help.
    Kind Regards
    Paddy

    hi Paddy,
    seems we forget quote
    DELETE DATA_PACKAGE WHERE /BIC/ZSREGIO <> 'AMR'.
    where did you put the code ?
    there is 'insert your code here ...', put your code after that line.
    if you are using BI 7.0, use source_package :
          MONITOR_REC     TYPE rstmonitor.
    $$ begin of routine - insert your code only below this line        -
    ... "insert your code here
    DELETE SOURCE_PACKAGE WHERE /BIC/ZSREGIO <> 'AMR'.
    hope this helps.

  • Deleting records in start routine

    Dear Experts,
    We have infoObject ZCADRE which stotes list of all trainees. Cube ZCUBE_01 contains transactional data
    of all the employees. Now, there is a transformation between cube ZCUBE_01 and cube ZCUBE_02.
    Requirement is cube ZCUBE_C02 will be loaded with transactional data of only those employees who are
    present in infoobject ZCADRE.
    So, basically we need to write codes for selective deletion in the start routine.
    ZCADRE has following records:-
    ZCADRE     BATCH
    ======     =====
    1111       2005
    2222       2008
    3333       2007
    ZCUBE_01 has following records:-
    employee     actiontype     calday          actcnt
    1111          Z1          01.03.2011     1
    2222          Z1          01.04.2011     1
    3333          Z2          01.06.2011     1
    4444          Z3          01.02.2011     1
    5555          Z1          01.04.2011     1
    6666          Z2          01.03.2011     1     
    After the data loading from cube ZCUBE_01 to ZCUBE_02, ZCUBE_02 should have the following records:-
    employee     actiontype     calday          actcnt
    1111          Z1          01.03.2011     1
    2222          Z1          01.04.2011     1
    3333          Z2          01.06.2011     1               
    Please suggest codes for the same.
    Your help will be appreciated.
    Regards,
    Prakash

    Thanks Rahul, for your quick response. The logic for codes that you have suggested is giving following error:-
    E:In the OO context either an INTO or an ASSIGNING specification or the
    addition "TRANSPORTING NO FIELDS" must be used. addition "TRANSPORTING
    NO FIELDS" must be used.  and "  E:Tables with headers are no longer supported in the OO context.
    I was using following codes:-
    =============================================================================
    DATA: wa_zcadre TYPE standard table of /bic/pzcadre with header line, idx type sy-tabix.
    SELECT * FROM /bic/pzcadre INTO table wa_zcadre.
    sort wa_zcadre by zcadre.
    LOOP AT SOURCE_PACKAGE.
    idx = sy-tabix.
    read table wa_zcadre with key zcadre = SOURCE_PACKAGE-employee binary search.
    if sy-subrc <> 0.
    DELETE SOURCE_PACKAGE index idx.
    ENDIF.
    ENDLOOP.
    ===============================================================================================
    Following codes solved my problem:-
    ===============================================================================================
    DATA: idx type sy-tabix.
    DATA: wa_source_package type tys_sc_1.
    DATA: ZCADRE TYPE /BIC/PZCADRE-/BIC/ZCADRE.
    LOOP AT SOURCE_PACKAGE into wa_SOURCE_PACKAGE.
    CLEAR : ZCADRE.
    SELECT SINGLE /BIC/ZCADRE FROM /BIC/PZCADRE INTO ZCADRE WHERE
      /BIC/ZCADRE = WA_SOURCE_PACKAGE-EMPLOYEE.
    idx = sy-tabix.
    if sy-subrc <> 0.
    DELETE SOURCE_PACKAGE index idx.
    endif
    ENDLOOP.
    ===========================================================================================
    Regards,
    Prakash

  • How-to retrieve deleted start routine

    Hi!
    I have written a start routine in an update rule for a data mart. This update rule was overwritten while the export data source of the related info cube was created again (during this the system automatically creates and activates a new update rule). My start routine within this update rule is lost.
    Since this was happening in the development system I found the name (D8FOPYTRYTBF836EXIMLM2MGA) of the routine in the related transport order.
    Does anyone know how to show this routine/object/program in an editor or how to rescue the code of the routine? Is there a possibility by any means (SE38 dont work)?
    Any help highly appreciated and rewarded.
    Best Regards,
    Volker

    try to search in  RSAABAP , RSAROUT and RSUPDROUT tables..
    If you don't find.. you can transport that request to quality system(retrive the code and delete this request from transport buffer.. no need to transport prod!) and again create another request with new changes and transport to Q and then to Prod

  • Start routine code for deleting records in different language

    Hello,
    can someone please specify the exact code to be used in start routine, and whre exactly it needs to be pasted?
    this code is needed for master data notifaction type which is loaded for both languages German and English.
    german records are to be avoided.
    thanks,

    Ciao Claudio,
    this issue about languages selection is an old situation...
    The problem is that language selection is not possible, even if you have this field checked for selection !!!
    Look at OSS Note 324684...
    "If a field of a DataSource - typically with field name 'LANGU' or 'SPRAS' - is assigned to InfoObject '0langu', the field is not provided in the selection fields although the field actually can be selected. In this case, all languages of the language vector active in the BW System are requested by the source system but the language selection cannot be defined in the Scheduler.
    A precondition is that the language field of the DataSource in the source system is maintained as selection field. This setting is done in Transaction RSA6 (or RSO2 for customer developments)."
    Bye,
    Roberto

  • How do you identify the Logical system in start routine of a transformation

    My scenario is this.  I have five r3 systems that I am extracting from.   In the start routine of the transformation from the r3 data source to my data store I  am going to delete data and I need to know the source system id.    How do I identify the logical system or source system id in the transformation.  Is there a system field that contains this information.    I do not want to hard code the source system id in the routine.

    hi
    have a lool at tables rsreqdone and rsbkrequest with a join you should be able to determine the source.
    regards
    Boujema
    How to give points: Mark your thread as a question while creating it. In the answers you get, you can assign the points by clicking on the stars to the left. You also get a point yourself for rewarding (one per thread).
    Edited by: Boujema Bouhazama on May 9, 2008 12:04 AM

  • How to add new records in Start routine or end routine.

    Hi All,
            My requirement is to transfer data from one DSO to anothe DSO. But while transfering a single record frorm DSO1 i want to add 7 records to DSO2 for each record in DSO1 with slight change in data( with a different key). I want to do it in start routine or end routine. How can i do it. If you have any ABAP code for this then please send.
    Regards
    Amlan

    you can use this code, replace the fields where i have marked with <>.
    DATA : WA_RESULT_PACKAGE TYPE DSO2,
           WA_RESULT_PACKAGE1 LIKE WA_RESULT_PACKAGE.
    DATA : IT_RESULT_PACKAGE LIKE TABLE OF WA_RESULT_PACKAGE.
    DATA : DATE1 TYPE SY-DATUM.
    DATA : DAYDIFF TYPE i.
    DATA : RECORD_NO type rsarecord.
    SORT RESULT_PACKAGE BY <KEY FIELDS> "specify the key fields here
    RECORD_NO = 1.
    LOOP AT RESULT_PACKAGE INTO WA_RESULT_PACKAGE.
         IF WA_RESULT_PACKAGE_1-<KEYFIELDS> NE WA_RESULT_PACKAGE-<KEYFIELDS>.
              WA_RESULT_PACKAGE_1 = WA_RESULT_PACKAGE.
              DAYDIFF = WA_RESULT_PACKAGE-ENDDATE - WA_RESULT_PACKAGE-STARTDATE.
                   WHILE DAYDIFF NE 0.
                        DATE1 = WA_RESULT_PACKAGE-STARTDATE + DAYDIFF.
                        MOVE DATE1 TO WA_RESULT_PACKAGE-<KEYFIELDDATE>.
                        MOVE RECORD_NO TO WA_RESULT_PACKAGE-RECORD.
                        APPEND WA_RESULT_PACKAGE INTO IT_RESULT_PACKAGE.
                        DAYDIFF = DAYDIFF - 1.
                        RECORD_NO = RECORD_NO + 1.
                        CLEAR DATE1.
                   ENDWHILE.
              CLEAR DAYDIFF.
         ENDIF.
    ENDLOOP.
    DELETE RESULT_PACKAGE[].
    RESULT_PACKAGE[] = IT_RESULT_PACKAGE[].
    Reg Point 3.
    The Key figures will then show up in the report aggregated.Hope that is fine with you.
    Note:
    Before loading data, in DTP set the semantic key with the key field of the DSO1.This brings all the similar data w.r.t the key fields from the PSA together in a single package.
    rgds, Ghuru

  • How to write a start routine in the trasnformations ?

    Hi Experts,
    I am working on BI 7, As I want to write a start routine in transformations of 0FIGL_O02 DSO, to allow the GL accounts with cost center data. Already there is a delete statement please find.
    *DELETE SOURCE_PACKAGE where BAL_FLAG = 'X'. I had made comment to allow the G/L accounts. since I have some GL Accounts which does'nt have the cost center data, so in this case I have to write a ABAP code to allow this G/L accounts with cost center data.
    So Let me know if anyone can help me how to write the ABAP code in the start routine.
    Thanks
    sekhar

    Hi,
                Yopu can write the below lines of code adn try
        SORT source_package BY Receive nr  Type ASCENDING.
        DELETE ADJACENT DUPLICATES FROM source_package COMPARING Receive nr  Type.
    But you should make sure which record of the either rows need to deleted
    i.e in
    F9001;LU;J001;662;
    F9001;LU;J002;662
    You need to decide to eliminate 1st or 2nd one.(depends on your requirement)

  • Start routine error ....,

    Hi
    i written start routine in transformations. it showing some error. please suggest correct way.
    TYPES : begin of fs_pctr,
                  profit_ctr type /BIC/PZPRFTCTR-/BIC/ZPRFTCTR,
                 end of fs_pctr.
    DATA : it_pctr type standard table of fs_pctr,
                wa_pctr like line of it_pctr.
    select /BIC/ZPRFTCTR from /BIC/PZPRFTCTR into table it_pctr where objvers  = 'A'.
    loop at source_package assigning <source_fields>.
    read table it_pctr with key profit_ctr = <source_fields>-/BIC/ZPRFTCTR.
       if sy-subrc ne 0.
        delete source_package.
       endif.
    endloop.
    Error: E:In the OO context either an INTO or an ASSIGNING specification or the         
    addition "TRANSPORTING NO FIELDS" must be used. addition "TRANSPORTING          
    NO FIELDS" must be used.
    waiting for suggestions.
    Regrds
    swetha

    Hi,
    you can work around with the code as below... this would be much faster as you are deleting transaction data based on some master. so looping master is lesser and deleting transaction in that is faster.
    Declaration
    - internal table is correct but for work area declare as under
    data wa_pctr type fs_pctr.
    after select statement
    loop at it_pctr into wa_Pctr.
    delete source_package where /bic/zprftctr = wa_pctr-profit_ctr
    endloop.
    Hope this helps.
    Regards
    Raj

  • How to write the start routine in the transformations ?

    Hi Experts,
    I am working on BI 7, As I want to write a start routine in transformations of 0FIGL_O02 DSO, to allow the GL accounts with cost center data. Already there is a delete statement please find.
    *DELETE SOURCE_PACKAGE where BAL_FLAG = 'X'. I had made comment to allow the G/L accounts. since I have some GL Accounts which does'nt have the cost center data, so in this case I have to write a ABAP code to allow this G/L accounts with cost center data.
    So Let me know if anyone can help me how to write the ABAP code in the start routine.
    Thanks
    sekhar

    Hi Experts,
    I am working on BI 7, As I want to write a start routine in transformations of 0FIGL_O02 DSO, to allow the GL accounts with cost center data. Already there is a delete statement please find.
    *DELETE SOURCE_PACKAGE where BAL_FLAG = 'X'. I had made comment to allow the G/L accounts. since I have some GL Accounts which does'nt have the cost center data, so in this case I have to write a ABAP code to allow this G/L accounts with cost center data.
    So Let me know if anyone can help me how to write the ABAP code in the start routine.
    Thanks
    sekhar

  • The field "SOURCE_PACKAGE" is unknown IN THE START ROUTINE?

    Hi all,
    i am trying to create a start routine in the DTP FROM THE CUBE TO THE OPEN HUB.
    But when i check the syntax : it throws me an error message stating.
    The field "SOURCE_PACKAGE" is unknown IN THE START ROUTINE?
    how come the source package is unknow in the start routine can anyone pls advise  me on this!!
    DATA: l_tabix TYPE sy-tabix, wa_source_package TYPE tys_sc_1.
    LOOP AT SOURCE_PACKAGE INTO wa_source_package.
    l_tabix = sy-tabix.
    IF wa_source_package-SALES EMP EQ ' '.
    DELETE SOURCE_PACKAGE
    WHERE SALESEMP EQ ' '.
    INDEX l_tabix.
    ENDIF.
    ENDLOOP.

    Hi Pooja,
    I think that the error comes from the delete statement.
    As you already said, the SOURCE_PACKAGE is from BI7.0. That means that the LOOP AT statement cannot be wrong (although I prefer field-symbols)
    I would restate you code like below:
    DATA: l_tabix TYPE sy-tabix,
          wa_source_package TYPE _ty_s_sc_1.
    LOOP AT SOURCE_PACKAGE ASSIGNING <source_fields>.     "<source_fields> is declared as line from source_package
    * l_tabix = sy-tabix.
      IF <source_fields>-SALES_EMP IS INITIAL.
        DELETE <source_fields> FROM SOURCE_PACKAGE.
    * If this line does not work, try to add TABLE after the FROM-statement
    *WHERE SALESEMP EQ ' '.
    *INDEX l_tabix.
      ENDIF.
    ENDLOOP.
    Hopefully this will help.
    Alternatively you can try a single statement, because it is not necessary to do a loop.
    DELETE SOURCE_PACKAGE WHERE sales_emp IS INITIAL.
    Good luck!
    Steven Groot
    Edited by: S. Groot on Aug 11, 2010 7:50 AM

Maybe you are looking for

  • Why can't I use my Apple ID to activate FaceTime or iMessage?

    NOTE: The following discusses FaceTime and iMessage in general, not just for Mac. The weirdest things are happening. I just bought my iPad mini, and I can't log in to use FaceTime or iMessage. At one point, it would let me activate my account, but it

  • Oracle 8.1.5 Invalid Staging Area Error

    I get an error message: Invalid staging area. There is no top level components for Windows NT available for installing from this staging area. I installed this version successfully running win98, but i get this error with XP. I tried renaming the sym

  • Screenshots save as png not pdf

    Screenshots (using shift+apple+4) save as png files instead of pdf. Png blows; they're fuzzy, unreadable and generally makes the handiness of screenshot a waste of time Someone suggested using the new GRAB feature but it's no better. Anyone know how

  • Orf raw files

    I found a few hints here and I've done everything suggested and still not able to read .orf files. I am using Windows 7 64 bit and Photoshop CS3. (I am holding out for CS6) I downloaded the latest ACR and no go. I downloaded v 4.3.1  (as suggested in

  • Problem Accessing Application Express

    Hi All, I have installed Oracle 11g and Apex 3.2. After that I tried to access apex admin console using url: http://server:8080/apex/apex_admin If I try to open the page with IE and when used id : admin and its password is entered and pressed login,