Trace deletes for a special table

Hello Everybody
We have some strange problems with our Maxdb database (7.6.00.34) (no SAP System)
Every day we lose about 3000-4000 records in an table with 120000 records.
The table is filled with records from a sap system and all programmers are sure that their applications only read or update this table (never delete) ??????
Now i want to trace the database.
Is it possible to write a trace task, that only logs "deletes" on table xyz ??
If yes, how to do this ?
I have never used tracing before, so an example would be very helpfull.
Any help welcomed
Best Regards
Albert

Hi Albert,
the function user will return the current user.
Anyhow, it might be easier to just specify the default value for the username column as user.
Something like this:
create table DELLOG (
"TIMESTAMP" TIMESTAMP NOT NULL default TIMESTAMP,
"TABLEKEY" CHAR (50) NOT NULL,
"USERNAME" CHAR (32) NOT NULL default USER,
primary key ("TIMESTAMP", "TABLEKEY")
That way all you've to figure out yourself for the INSERT is the KEY of the deleted row.
For example if I've got a CUSTOMER table with ID as primary key the trigger could look like this:
create trigger logdelete for lars.customer after delete
execute (
   insert into lars.dellog values (default, :old.id, default);
TIMESTAMP and USERNAME will automaticall be filled by the database.
KR Lars

Similar Messages

  • How to delete the line for 300SAP* in table USR02 in SQL Management studio

    Hello
    I used to delete the line for 300SAP* in table USR02 in SQL Enterprise Manager. After I could log on with “pass”.
    I wander how to delete it in SQL Management studio. When I expand tdatabase it takes so long time and it is uncontrollable

    Hello,
    you have to delete the row by a sql statement.
    Open a new query and run a script like this:
    use <Your SID DB>                 -- e.g. use PRD
    setuser 'your sid in lowercase'  --- e.g. setuser 'prd'
    delete from USR02 where MANDT = '300' and BNAME = 'sap*'
    go
    Run a complete backup before deleting data manually.
    Regards
      Clas

  • What is the keyboard shortcut for "delete row" in a table?

    What is the keyboard shortcut for "delete row" in a table within a pages document?

    Click on the row number to select the entire row. Right-click, and select Delete Row from the menu. There is no keyboard shortcut.

  • How to create BDC for Deletion of Records in Table Control in BDC for PFCG

    I have transcation PFCG and have to go to roles of users there.We will upload the users who has to be deleted and it should delete it from the PFCG in one go .Howcan I create a program to delete from the table .If i delete directly from DB table it doesnt show in SAP log how or Who deleted it  and the client wants this log which is needed for accountability.
    Pls HELP.
    George

    Hi
    You can only indicate the user and all profiles of the user will be deleted.
    DATA: BEGIN OF T_DEL_USR OCCURS 0,
                     USERNAME LIKE  BAPIBNAME-BAPIBNAME,
          END   OF T_DEL_USR.
    DATA T_RESULT TYPE STANDARD TABLE OF BAPIRET2
    WITH HEADER LINE.
    After loading the users to be deleted:
    LOOP AT T_DEL_USR.
      CALL FUNCTION 'SUSR_BAPI_USER_PROFILES_DELETE'
        EXPORTING
           USERNAME = T_DEL_USR-USERNAME
        TABLES
            RETURN =  T_RESULT.
    ENDLOOP.
    I'm not sure but perhaps u have to use bapi for commit too: BAPI_TRANSACTION_COMMIT
    Max

  • Data gets deleted for the table RSTRFIELDSH

    If data gets deleted for the table RSTRFIELDSH at BW end
    ...what should i do?to get it back

    Wim,
    We lost the data from production. We ran Archive program to archive the data and archiving file is still exist.
    There is no possibliity to run the OUTBOUND process again to create the IDOCs.
    But only my concern is When we run the Transaction SARA we will be getting the data for other period as well.
    But I need to reload the data for three months only because that archiving file also has other period data as well.
    Can you send me details of how to use SARA Transaciton for particular period.
    Thanks,
    Kalikonda.

  • Special authorization need for read cluster table??

    In one report, I use following coding to read information from RFDT table:
    form get_f110_parm .
      f110id-laufd   = p_laufd.
      f110id-laufi   = p_laufi.
      f110versionpar = space.
      clear:   buktab, fkttab, slktab, sldtab, trctab, usrtab,
               faetab, jobtab, f110v, f110c,  trcopt, f110versionpar.
      import buktab fkttab slktab sldtab trctab usrtab
             faetab jobtab f110c trcopt f110versionpar
             from database rfdt(fb) id f110id
             accepting padding.
    endform.                    " GET_F110_PARM
    I can fill F110c, trcopt and f110versionpar by this program. But there is no entry in table like fkttab, usrtab.
    Is there any authorization need for read cluster table??
    Thanks in advance.
    Edited by: Amy Xie on Dec 21, 2010 10:41 AM

    Hello,
    After you run your code, check transaction SU53 to see if any authorization check failed.

  • Setup tables data not getting deleted for application 11

    Dear Team,
    Trying to delete data from setup tables after completing few fields enhancements
    System triggering following error message and the data is not getting deleted
    Step 001 started (program RMCSBWSETUPDELETE, variant &0000000000010, user ID 00938H744
    Database problems with table MC11VA0ITMSETUP
    Job cancelled after system exception ERROR_MESSAGE
    Please guide
    Thanks,
    Sarasu

    Try to adjust the database tables using SE14 transaction.
    SE!4 --> Enter table name MC11VA0ITMSETUP -->Select radio button "tables" --> click on Edit -->Select processing type "Background" --> Click on "Activate and Adjust database".
    Here before performing the Activate and Adjust database function -- first try to check the data base object (click on check button and select database object --ok) if every thing is ok then proceed with the above steps.
    Next try to delete the setup tables and check.. hope this should work.
    Try to check the logs in SM21 and also check if the data source is active or not before deleting the setup tables.
    Regards
    KP
    Edited by: Konduru Prashanth. on Mar 2, 2012 6:08 PM

  • Deleting data from a table where there are no indexes on the table

    Hi
    We have one interface program for one time process.When I was testing the process it was taking too much time to load the data around 1000 records.
    it happens in 2 steps
    1 puts into stage table
    2 puts into base table
    in the process/package I have delete statement that deletes data from stage table before each process.
    Stage table did not have any indexes but the base table has(obvisiosly)
    any idea?
    please help me on this.
    Thanks,
    Y

    Hi,
    Please post the application/database details along with the OS.
    Is this interface program a seeded or custom one?
    Please enable trace on this concurrent program as per (Note: 296559.1 - FAQ: Common Tracing Techniques within the Oracle Applications 11i/R12) and generate the TKPROF to find out why it takes that long to load/delete the data.
    Thanks,
    Hussein

  • Very urjent (What is the procedure for adding a table documentation to IMG)

    Hi abapers,
    It was very urjent,
    What is the procedure for adding a table documentation to IMG entries. 
    (It does not have "deletion" information, but there is a section on making changes to Z tables and then updating the IMG, which presumably could be expanded for deletion of objects.)
    I having the procedure, But that is not clear.
    Can any body tell me step by step.
    With regards.

    Hi,
    Assign IMG Documentation
    Prerequisites
    You have opened the IMG structure in change mode and created an IMG activity.
    Procedure
    Choose the Document tab in the Assigned objects group box.
    If you want to create a new document for the IMG activity, enter a name for the document and choose Create.
    The name can contain alphanumeric characters and the special character "_".
    You go to the text editor. Specify a package class when you save the text. You return to the previous initial screen with Back.
    To use an existing document, choose the Assign other document pushbutton to the right of the document name. Choose an existing document and choose Copy.
    Save the changes with IMG activity  Save.
    Regards,
    Renjith Michael.

  • How to trace deleted job

    Hi All,
    Recently all jobs in production system have been deleted and I can find out what/who causes this problem. It happens 3 times during this month. I want to enable trace just for related tables and log all modifications about jobs.
    I am looking for Table Logging Procedure.
    Any idea regarding this issue will be appreciated,
    Sanaz.

    hi,
    GO through this link i think it will help u to move further.
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/a92195a9-0b01-0010-909c-f330ea4a585c

  • Reg:How to delete the column in table control also from database table.

    Hi Experts,
    Once again thank u all for giving the responses.
    one more doubt is how to delete the columns of table control and also the record shold delete from ztable.
    With Regards,
    Saroja.P.

    Hi,
    If you want to delete the rows in the table control and simultaneously delete it from the database table, then you can implement a 'DELETE' functionality specific to your table control. Have a MARK field (you will find that in the screen attributes of the table control -> give a name for the MARK field, you will find an additional MARK column at the beginning of your table control). You can check whatever rows you want to delete from the table control, call the delete module.
    "This portion of code inside the LOOP...ENDLOOP.
    IF sy-ucomm eq 'F_DELETE'.
       gt_itab2-check = mark.  " Store the MARK field status into your internal table's correspoding field 'check'
      MODIFY gt_itab INDEX tabcontrol-current_line.
    ENDIF.
    iF sy-ucomm eq 'DELETE1'.
      DELETE gt_itab WHERE check eq 'X'. "Your internal table does not have rows that you want to delete
    ENDIF.
    Now you can modify your database table using the MODIFY statement.
    MODIFY ZDB FROM TABLE gt_itab.

  • Deleting the values from table control

    HI,
    I need to remove the selected line from the Table control on my screen.
    The point is that the Internal table does not have any records,.
    for example in the Customer Create screen,
    while entering the bank details we will enter it in a tbale contraol.
    but the records doesnt exist in the database. but the record gets deleted from the table control only if we press delete button.
    please guide me.
    please note : I want to delete the record from Table Control on the screen and I dont have any corresponding database records..
    regards

    Hi..
    The solution to your problem - deleting values from table control.
    Here: it_wizard is the internal table which is holding the value of table control.
             wa_wizard is the work are of the internal table it_wizard.
             it_delete is the internal table which holds the deleted record of table control.
             wa_delete is the work area of the internal table it_delete
    Also here the field ZSEL is the character field which is used to select the entire record in the table control.
    LOOP AT it_wizard into wa_wizard WHERE zsel = 'X'.
           MOVE-CORRESPONDING wa_wizard TO wa_delete.
           APPEND wa_delete TO it_delete.
           delete table it_wizard from wa_wizard.
    DELETE  FROM zfin_goods WHERE ZFG = WA_delete-ZFG.
    ENDLOOP
    if sy-subrc eq 0.
    Message 'Delete Successful' type 'S'.
    endif.
    The above code will delete the record from both the table control.internal table and the database table.
    I think this will help you to great extent.
    Ward regards,
    Bhuvaneswari
    Edited by: BHUVANESWARI THIRUNAVUKKARASU on Jan 7, 2009 10:39 AM

  • Delete entries from the table

    Hi folks,
    I have delete program to delete entries from a custom table and has only one feld in it.
    tables: ZABC
    selection-screen begin of block B1 with frame title text-110.
    select-options: P_KOSTL for ZABC-KOSTL.
    selection-screen end of block B1.
    delete from ZABC where KOSTL in P_KOSTL.
    Upon executing I am entering certain cost center ids on the selection screen to delete them from the table.It did not work.
    what is it I am missing?
    Thanks,
    SK

    Hi,
    Try this sample code..Replace ZABC with your table..
    TABLES: ZABC.
    selection-screen begin of block B1 with frame title text-110.
    select-options: P_KOSTL for ZABC-KOSTL.
    selection-screen end of block B1.
    START-OF-SELECTION.
    * Delete the records from the table.
    DELETE FROM ZABC where KOSTL IN P_KOSTL[ ].  " [] for the select-options.
    IF sy-subrc <> 0.
      ROLLBACK WORK.
    ELSE.
      COMMIT WORK.
    ENDIF.
    Thanks,
    Naren

  • How to delete data from the table PA0007

    Hi Friends,
    Thank you for your kindly help.
    When I upload data to infotype 0007(planed working time),
    there is something wrong with the infotype 2011. So I want
    to delete the data of  infotype 0007. While using the program RPUREOPN to delete the data, the system will say:0007 cannot be deleted because of time constraint 1/A.
    Now how can I delete the data from table PA0007?
    Pls help me urgently.
    Best wishes
    Anne

    Hi Sikindar,
       Thank you for your help.
      There is another question. There are five clients (Client 300,310,320,330,350) in my HR DEV system. I just want to delete the data of infotype 0007 in client 350. When I change the the time constraint and delete the data in client 350, the data of infotype 0007 in other clients will be safe or not?
    Thank you again for your help!
    Best wishes
    Anne

  • How to trigger a 'delete' across different related tables in ABAP?

    Hello All,
    I am creating database tables for storing different values of features coming under different countries. I have eight tables in my design and there are fields repeating in different tables, which i am connecting through foreign key relationship.
    After entering values to all my tables, if i need to delete a particular field value which is repeating in more than two tables, is it possible to trigger a delete event by which if am deleting the field value in a particular table, all the related field values also get deleted from the respective tables?
    For example, if i have a PRODUCT field in three tables, and if one of the PRODUCT is deleted from a particular table, can i trigger a delete event by which i can delete all the values related to that particular PRODUCT from all the related tables? The PRODUCT is a primary keyfield, and i have maintained proper foreign key relations also.
    I have tried deleting entries using the views and using the database table itself, but only that particular table value is being deleted.
    Is there any function module for triggering a delete?
    Can anyone help me with some solution?Sample code will be helpful.
    Thanks in Advance,
    Shino

    Hi,
    My friend it is not advisable to delete any field from a database  table bcoz it's creats incosistance data for all the other related tables, but there r few Function Modules that provide u this functionality.
    Such As:
    G_REPORT_DELETE_ADDFLD_ENTRY
    G_CATT_DELETE_TABLE_ENTRY
    RKE_DELETE_FIELDS_FROM_TABLE
    Regards

Maybe you are looking for

  • Camileo H10 - What SD card can I use?

    Hi anyone, I am new to Toshiba products. I have just bought one of your movie cameras ( Camileo H10 ) and i cannot find any help online. The questions i wanted to ask were, 1.) What class (for speed) of SD card can the camera use. 2.) Is there somewh

  • Help understanding what's going on with permissions

    This is long and rather complicated, so if you're not in the mood, skip it. Background: A few days ago I needed to burn some data to CD. First time since owning the machine (about 1 year). Didn't work. System would not recognize any blank media or mo

  • HP 6480 all in one setup help

    I just purchased the last floor model at an office supply store. Came with no box or installation instructions. My system is an HP Pavilion a335w with Vista OS. ATT wireless router(so Im told and payed for) 2 WIRE GATEWAY 2701HG-B. Store personnel st

  • Hp laserJet 1020 printing black paper

    i'm trying to use HP printer , but i can't print in a clear way , all paper like example image ,,  i need help to fix it . This question was solved. View Solution.

  • Copying Events from Subscribed Calendars

    I'm making the switch from Google calendar to all iCloud. One thing I miss from Google is being able to select an event from a calendar that I'm subscribed to and then copy that to my default calendar. I subscribe to multiple calendars and I don't ne