How to delete the records from custom table???

My requirement is,
I have a custom table, assume as ZABC, I have updated this by my custom program, This data having table can be extracted by BI etract program(Assume ZZZ). Here I am not writing any code for extracting data from table to BI extract program, That they will do by BI extract program. But I want to write the code for
<b>Cleanup of Z table—delete records 30 days after the BI data extractor has run.</b>
How this is possible suggest me any method having for these???
Thanks Sanju

Hell Sanjana,
Ask your basis people to do the clean up after  30 days. If you want the clean up only to be done 30 days after BI extract has been done, then u need some sort of indicator to say that BI Extract has been done , like  flag and date in a custom table which will be set as soon as extract is done. Then based on that info u need to delete a the records.
Regards

Similar Messages

  • How to delete the records from database table without using work area

    Hi all,
    The purpose of the down program is to delete the entire contents from all the tables. The deletion of the table should be in sorted manner. Is there any other way to write the code more efficiently,
    TABLES: ZFFMCTL_AP, ZFFMHDR_AP, ZFFM_CHANGE_LOG, ZFFMDTL_AR, ZFFMHDR_AR, ZFFMDTL_JV, ZFFMHDR_JV, ZFFMDTL_SKF,ZFFMHDR_SKF,ZFINVOICE_DETAIL, ZFFMMASTER, ZFFMLOGREAD_CLUS, ZFFMCTL.
    DELETE ZFFMCTL_AP.
    IF SY-SUBRC = 0.
    DELETE ZFFMMHDR_AP.
    IF SY-SUBRC = 0.
    DELETE ZFFM_CHANGE_LOG.
    IF SY-SUBRC = 0.
    DELETE ZFFMDTL_AR.
    IF SY-SUBRC = 0.
    DELETE ZFFMHDR_AR.
    IF SY-SUBRC = 0.
    DELETE ZFFMDTL_JV.
    IF SY-SUBRC = 0.
    DELETE ZFFMHDR_JV.
    IF SY-SUBRC = 0.
    DELETE ZFFMDTL_SKF.
    IF SY-SUBRC = 0.
    DELETE ZFFMHDR_SKF.
    IF SY-SUBRC = 0.
    DELETE ZFINVOICE_DETAIL.
    IF SY-SUBRC = 0.
    DELETE ZFFMMASTER.
    IF SY-SUBRC = 0.
    DELETE ZFFMLOGREAD_CLUS.
    IF SY-SUBRC = 0.
    DELETE ZFFMCTL.
    ENDIF.
    ENDIF.
    ENDIF.
    ENDIF.
    ENDIF.
    ENDIF.
    ENDIF.
    ENDIF.
    ENDIF.
    ENDIF.
    ENDIF.
    ENDIF.
    Waiting for response,
    Thanks in advance
    John

    Write this way....
    TABLES: ZFFMCTL_AP, ZFFMHDR_AP, ZFFM_CHANGE_LOG, ZFFMDTL_AR, ZFFMHDR_AR, ZFFMDTL_JV, ZFFMHDR_JV, ZFFMDTL_SKF,ZFFMHDR_SKF,ZFINVOICE_DETAIL, ZFFMMASTER, ZFFMLOGREAD_CLUS, ZFFMCTL.
    DELETE ZFFMCTL_AP.
    CHECK SY_SUBRC = 0.
    DELETE ZFFMMHDR_AP.
    CHECK SY_SUBRC = 0.
    DELETE ZFFM_CHANGE_LOG.
    CHECK SY_SUBRC = 0.
    DELETE ZFFMDTL_AR.
    CHECK SY_SUBRC = 0.
    DELETE ZFFMHDR_AR.
    CHECK SY_SUBRC = 0.
    DELETE ZFFMDTL_JV.
    CHECK SY_SUBRC = 0.
    DELETE ZFFMHDR_JV.
    CHECK SY_SUBRC = 0.
    DELETE ZFFMDTL_SKF.
    CHECK SY_SUBRC = 0.
    DELETE ZFFMHDR_SKF.
    CHECK SY_SUBRC = 0.
    DELETE ZFINVOICE_DETAIL.
    CHECK SY_SUBRC = 0.
    DELETE ZFFMMASTER.
    CHECK SY_SUBRC = 0.
    DELETE ZFFMLOGREAD_CLUS.
    CHECK SY_SUBRC = 0.
    DELETE ZFFMCTL.

  • Regarding how to delete the record in internal table

    Hi experts ,
    how to delete the record in intarnal table after validating the data,
    if record contains invalid fields?
    i am giving my code see this and give me the answer?
    loop at it_data into wa_data .
    Validate  Cost Center
        READ TABLE it_kostl INTO wa_kostl WITH KEY kostl = wa_data-kostl BINARY SEARCH.
        IF sy-subrc NE 0.
          PERFORM update_error_log USING wa_data
                                         text-004.
        ENDIF.
    Validate source file material ( material number )
    loop at it_mara into wa_mara .
      read table it_ausp into wa_ausp with key atwrt = wa_data-i_matnr .
               if sy-subrc NE 0 .
       PERFORM update_error_log USING wa_data
                                           text-002.
    delete it_data-objek .
         else.
      read table it_mara into wa_mara with key  matnr = wa_ausp-objek .
           if sy-subrc EQ 0 .
           wa_data-objek = wa_mara-matnr.
           wa_data-matkl = wa_mara-matkl.
         ENDIF.
         Modify it_data from wa_data  .
      endif.
    *endloop.
    Validate unit of measure (unit)
        READ TABLE it_t006 INTO wa_t006 WITH KEY msehi = wa_data-unit .
        IF sy-subrc NE 0.
          PERFORM update_error_log USING wa_data
                                         text-003.
        endif.
    Validate delivery location ( storage location )
        READ TABLE it_lgort INTO wa_lgort WITH KEY del_loc = wa_data-del_loc.
        IF sy-subrc NE 0.
          PERFORM update_error_log USING wa_data
                                         text-001.
             if wa_data-flag ='x' .
          delete it_data from  wa_data .
        endif.
        ENDIF.
    endloop.

    Hi Naren,
    First get the index number of the IT_data table and store it in one variable whose declaration like this.
    data: tabix type sy-tabix.
    while reading the internal table it_data set the tabix variable.
    tabix = sy-tabix.
    Instead of  the above use below one.
    Delete it_data-objek
    Use the Below statement it will delete  the row from the internal table.
    Delete it_data-objek index tabix
    Thanks,
    Chidanand

  • How to delete a record from BSEG table

    Dear Experts,
    How to delete a record from BSEG table.
    If there possible to delete some records from transparent table ?
    Please help.
    Regards,
    Tan

    Hi,
    Deleting a record from a standard table can be done only if table maintenance exists - Cehck tcode - SM30.  But it is not advisable to delete records, coz the records may be dependent on many other tables.  If u delete in a single place, there may be chance that inconsistency in the data happens and hence will affect ur financial statements.
    Pls. assign points, if useful
    Regards,
    Sridevi

  • How to delete the data from partition table

    Hi all,
    Am very new to partition concepts in oracle..
    here my question is how to delete the data from partition table.
    is the below query will work ?
    delete from table1 partition (P_2008_1212)
    we have define range partition ...
    or help me how to delete the data from partition table.
    Thanks
    Sree

    874823 wrote:
    delete from table1 partition (P_2008_1212)This approach is wrong - as Andre pointed, this is not how partition tables should be used.
    Oracle supports different structures for data and indexes. A table can be a hash table or index organised table. It can have B+tree index. It can have bitmap indexes. It can be partitioned. Etc.
    How the table implements its structure is a physical design consideration.
    Application code should only deal with the logical data structure. How that data structure is physically implemented has no bearing on application. Does your application need to know what the indexes are and the names of the indexes,in order to use a table? Obviously not. So why then does your application need to know that the table is partitioned?
    When your application code starts referring directly to physical partitions, it needs to know HOW the table is partitioned. It needs to know WHAT partitions to use. It needs to know the names of the partitions. Etc.
    And why? All this means is increased complexity in application code as this code now needs to know and understand the physical data structure. This app code is now more complex, has more moving parts, will have more bugs, and will be more complex to maintain.
    Oracle can take an app SQL and it can determine (based on the predicates of the SQL), which partitions to use and not use for executing that SQL. All done totally transparently. The app does not need to know that the table is even partitioned.
    This is a crucial concept to understand and get right.

  • How to add the entries and how to delete the entries from custom Z-table?

    Hi Experts,
    My requirement is I need to add the entries from program to three custom z-tables . Assume as zabc1,zabc2,zabc3.
    Here how to add the entries from program to Z-table.???
    And one more requirement is I want to provide a deletion checkbox in selection screen . Initial it was unchecked. If I am giving tick mark then the entries should be deleted from above custom Z-tables. this all will done in backgroung job?
    Could you please guide me the logic how to crack this???
    Let me know if you need more Info
    Thanks
    Sanju

    Hi Sanjana,
    What you can do is to use the ABAP keyword INSERT or MODIFY to add or modify records to a given database table. Here are the syntax taken from SAP documentation:
    *Insert Statement
    INSERT dbtab
    Syntax
    INSERT { {INTO target VALUES source }
           | {     target FROM   source } }.
    Effect
    The INSERT statement inserts one or more rows specified in source in the database table specified in target. The two variants with INTO and VALUES or without INTO with FROM behave identically, with the exception that you cannot specify any internal tables in source after VALUES.
    System Fields
    The INSERT statement sets the values of the system fields sy-subrc and sy-dbcnt.
    sy-subrc Meaning
    0 At least one row was inserted.
    4 At least one row could not be inserted, because the database table already contains a row with the same primary key or a unique secondary index.
    The INSERT statement sets sy-dbcnt to the number of rows inserted.
    Note
    The inserted rows are finally included in the table in the next database commit. Up until this point, they can still be removed by a database rollback.
    *Modify Statement
    MODIFY dbtab
    Syntax
    MODIFY target FROM source.
    Effect
    The MODIFY statement inserts one or several lines specified in source in the database table specified in target, or overwrites existing lines.
    System fields
    The MODIFY statement sets the values of the sy-subrc and sy-dbcnt system fields.
    sy-subrc Meaning
    0 At least one line is inserted or changed.
    4 At least one line could not be processed since there is already a line with the same unique name secondary index in the database table.
    The MODIFY statement sets sy-dbcnt to the number of processed lines.
    Note
    The changes are transferred finally to the database table with the next database commit. Up to that point, they can be reversed using a database rollback.
    Hope it helps...
    P.S. Please award points if it helps...

  • How to delete the articles from MVKE table.

    hi all,
    i want to remove articles from MVKE table. but at that time artciles articles are not removal from other table.
    how to set deletion flag on sales organisation level.
    we want to set deletion flag on sales organisation level. but at that time i do not want to set deletion flag on site leve.
    thanx in advance

    874823 wrote:
    delete from table1 partition (P_2008_1212)This approach is wrong - as Andre pointed, this is not how partition tables should be used.
    Oracle supports different structures for data and indexes. A table can be a hash table or index organised table. It can have B+tree index. It can have bitmap indexes. It can be partitioned. Etc.
    How the table implements its structure is a physical design consideration.
    Application code should only deal with the logical data structure. How that data structure is physically implemented has no bearing on application. Does your application need to know what the indexes are and the names of the indexes,in order to use a table? Obviously not. So why then does your application need to know that the table is partitioned?
    When your application code starts referring directly to physical partitions, it needs to know HOW the table is partitioned. It needs to know WHAT partitions to use. It needs to know the names of the partitions. Etc.
    And why? All this means is increased complexity in application code as this code now needs to know and understand the physical data structure. This app code is now more complex, has more moving parts, will have more bugs, and will be more complex to maintain.
    Oracle can take an app SQL and it can determine (based on the predicates of the SQL), which partitions to use and not use for executing that SQL. All done totally transparently. The app does not need to know that the table is even partitioned.
    This is a crucial concept to understand and get right.

  • How to delete the entries from NAST table

    Hi,
    Please help me out by providing any function module that delete's the entries from hte NAST table.
    Regards,
    Kiran.L

    REPORT ZSCD_TEST13.
    delete from nast where VSTAT = '1'.
    =====
    If you see the FM : NAST_DELETE_OBJECT, its only useful when NACHA = 7 (i.e. message transmission medium = Simple Mail)
    For others its not useful.
    We had similar issue few days back and after long RnD, we straightaway deleted the entries using the Zprogram.
    regards,
    Edited by: Pranu Pranu on Aug 19, 2008 1:42 PM

  • Can we delete the records from a table, when sqlldr is loading

    Hello All
    We have a table on which we have indexes on some columns.
    This table is populated using the sqlldr. Now I want to delete the seven days old data, in a procedure. I want to know , can I run that procedure, when the sqlldr is loading into that table. Note that, the table has indexes
    Regards

    Hello
    Now we are thinking to create the partition on datetimeinserted, and want to delete the 7 day old partition, How about this? is this going to work? while still direct load of sqlldr is on.
    Regards

  • Is it possible to delete the records from LIS Table S601

    We have created some errorneous/unwanted  records in planning in table S601. Is there a way to delete these enties by Plant or material.
    Need your help urgently.. Please help.
    Thanks in Advance
    Rajesh

    Hi
    Once we created variant we can't delete it,
    Regards,
    srihari

  • How to delete errorneous records from Tperslangu Table.

    Hi,
    While uploading master data attribute 0event_attr  , giving error in languge key.  If i check these records in table tperslangu in BW , three entries are there
    PERSLANGU               LANGU                TXTSH
           HI                            E                          Hindi
          묩                     D                          Hindi
          묩                     E                           Hindi
    How to rectify this problem .
    Regards,
    Anand Mehrotra.

    Dear Mr. Saveen,
    Thanks for reply.
    I checked , it has english & german only. How to install hindi.
    Regards,
    Anand Mehrotra.

  • How to restrict the user(Schema) from deleting the data from a table

    Hi All,
    I have scenario here.
    I want to know how to restrict a user(Schema) from deleting the values from a table created in the same schema.
    Below is the example.
    I have created a table employee in abc schema which has two values.
    EMPLOYEE
    ABC
    XYZ
    In the above scenario the abc user can only fire select query on the EMPLOYEE table.
    SELECT * FROM EMPLOYEE;
    He should not be able to use any other DML commands on that table.
    If he uses then Insufficient privileges error should be thrown.
    Can anyone please help me out on this.

    Hi,
    kumar0828 wrote:
    Hi Frank,
    Thanks for the reply.
    Can you please elaborate on how to add policies for a table for just firing a select DML statement on table.See the SQL Packages and Types manual first. It has examples. You can also search the web for examples. This is sometimes called "Virtual Private Database" or VPD.
    If you have problems, post a specific question here. Include CREATE TABLE and INSERT statements to create a table as it exists before the policies go into effect, the PL/SQL code to create the policies, and additonal DML statements that will be affected by the policies. Show what the table should contain after each of those DML statements.
    Always say which version of Oracle you're using. Confirm that you have Enterprise Edition.
    See the forum FAQ {message:id=9360002}
    The basic idea behind row-level security is that it generates a string that is automatically added to SELECT and/or DML statement WHERE clauses. For example, if user ABC is only allowed to query a table on Sunday, then you might write a function that returns the string
    USER  != 'ABC'
    OR      TO_CHAR (SYSDATE, 'DY', 'NLS_DATE_LANGUAGE=ENGLISH') = 'SUN'So whenever any user says
    SELECT  *
    FROM    table_x
    ;what actually runs is:
    SELECT  *
    FROM    table_x
    WHERE   USER  != 'ABC'
    OR      TO_CHAR (SYSDATE, 'DY', 'NLS_DATE_LANGUAGE=ENGLISH') = 'SUN'
    ;If you want to prevent any user from deleting rows, then the policy function can return just this string
    0 = 1Then, if somone says
    DELETE  employee
    ;what actually gets run is
    DELETE  employee
    WHERE   0 = 1
    ;No error will be raised, but no rows will be deleted.
    Once again, it would be simpler, more efficient, more robust and easier to maintain if you just created the table in a different schema, and not give DELETE privileges.
    Edited by: Frank Kulash on Nov 2, 2012 10:26 AM
    I just saw the previous response, which makes some additional good points (e.g., a user can always TRUNCATE his own tables). ALso, if user ABC applies a security policy to the table, then user ABC can also remove the policy, so if you really want to prevent user ABC from deleting rows, no matter how hard the user tries, then you need to create the policies in a different schema. If you're creating things in a different schema, then you might as well create the table in a different schema.

  • How can i fetch records from 3 tables in a single query  without using join

    Hi.
    Can any body please tell me <b>How can i fetch records from 3 tables with a single query  without using joins</b>
    Thanx
    prabhudutta

    Hi Prabgudutta,
    We can fetch the data by using the views concept.
    Go throuth this info we can know the how to create view and same like database table only we can fetch the data.
    Views conatin the data at runtime only.
    Four different view types are supported. These differ in the
    way in which the view is implemented and in the methods
    permitted for accessing the view data.
    Database views are implemented with an equivalent view on
    the database.
    Projection views are used to hide fields of a table (only
    projection).
    Help views can be used as selection method in search helps.
    Maintenance views permit you to maintain the data
    distributed
    on several tables for one application object at one time.
    step by step creation of Maintenance view:
    With the help of the table maintenance generator, you are able to maintain the ENTRIES of the table in SM30 transaction.
    It can be set in transaction SE11 - Tools - Table maintenance generator.
    Table maintanance Generator is used to manually input values using transaction sm30
    follow below steps
    1) go to se11 check table maintanance check box under attributes tab
    2) utilities-table maintanance Generator-> create function group and assign it under
    function group input box. Also assign authorization group default &NC& .
    3) select standard recording routine radio in table table mainitainence generator to move table
    contents to quality and production by assigning it to request.
    4) select maintaience type as single step.
    5) maintainence screen as system generated numbers this dialog box appears when you click on create button
    6) save and activate table
    One step, two step in Table Maintenance Generator
    Single step: Only overview screen is created i.e. the Table Maintenance Program will have only one screen where you can add, delete or edit records.
    Two step: Two screens namely the overview screen and Single screen are created. The user can see the key fields in the first screen and can further go on to edit further details.
    SM30 is used for table maintenance(addition or deletion of records),
    For all the tables in SE11 for which Table maintenance is selected , they can be maintained in SM30
    Sm30 is used to maintain the table ,i.e to delete ,insert or modify the field values and all..
    It creates the maintenance screen for u for the aprticular table as the maintenance is not allowed for the table..
    In the SE11 delivery and maintenance tab, keep the maintenance allowed..
    Then come to the SM30 and then enter the table name and press maintain..,
    Give the authorization group if necessary and give the function group and then select maintenance type as one step and give the screen numbers as system specified..
    Then create,,,
    Then u will able to see the maintenance view for the table in which u can able to insert and delete the table values...
    We use SM30 transaction for entering values into any DB table.
    First we create a table in SE11 and create the table maintenance generator for that Table using (utilities-> table maintenance generator) and create it.
    Then it will create a View.
    After that from SM30, enter the table name and Maintain, create new entries, change the existing entries for that table.
    Hope this resolves your query.
    Reward all the helpful answers.
    Rgds,
    P.Naganjana Reddy

  • Is it safe to purge / delete older records from AUD$ table in SYS schema

    Hi,
    Can we purge / delete older records from AUD$ table in SYS schema.
    Please advice.
    Thanks
    Naveen

    Pl see MOS Doc 73408.1 (How to Truncate, Delete, or Purge Rows from the Audit Trail Table SYS.AUD$) fro details on how to do so.
    HTH
    Srini

  • How to delete the record in the file present in the application server?

    Hi,
      I have two questions.
      i) How can I delete a record based on some condition in the recordx in the file that is present in the application server?
      ii) How can I lock the users whiel one user is accessing the file on the application server?
    Thanks in advance.
    Suvan

    Hi,
    If u want a frequent deletion this approach to delete a record from a file will havee unnecesary copy of records from one file to another and deletion of one file and renaming activities.
    Instead what u can do is Add and field del_flag to ur record structure.
    If u want to delete the record from a file just mark this del_flag as 'X'.
    While processing u can have a loop like
    loop at it_XXX where del_flag <> 'X'.
    endloop.
    This will logically delete the record.
    When u r to finish the application at that time only perform this copying / deleting / and renaing activity
    Hope this helps.
    Cheers,
    Nitin

