Removing entries in the table

Hi,
I need to delete entries in the table ,those may be anywhere between 1 to several thousand. If  I want to delete for every hundred records how could it be coded.
Thanks,
Kranthi.

Here is a sample program which shows how to delete from a database table 100 records at a time. 
report zrich_0001.
data: itest type table of ztest with header line.
data: itest2 type table of ztest with header line.
data: index type i.
* Get all the records that you want to delete
clear itest. refresh itest.
select * from ztest
      into corresponding fields of table itest
                    where mtart = 'ZNBW'.
* Loop untill the first itab is empty, move 100 records * at a time into the second itab, then delete from that
* second itab.
while not itest[] is initial.
  clear index.
  loop at itest.
    index  = index + 1.
    check index <= 100.
    move-corresponding itest to itest2.
    append itest2.
    delete itest.
  endloop.
delete ztest from table itest2.
endwhile.
Regards,
Rich Heilman

Similar Messages

  • CUA:  Wrong entries in the table USZBVSYS

    Hi All,
    While searching a particular user access to the child systems via SUIM - > Users by system, the report given output that the user have access to so and so system. Whereas that user already deleted and there is no user account in CUA and the respective child system.
    When i search in the table USZBVSYS, that user having a entry to that child system with status S.
    May be due to some old IDOC get processed and made an entry in this table but physical the changes were not made either in CUA or in child system.
    Now my concern is how to delete such type of entries in the table USZBVSYS?
    SAP recommended not to use the report RSUSR_CUA_CLEANUP_USZBVSYS and i think it can be resolve only by manually method to create and delete.
    Kindly let me know you opinion pls.

    Hi,
    RSUSR_CUA_CLEANUP_USZBVSYS cannot work in this case, as you have 'S'-entries for the user section  in uszbvsys. The report will clean up only entries with D,A or X entry for the user entry.
    So there seems to be no automated standard report for your query.
    I suggest to collect the user-IDs you need to remove, copy them into SU10, recreate them for the required systems and delete them
    afterwards again.
    Make sure, that nobody processes cua-idocs manually in any of your systems of the cua. Only use scul.
    b.rgds, Bernhard

  • How to find latest entry in the table according to time

    how to find latest entry in the table according to the time
    is there any function module to do so
    \[removed by moderator\]
    Regards
    Shashi
    Edited by: Jan Stallkamp on Aug 25, 2008 4:39 PM

    Hi,
    If you want to read the entry from an internal table,
    sort the internal table in the descending order by the time and
    delete adjacent duplicates by comparing the fields other than time and the internal table will have the latest record.
    Suggestion: instead of only time try to have one more field called date with the time combination
    Regards,
    Ramesh

  • Transporting the entries of the table TSTCT

    Dear All,
    Is there a way to transport the entries of the table TSTCT.
    I've tried the procedure specified in the below link, but it is not working for the T*  tables.
    <link to blocked site removed by moderator>
    Please suggest if there is a way.
    Thanks,
    Naveen
    Edited by: Thomas Zloch on Feb 6, 2012

    HI ,
    Check this [Thread|transport system objects i.e. contents of table t100 from one system to ano; , in that they have tried to transport T001 , And replies have few links check that too , will help you to transporting the entries of the table TSTCT.
    Regards,
    Saravana.S

  • Is there any system table available to check no. of entries in the table?.

    Hi
    Is there any system table available to check the no of entries in the table.
    Note : the table may be whether SAP table or Z-table.(All tables)
    Regards
    Raja.

    Hi Raja,
    I don't think so. Instead, try to perform
    SELECT count(*) FROM dbtab.
    ...to get the number of records of the table dbtab.
    I hope this helps. Kind regards,
    Alvaro

  • Remove entries from the "Open with" menu?

    I'm using openbox as a window manager and while trying to open some specific zip files I did the right click, open with, and then chose a few different programs.
    The problem is that now everytime I right click a file of the same extention the menu includes the programs I selected from before. Here's an example of what it looks like
    Open
    unzip
    7-Zip FM
    Archive Manager
    File Manager PCMan FM
    Open With
    Cut
    Copy
    and so on. My laptop screen has quite a small resolution and the menu flows off the screen which is getting really annoying. Is there a way I can remove entries on the menu, and just keep Archive Manager, making the menu smaller?
    Thanks

    you need to edit your mime list:
    ~.local/share/applications/mimeapps.list
    or install mime-editor  or xfce4-mime-settings

  • Delete any entry in the table before adding an entry?

    Hello ABAP Experts,
    I have the data in the work area. I can modify / update / insert to the table.
    How to write the ABAP code for this situation.
    1) to delete any entries in the table
    2) update this entry
    so finally always there would be only one entry.
    Suggestions appreciated.
    Thanks,
    BWer

    Hi,
    Delete the entries of table by this stmt.
    DELETE FROM (dbtabname).
    Then insert the values from workarea
    INSERT INTO dbtab VALUES <work_area>.
    And u can upadte the entry with values of workarea by this stmr.
    UPDATE (dbtabname) FROM wa.
    Dont use MODIFY. It will add a new record if its a new entry.
    Rgds,
    Prakash

  • How to remove space below the table in smartforms

    how to remove space below the table in smartforms

    maintain a loop counter for item say count
    and in text editer write
    if count > 6
      new-page.
    endif.

  • Error: No entry/entries in the table (WCCI)

    Hello friends
    I am trying to implement WCM to my client
    when trying to change WCD i am getting the following error
    No entry/entries in the table (WCCI)
        Message no. I4702    &
    Error when executing function module (WCFC_PRINT_FORMAT_GET)
         Message no. I4804
    Procedure
         Contact SAP.
    i am not able to resolve the issue.  Please help me in this regard
    venkat

    I have attached the screen shot.
    Regards,
    Amar

  • Problem with the XI-Audit log entries in the table "XI_AF_MSG_AUDIT"

    Hi,
    I have an async-szenarios for PO:
    We send Idoc's from SAP ERP to a WebService via SOAP. And we take Ack's. We use Integrationsprocess with deadline block to catche the errors after the retrying (three times) and to send they via e-mail.
    Our problem is, the number of the audit logs in the table "XI_AF_MSG_AUDIT":
    In the RTW only we see one audit log (with three retries) in an error case. But in the table XI_AF_MSG_AUDIT there are about 76 entries for the same audit log in the error case and about 20 entries in the case of the succuessfull processing.
    This number of the entries in the table causes problem with the size of the redo log file and delete job of cours the large size of the table and therefore problem on the data base. The table can not be controlled. The delete job can not run and cancels every time due this redo log problems
    What can cause that?
    How can it be prevented, that so much entries are not be made in the  table "XI_AF_MSG_AUDIT".
    Best regards
    Gueltekin

    Hi Gueltekin,
    I am only aware of the general property auditLogEnabled of J2EE Engine Service SAP XI AF Core, which controls in general (default = true) that entries in the AF Message Audit log are written at all.
    (see [http://help.sap.com/saphelp_nw70/helpdata/en/5c/22ee41c334c717e10000000a155106/frameset.htm|http://help.sap.com/saphelp_nw70/helpdata/en/5c/22ee41c334c717e10000000a155106/frameset.htm])
    I assume that your scenarios in the error case is sending up to three messages and for each message the number of audit log infos are created. You might want to check the detailed entries in the log and see from where they are comming, you might use customer modules etc. as well.
    Best regards,
    Silvia

  • "No entry in the table T589A for P" in PPOME's custom Tab

    Hello,
    <u>requisites:</u><b> Add one custom Tab to transaction PPOME relative to Position (Object type S)</b>
    <u>problem:</u><b>"No entry in the table T589A for P" </b> when entering the transaction PPOME, and choose my new added Tab.</b>
    I get this error message <b>"No entry in the table T589A for P" </b> when entering the transaction PPOME, and choose my new added Tab.
    The thing is, if I comment the line "MODULE BEFORE_OUTPUT" in subscreen 7000 of the infotype (the tab is infotype specific) this error disappear. But then the data entered in the tab, which should be relative to one position (type S), is now displayed for all positions. When leaving the transaction, and entering again, in the same tab, the data has disappeared.
    I think I should not comment this:  "MODULE BEFORE_OUTPUT"
    Why is this error being raised, and what must I do do stop it?
    Thank you.

    Hi,
    The table T589A is a configuration table pertaining to the pf status of the infotype. I changed the pf status of the infotype i.e. added my own buttons on application tool bar. May be cos of that it is giving error. Not sure.......

  • Multiple entries in the table cabn

    Hello,
    Can Anyone tell me how is it possible to have multiple entries of the same "atnam" field in the table CABN.
    It has something to do with changing number.
    Because I used a wrong select-instruction e.g.
    select atnam in charact where .... IN ....
    So, I shoud used
    select DISTINCT atnam in charact where .... IN ....
    So, I'm gone need to try to put multiple entries in the table to check, if it's working well.
    Thanks a lot.
    Best Regards,
    Kais

    If I understand your Q - you mean there are two ATINN for the same ATNAM in your CABN table?
    I dont think that's possible. If you check CT04 and try to create a new characteristic with same name as an existing one - it will give you a warning and prevent creation.
    Since you say it's a standard characteristic - please mention the characteristic name (ATNAM)?

  • PT60 report err 'No entry in the table T555Z'

    Dear All,
    I tried to run PT61, but I'm getting the error 'No entry in the table T555Z'.
    But it's negative time management and in IT0007 I have marked the time status 09.
    Regards
    Thomas

    This error is caused because you do not have the entries in T555z under the PSG for Time recording (What ever has been for for this employee)
    If you do not need this, you can comment out TIMTP function in the schema and then you should not get the error...

  • Error message 'No entry in the table T589A for P 2'

    Hi all,
    I am updating the field of an infotype using the function module 'HR_INFOTYPE_OPERATION'. But the function module is not updating the field. Instead the return key of the function module has the message
    'No entry in the table T589A for P2'. The function module is called as follows:
    CALL FUNCTION 'HR_INFOTYPE_OPERATION'
      EXPORTING
        infty                  = '9900'
        number                 = wf_pernr
        SUBTYPE                = P9900-SUBTY
      OBJECTID               =
      LOCKINDICATOR          =
        VALIDITYEND            = P9900-ENDDA
        VALIDITYBEGIN          = P9900-BEGDA
      RECORDNUMBER           =
        record                 = p9900
        operation              = 'MOD'
      TCLAS                  = 'A'
       DIALOG_MODE            = '0'
       NOCOMMIT               =
      VIEW_IDENTIFIER        =
      SECONDARY_RECORD       =
    IMPORTING
       RETURN                 = wf_return
       KEY                    = wf_key
    Please suggest.
    regrds,
    madhu

    Hi,
    The table T589A is a configuration table pertaining to the pf status of the infotype. I changed the pf status of the infotype i.e. added my own buttons on application tool bar. May be cos of that it is giving error. Not sure.......

  • Unable to display data no entry in the table without using Model clause

    Hi,
    I've an urgent requirement described below :
    The previously posted Question has been answerted using Model Clause:
    Is there any way out to solve it without using Model clause:
    I've a table named as "sale" consisting of three columns : empno, sale_amt and sale_date.
    (Please ref. The table script with data as given below)
    Now if I execute the query :
    "select trunc(sale_date) sale_date, sum(sale_amt) total_sale from sale group by trunc(sale_date) order by 1"
    then it displays the data for the dates of which there is an entry in that table. But it does not display data for the
    date of which there is no entry in that table.
    If you run the Table script with data in your schema, then u'll see that there is no entry for 28th. Nov. 2009 in
    sale table. Now the above query displays data for rest of the dates as its are in sale table except for 28th. Nov. 2009.
    But I need its presence in the query output with a value of "sale_date" as "28th. Nov. 2009" and that of "total_sale" as
    "0".
    Is there any means to get the result as I require?
    Please help ASAP.
    Thanks in advance.
    Create table script with data:
    CREATE TABLE SALE
    EMPNO NUMBER,
    SALE_AMT NUMBER,
    SALE_DATE DATE
    SET DEFINE OFF;
    Insert into SALE
    (EMPNO, SALE_AMT, SALE_DATE)
    Values
    (100, 1000, TO_DATE('12/01/2009 10:20:10', 'MM/DD/YYYY HH24:MI:SS'));
    Insert into SALE
    (EMPNO, SALE_AMT, SALE_DATE)
    Values
    (100, 1000, TO_DATE('11/30/2009 10:21:04', 'MM/DD/YYYY HH24:MI:SS'));
    Insert into SALE
    (EMPNO, SALE_AMT, SALE_DATE)
    Values
    (100, 1000, TO_DATE('11/29/2009 10:21:05', 'MM/DD/YYYY HH24:MI:SS'));
    Insert into SALE
    (EMPNO, SALE_AMT, SALE_DATE)
    Values
    (100, 1000, TO_DATE('11/26/2009 10:21:06', 'MM/DD/YYYY HH24:MI:SS'));
    Insert into SALE
    (EMPNO, SALE_AMT, SALE_DATE)
    Values
    (100, 1000, TO_DATE('11/25/2009 10:21:07', 'MM/DD/YYYY HH24:MI:SS'));
    Insert into SALE
    (EMPNO, SALE_AMT, SALE_DATE)
    Values
    (200, 5000, TO_DATE('11/27/2009 10:23:06', 'MM/DD/YYYY HH24:MI:SS'));
    Insert into SALE
    (EMPNO, SALE_AMT, SALE_DATE)
    Values
    (200, 4000, TO_DATE('11/29/2009 10:23:08', 'MM/DD/YYYY HH24:MI:SS'));
    Insert into SALE
    (EMPNO, SALE_AMT, SALE_DATE)
    Values
    (200, 3000, TO_DATE('11/24/2009 10:23:09', 'MM/DD/YYYY HH24:MI:SS'));
    Insert into SALE
    (EMPNO, SALE_AMT, SALE_DATE)
    Values
    (200, 2000, TO_DATE('11/30/2009 10:23:10', 'MM/DD/YYYY HH24:MI:SS'));
    Insert into SALE
    (EMPNO, SALE_AMT, SALE_DATE)
    Values
    (300, 7000, TO_DATE('11/24/2009 10:24:19', 'MM/DD/YYYY HH24:MI:SS'));
    Insert into SALE
    (EMPNO, SALE_AMT, SALE_DATE)
    Values
    (300, 5000, TO_DATE('11/25/2009 10:24:20', 'MM/DD/YYYY HH24:MI:SS'));
    Insert into SALE
    (EMPNO, SALE_AMT, SALE_DATE)
    Values
    (300, 3000, TO_DATE('11/27/2009 10:24:21', 'MM/DD/YYYY HH24:MI:SS'));
    Insert into SALE
    (EMPNO, SALE_AMT, SALE_DATE)
    Values
    (300, 2000, TO_DATE('11/29/2009 10:24:22', 'MM/DD/YYYY HH24:MI:SS'));
    Insert into SALE
    (EMPNO, SALE_AMT, SALE_DATE)
    Values
    (300, 1000, TO_DATE('11/30/2009 10:24:22', 'MM/DD/YYYY HH24:MI:SS'));
    COMMIT;
    Any help will be needful for me
    Regards,

    select sale_date,sum(sale_amt) total_sale
    from
    select empno,0 sale_amt,(sale_date + ao.rn) sale_date
    from
    select empno,sale_amt,sale_date ,(t.nxt_dt - t.sale_date) diff
    from
    select empno
    ,sale_amt,trunc(sale_date) sale_date
    ,trunc(nvl(lead(sale_date) over (partition by 1 order by sale_date),sale_date)) nxt_dt
    from sale
    ) t
    where (t.nxt_dt - t.sale_date) >1
    ) rec,(select rownum rn from user_objects where rownum<=200) ao
    where ao.rn <=(rec.diff-1)
    union all
    select empno,sale_amt,trunc(sale_date) sale_date
    from sale
    group by sale_date
    order by 1;
    ~~~~Guess this will serve the purpose...
    Cheers Arpan

Maybe you are looking for

  • Re-using statement objects

    Hi, I am new to jdbc and sql in Java. So this is my question. If I want to to a select statement and depending on the result a second select, can I do this on the same statement object, or do I have to create a new one? And what about the resultset?

  • Audit Log Reports

    Hi I have configured site collection audit settings but not able to get old data about users activities on portal using this feature. i have created it last dec 10th 2014 and whenever i run audit log reports, it generates report for only from dec 10t

  • Water on keyboard

    I was in a meeting and spilled about a 3rd of a bottle of plain water on my Macbook pro, what should I do?

  • Instead of one recon account I need to post in six def recon accounts

    Hi, based on my customer group and market segment i need to pick one reconcilation account could you please help me on this issue Regards Mastan Rao 09986951868

  • How to list deployments on a particular server?

    Using wlst, before my script deploys an app, I want to check to see if it is deployed in the target and, if needs be, undeploy first. The problem is that the script below does not show the target for the existing deployment. I only want to undeploy i