Maybe you are looking for

  • Can VC3 allow us to connect 3 webcams to laptop & then stream to Google+ Hangouts On Air?

    Hellllllllp! We are a non profit, Sena Foundation (www.sena.org), that has been offering free support for dying folks and doing free grief and loss education since 1982. A number of years ago we produced a half hour TV program (Sharing the Seasons) f

  • Query running extremely slow.

    Hi All, I am sitting on 10.2.0.4.0 on linux box. I've got one complain from the application folks regarding the query the slow query , it's running quite long time. I extracted out the explain plan and commulative wait events for sessions and system

  • How to configure SAP 4.7 to Oracle 9i Real Application Cluster ?

    We are using SAP 4.7 running on Oracle 9i with HP-UNIX clustering. If we change our existing SAP 4.7 for Oracle 9i Real Application Cluster, is it very complicated ? Do we need to re-install SAP and Oracle ?

  • Clean Erase and Install?

    I am about to install Final Cut on my Mac Book Pro, but noticed a piece of advice in a book I was reading. Since I upgraded my OS from 10.4 to 10.5, the book says that to make sure Final Cut works well, I should have done a clean erase and install of

  • Why JSTL change the encoding of response?

    Dear all, I use JSTL to display multiple language, and it can work fine. I also have a servlet to let the user to select the display language. All the request and response encoding is set to UTF-8, but I found that when user choose language to Chines