How to perform long deletes in a table

Hi,
How to perform long deletes from contains large number of records in a table.There is a table which size is 20GB and total record is 70283699
When we try to delete the records it take more than ten hours. Suggest me how can I to reduce the time.
Thanks,

Hi,
Find below that table script..
CREATE TABLE TRADING_FIN
TABLESPACE FIN_DATA
PCTUSED 0
PCTFREE 10
INITRANS 1
MAXTRANS 255
STORAGE (
INITIAL 64K
NEXT 64K
MINEXTENTS 1
MAXEXTENTS 2147483645
PCTINCREASE 0
LOGGING
PARTITION BY RANGE (YEAR)
SUBPARTITION BY LIST (GROUP_NO)
PARTITION ABC_Z2009 VALUES LESS THAN (2009)
LOGGING
NOCOMPRESS
TABLESPACE FIN_DATA
PCTFREE 10
INITRANS 1
MAXTRANS 255
STORAGE (
INITIAL 64K
NEXT 64K
MINEXTENTS 1
MAXEXTENTS 2147483645
PCTINCREASE 0
BUFFER_POOL DEFAULT
( SUBPARTITION ABC_Z2009_SP_1101 VALUES (1101) TABLESPACE FIN_DATA,
SUBPARTITION ABC_Z2009_SP_1102 VALUES (1102) TABLESPACE FIN_DATA,
SUBPARTITION ABC_Z2009_SP_1108 VALUES (1108) TABLESPACE FIN_DATA,
SUBPARTITION ABC_Z2009_SP_1111 VALUES (1111) TABLESPACE FIN_DATA,
SUBPARTITION ABC_Z2009_SP_1112 VALUES (1112) TABLESPACE FIN_DATA,
SUBPARTITION ABC_Z2009_SP_1113 VALUES (1113) TABLESPACE FIN_DATA,
SUBPARTITION ABC_Z2009_SP_1133 VALUES (1133) TABLESPACE FIN_DATA,
SUBPARTITION ABC_Z2009_SP_1161 VALUES (1161) TABLESPACE FIN_DATA,
SUBPARTITION ABC_Z2009_SP_1164 VALUES (1164) TABLESPACE FIN_DATA,
SUBPARTITION ABC_Z2009_SP_1165 VALUES (1165) TABLESPACE FIN_DATA,
SUBPARTITION ABC_Z2009_SP_1167 VALUES (1167) TABLESPACE FIN_DATA,
SUBPARTITION ABC_Z2009_SP_1168 VALUES (1168) TABLESPACE FIN_DATA,
SUBPARTITION ABC_Z2009_SP_1169 VALUES (1169) TABLESPACE FIN_DATA,
SUBPARTITION ABC_Z2009_SP_1201 VALUES (1201) TABLESPACE FIN_DATA,
SUBPARTITION ABC_Z2009_SP_1223 VALUES (1223) TABLESPACE FIN_DATA,
SUBPARTITION ABC_Z2009_SP_1228 VALUES (1228) TABLESPACE FIN_DATA,
SUBPARTITION ABC_Z2009_SP_1229 VALUES (1229) TABLESPACE FIN_DATA,
SUBPARTITION ABC_Z2009_SP_1230 VALUES (1230) TABLESPACE FIN_DATA,
SUBPARTITION ABC_Z2009_SP_1231 VALUES (1231) TABLESPACE FIN_DATA,
SUBPARTITION ABC_Z2009_SP_1232 VALUES (1232) TABLESPACE FIN_DATA,
SUBPARTITION ABC_Z2009_SP_1233 VALUES (1233) TABLESPACE FIN_DATA,
SUBPARTITION ABC_Z2009_SP_1234 VALUES (1234) TABLESPACE FIN_DATA ),
PARTITION ABC_Z2010 VALUES LESS THAN (2010)
LOGGING
NOCOMPRESS
TABLESPACE FIN_DATA
PCTFREE 10
INITRANS 1
MAXTRANS 255
STORAGE (
INITIAL 64K
NEXT 64K
MINEXTENTS 1
MAXEXTENTS 2147483645
PCTINCREASE 0
BUFFER_POOL DEFAULT
( SUBPARTITION ABC_2010_SP_1101 VALUES (1101) TABLESPACE FIN_DATA,
SUBPARTITION ABC_2010_SP_1102 VALUES (1102) TABLESPACE FIN_DATA,
SUBPARTITION ABC_2010_SP_1108 VALUES (1108) TABLESPACE FIN_DATA,
SUBPARTITION ABC_2010_SP_1111 VALUES (1111) TABLESPACE FIN_DATA,
SUBPARTITION ABC_2010_SP_1112 VALUES (1112) TABLESPACE FIN_DATA,
SUBPARTITION ABC_2010_SP_1113 VALUES (1113) TABLESPACE FIN_DATA,
SUBPARTITION ABC_2010_SP_1133 VALUES (1133) TABLESPACE FIN_DATA,
SUBPARTITION ABC_2010_SP_1161 VALUES (1161) TABLESPACE FIN_DATA,
SUBPARTITION ABC_2010_SP_1164 VALUES (1164) TABLESPACE FIN_DATA,
SUBPARTITION ABC_2010_SP_1165 VALUES (1165) TABLESPACE FIN_DATA,
SUBPARTITION ABC_2010_SP_1167 VALUES (1167) TABLESPACE FIN_DATA,
SUBPARTITION ABC_2010_SP_1168 VALUES (1168) TABLESPACE FIN_DATA,
SUBPARTITION ABC_2010_SP_1169 VALUES (1169) TABLESPACE FIN_DATA,
SUBPARTITION ABC_2010_SP_1201 VALUES (1201) TABLESPACE FIN_DATA,
SUBPARTITION ABC_2010_SP_1223 VALUES (1223) TABLESPACE FIN_DATA,
SUBPARTITION ABC_2010_SP_1228 VALUES (1228) TABLESPACE FIN_DATA,
SUBPARTITION ABC_2010_SP_1229 VALUES (1229) TABLESPACE FIN_DATA,
SUBPARTITION ABC_2010_SP_1230 VALUES (1230) TABLESPACE FIN_DATA,
SUBPARTITION ABC_2010_SP_1231 VALUES (1231) TABLESPACE FIN_DATA,
SUBPARTITION ABC_2010_SP_1232 VALUES (1232) TABLESPACE FIN_DATA,
SUBPARTITION ABC_2010_SP_1233 VALUES (1233) TABLESPACE FIN_DATA,
SUBPARTITION ABC_2010_SP_1234 VALUES (1234) TABLESPACE FIN_DATA ),
PARTITION ABC_Z2011 VALUES LESS THAN (2011)
LOGGING
NOCOMPRESS
TABLESPACE FIN_DATA
PCTFREE 10
INITRANS 1
MAXTRANS 255
STORAGE (
INITIAL 64K
NEXT 64K
MINEXTENTS 1
MAXEXTENTS 2147483645
PCTINCREASE 0
BUFFER_POOL DEFAULT
( SUBPARTITION ABC_2011_SP_1101 VALUES (1101) TABLESPACE FIN_DATA,
SUBPARTITION ABC_2011_SP_1102 VALUES (1102) TABLESPACE FIN_DATA,
SUBPARTITION ABC_2011_SP_1108 VALUES (1108) TABLESPACE FIN_DATA,
SUBPARTITION ABC_2011_SP_1111 VALUES (1111) TABLESPACE FIN_DATA,
SUBPARTITION ABC_2011_SP_1112 VALUES (1112) TABLESPACE FIN_DATA,
SUBPARTITION ABC_2011_SP_1113 VALUES (1113) TABLESPACE FIN_DATA,
SUBPARTITION ABC_2011_SP_1133 VALUES (1133) TABLESPACE FIN_DATA,
SUBPARTITION ABC_2011_SP_1161 VALUES (1161) TABLESPACE FIN_DATA,
SUBPARTITION ABC_2011_SP_1164 VALUES (1164) TABLESPACE FIN_DATA,
SUBPARTITION ABC_2011_SP_1165 VALUES (1165) TABLESPACE FIN_DATA,
SUBPARTITION ABC_2011_SP_1167 VALUES (1167) TABLESPACE FIN_DATA,
SUBPARTITION ABC_2011_SP_1168 VALUES (1168) TABLESPACE FIN_DATA,
SUBPARTITION ABC_2011_SP_1169 VALUES (1169) TABLESPACE FIN_DATA,
SUBPARTITION ABC_2011_SP_1201 VALUES (1201) TABLESPACE FIN_DATA,
SUBPARTITION ABC_2011_SP_1223 VALUES (1223) TABLESPACE FIN_DATA,
SUBPARTITION ABC_2011_SP_1228 VALUES (1228) TABLESPACE FIN_DATA,
SUBPARTITION ABC_2011_SP_1229 VALUES (1229) TABLESPACE FIN_DATA,
SUBPARTITION ABC_2011_SP_1230 VALUES (1230) TABLESPACE FIN_DATA,
SUBPARTITION ABC_2011_SP_1231 VALUES (1231) TABLESPACE FIN_DATA,
SUBPARTITION ABC_2011_SP_1232 VALUES (1232) TABLESPACE FIN_DATA,
SUBPARTITION ABC_2011_SP_1233 VALUES (1233) TABLESPACE FIN_DATA,
SUBPARTITION ABC_2011_SP_1234 VALUES (1234) TABLESPACE FIN_DATA )
NOCOMPRESS
NOCACHE
PARALLEL ( DEGREE DEFAULT INSTANCES DEFAULT )
MONITORING;
CREATE UNIQUE INDEX TRADING_FIN_SUMMARY1P ON TRADING_FIN
(ITEM, LOCATION, YEAR, WEEKNO)
LOGGING
TABLESPACE FIN_DATA
PCTFREE 10
INITRANS 2
MAXTRANS 255
STORAGE (
INITIAL 64K
NEXT 64K
MINEXTENTS 1
MAXEXTENTS 2147483645
PCTINCREASE 0
BUFFER_POOL DEFAULT
NOPARALLEL;
CREATE INDEX TRADING_FIN__IDX_BRANDP ON TRADING_FIN
(YEAR, WEEKNO, GROUP_NO)
LOGGING
TABLESPACE FIN_DATA
PCTFREE 10
INITRANS 2
MAXTRANS 255
STORAGE (
INITIAL 64K
NEXT 64K
MINEXTENTS 1
MAXEXTENTS 2147483645
PCTINCREASE 0
BUFFER_POOL DEFAULT
NOPARALLEL;
ALTER TABLE TRADING_FIN ADD (
CONSTRAINT TRADING_FIN_SUMMARY1P
PRIMARY KEY
(ITEM, LOCATION, YEAR, WEEKNO)
USING INDEX
TABLESPACE FIN_DATA
PCTFREE 10
INITRANS 2
MAXTRANS 255
STORAGE (
INITIAL 64K
NEXT 64K
MINEXTENTS 1
MAXEXTENTS 2147483645
PCTINCREASE 0
Thanks

Similar Messages

  • How Increase performance of delete operation

    Hi,
    How Increase performance of delete operation. This delete is done on a table which has around millions of records and loaded back every day .
    The statement is in a procedure and is as follows.
    #$%%$#$;
    commit;
    delete from TVRBC_SITE_ROLLUP_T;
    commit;

    Hi,
    execute immediate 'truncate table TVRBC_SITE_ROLLUP_T';
    Regards,
    Oleg
    Message was edited by:
    tsiboleg

  • How to find the deleted data in tables

    guys,
    how to find the deleted data in tables example: i want to see whether anyone deleted data in MB5B report tables like mbew, etc.,
    regards,

    Hi,
    MBEWH is actually the history table of MBEW. It will record all the changes. As I have told you earlier if you have deleted the record dirctly from the table then it will not come even in the table MBEWH
    That means no changes have been made.
    regards

  • How to cpature hard deletes in custom table?

    Hello Team,
    We have custom table in SAP attached to the application tcode.
    As per business requirement, user can delete few items in transacation( hard deletes).
    We are planning to delete these records from custom table if user delete them in Tcode. However the we need track all of these deleted records.
    Since the record physically deleted from this table, please let me know how to capture the deleted record.
    I heard about CDPOS and CDHDR not sure this table has deleted records. and also DBTABLOG as well.
    What is main diffrence between CDPOS/CDHDR with DBTABLOG interms tracking these deleted records. Our basis team recommending not use DBTABLOG table, since its huge table and its hard for them to archvie.
    Like to listen expert advices.
    Thanks
    Angelo

    Rob,
    Do you want me write Z program to read hard deletes from DBTABLOG and update another Ztable that stores only delted records/
    Pls advice,
    Thanks
    Angelo

  • How to perform DML Operations on Spatial Table Using ADF

    Hi
    I have an urgent requirement. I have a table with Spatial column. I have generated Business components based on Spatial Table.
    Now I have to perform Create,Read,Update and Delete operations using ADF Business Components on Spatial Table.
    I have written custom create(),read(),update() and delete() methods in my Application Module and i have to implement those methods.
    Can any one help me out how to acheive above four functionalities using ADF Business Components.
    Thanks in Advance

    HI,
    see this example.
    u can do like this.
    DATA: BEGIN OF seats OCCURS 0,
            carrid   TYPE sflight-carrid,
            connid   TYPE sflight-connid,
            seatsocc TYPE sflight-seatsocc,
          END OF seats.
    DATA seats_tab LIKE HASHED TABLE OF seats
                   WITH UNIQUE KEY carrid connid with header line.
    SELECT carrid connid seatsocc
           FROM sflight
           INTO table seats.
    loop at seats.
      COLLECT seats INTO seats_tab.
    endloop.
    LOOP AT seats_tab.
    write:/ seats_tab-carrid,seats_tab-connid,seats_tab-seatsocc.
    ENDLOOP.
    rgds,
    bharat.

  • How to restore long deleted files to a new computer from Time Machine

    My MacBook has a 250 GB hard drive.  I routinely back up to my 1 TB external drive via Time Machine.  Sometimes, my MacBook gets full, and I delete movies, TV shows, etc.  I can then add new stuff to the MacBook, which I then back up to the external drive.  Eventually, I'll get a new Mac with at least 1 TB memory.  How would I install all my old files and media to this new computer, even items long since removed from my prior MacBook and not present at the last Time Machine backup?  I'm not sure I can remember all the files, but I certainly want them.

    Thanks seventy one.  I think I phrased my question poorly.  All of the files are on the Time Machine drive.  But not all of them were put there on the most recent backup, since they'd been deleted from the MacBook long ago.  How do I collect all the files on Time Machine, not just the ones present on the most recent backup, to place on a new computer with a larger hard drive.  For example, files A and B were backed up last year, but subsequently deleted from the MacBook.  But they are on the Time Machine drive.  I then get a new computer, but don't remember all the files like A and B, nor when they were present, nor where they were located.  Do I have to scour Time Machine, across all backup dates, to find all my old files?

  • How to perform CRUD operations on joined tables created with Fluent API on Azure Mobile Services?

    I've been following the
    Field Engineer example project from the Windows Development Center to guide into mapping many-to-many relationships on my model. What's been bothering me is how to insert entries into many-to-many relationships.
    Take my model as example:
    An Organization can have many Users.
    An User can belong to many Organizations.
    My model class for User looks like this:
    public class User
    public User()
    this.Organizations = new HashSet<Organization>();
    public int Id { get; set; }
    public string Email { get; set; }
    public string Password { get; set; }
    public string PasswordSalt { get; set; }
    public string FirstName { get; set; }
    public string LastName { get; set; }
    public bool Active { get; set; }
    public string Picture { get; set; }
    public string PictureMimeType { get; set; }
    public bool Confirmed { get; set; }
    public string ConfirmationKey { get; set; }
    [JsonIgnore]
    public virtual ICollection<Organization> Organizations { get; set; }
    My UserDTO class is this:
    public class UserDTO : EntityData
    public string Email { get; set; }
    public string Password { get; set; }
    public string PasswordSalt { get; set; }
    public string FirstName { get; set; }
    public string LastName { get; set; }
    public bool Active { get; set; }
    public string Picture { get; set; }
    public string PictureMimeType { get; set; }
    public bool Confirmed { get; set; }
    public string ConfirmationKey { get; set; }
    My Organization class:
    public class Organization
    public Organization()
    this.Users = new List<User>();
    public string Id { get; set; }
    public string Title { get; set; }
    public string LegalName { get; set; }
    public string TaxReference { get; set; }
    [JsonIgnore]
    public virtual ICollection<User> Users { get; set; }
    My OrganizationDTO class:
    public class OrganizationDTO : EntityData
    public string Title { get; set; }
    public string LegalName { get; set; }
    public string TaxReference { get; set; }
    public virtual ICollection<UserDTO> Users { get; set; }
    With those classes in mind I created the controller classes, I mapped the DTO and the Model classes using AutoMapper as follows:
    cfg.CreateMap<Organization, OrganizationDTO>()
    .ForMember(organizationDTO => organizationDTO.Id,
    map => map.MapFrom(organization => MySqlFuncs.LTRIM(MySqlFuncs.StringConvert(organization.Id))))
    .ForMember(organizationDTO => organizationDTO.Users,
    map => map.MapFrom(organization => organization.Users));
    cfg.CreateMap<OrganizationDTO, Organization>()
    .ForMember(organization => organization.Id,
    map => map.MapFrom(organizationDTO => MySqlFuncs.LongParse(organizationDTO.Id)))
    .ForMember(organization => organization.Users,
    map => map.Ignore());
    Using Fluent API, I defined the relationship between these two entities using an EntityTypeConfiguration class like this:
    public class UserEntityConfiguration : EntityTypeConfiguration<User>
    public UserEntityConfiguration()
    this.Property(u => u.Id).HasDatabaseGeneratedOption(DatabaseGeneratedOption.Identity);
    this.HasMany<Organization>(u => u.Organizations).WithMany(o => o.Users).Map(uo =>
    uo.MapLeftKey("UserId");
    uo.MapRightKey("OrganizationId");
    uo.ToTable("OrganizationsUsers");
    I created a TableController class to handle UserDTO and OrganizationDTO, I have no problem inserting new Users or new Organizations, but the endpoints from each TableController class only allows me to add Users or Organizations individually as far as I understand.
    To create an entry into the OrganizationsUser table, how can I achieve this?
    I was thinking a PATCH request should be a way to do this, but is it the right way? Do I have to define a TableController for this? How can I expose the Insert, Update, Select and Delete operation for the elements in this relationship? What would be the JSON
    to be sent to the endpoints?

    Hi,
    if you accept lists to hold the LOV data, then here is an example : http://www.oracle.com/technetwork/developer-tools/adf/learnmore/index-101235.html#CodeCornerSamples --> sample 70
    Frank

  • How to perform aritmetic operations on interna table's fields ?

    i have an internal table containing entries from ekpo table.
    while displaying the internal table's entries i would like to add the field containing net price for the same po numbers.
    so, how do i perform arithmetic operations on this itab ? plz help..

    HI,
    see this example.
    u can do like this.
    DATA: BEGIN OF seats OCCURS 0,
            carrid   TYPE sflight-carrid,
            connid   TYPE sflight-connid,
            seatsocc TYPE sflight-seatsocc,
          END OF seats.
    DATA seats_tab LIKE HASHED TABLE OF seats
                   WITH UNIQUE KEY carrid connid with header line.
    SELECT carrid connid seatsocc
           FROM sflight
           INTO table seats.
    loop at seats.
      COLLECT seats INTO seats_tab.
    endloop.
    LOOP AT seats_tab.
    write:/ seats_tab-carrid,seats_tab-connid,seats_tab-seatsocc.
    ENDLOOP.
    rgds,
    bharat.

  • How to perform insert record in Advance table .

    Dear Friends ,
    I have a requirement in OAF ,where i have to make use of advance table and perform
    insert operation in Master Detail page.
    I have sequence number being generated in header region using the same sequence number
    i wish to insert multiple line level records .
    How can i achieve this , kindly share your suggestions .
    Thanks in Advance ,
    Keerthi

    Hi Gyan,
    I have the same requirement like master detail page development. I have developed up to view link crreation. Is there any further steps to be done, please explain in details.
    Thanks in Advance,
    Antonyraj.M

  • How to implement logical delete in on table

    Hi,
    I am working in Jdev11.1.1.3.0
    I have one requirement, where i need to delete a row from the table when i click on delete button. But it shouldn't delete/remove from the VO, when i did execute vo.hasNext i should still need this row.
    Can any one suggest me the best way.
    -Thanks.

    hi,
    https://forums.oracle.com/thread/2225878
    http://www.jobinesh.com/2011/05/soft-deletion-of-rows.html
    http://deepakcs.blogspot.com/2013/01/ejb-dc-deleting-multi-selected-rows.html
    https://forums.oracle.com/thread/2534813
    http://www.youtube.com/watch?v=zl5QjihrU0k
    thx.

  • How to perform operations on table control

    hello experts,
                         will u plz tell me how to perform operations like delete and update on tablecontrol in module pool.
                                thanks in advance,

    Hey Aravind,
    In case you want to delete just from your table control and not from database table, then you can use the commands:
    clear <workarea_name>
    delete <workarea_name>
    for your selected rows.
    And for deleting from database tables also, use:
    Delete from <Database_table_name> where <where_clause>.
    clear <workarea_name>
    delete <workarea_name>
    This will delete both from the table control and database table also.
    Reward if it proved useful to you.
    Regards
    Natasha Garg

  • How to delete record from table control using BDC?

    Hello friends,
    I am running a BDC program to delete records.
    I have file with following records and i got these records into t_itab.
    Material     Plant     Start date     End date     Cost
    MQ100001     S001     09/01/2008     09/31/2008     55.00
    MQ100004     S002     09/01/2008     09/31/2008     56.00
    MQ100008     S003     09/01/2008     09/31/2008     57.00
    Now, I have BDC transaction in which table control screen which contains following structure.
    MQ100001     S001     09/01/2008     09/31/2008     55.00
    MQ100002     S002     09/01/2008     09/31/2008     56.00
    MQ100004     S003     09/01/2008     09/31/2008     47.00     
    MQ100005     S004     09/01/2008     09/31/2008     25.00
    MQ100006     S012     09/01/2008     09/31/2008     76.00
    MQ100007     S033     09/01/2008     09/31/2008     17.00
    MQ100008     S011     09/01/2008     09/31/2008     95.00
    MQ100009     S002     09/01/2008     09/31/2008     46.00
    I have recorded from SHDB in which first record will be delete.
    So, when i loop through t_itab,instead of deleting MQ100001,MQ100004 and MQ100008 from BDC screen,
    it is deleting MQ100001,MQ100002 and MQ100004 (first record for each process ).
    Which i don't want to.
    Is there any facility in BDC to put records on top which i want to delete?
    Please guide me.
    Regards,
    RH

    One option is to identify the table and find out the location as the number of row which should be deleted from the table and then in the bdc program instead of postioning the cursor on the row 1(using the statement perform bdc_cursor ....(01)), replace the 01 with the row number.
    Second option is that if a filter control is available for the table control, then filter the data each and every time with the material number to be deleted and then delete the first row.
    Regards
    Farzan

  • How to record the records deleted in a table

    Hi Experts
    I want to run a report as a batch which should deleted the records
    which are sysdate - 60 and The report should log the number of records deleted
    from each table at End Of Run.
    Criteria for selecting records to be deleted are as follows:
    1.     ZINT_DATA
    u2022     ZINT_DATA.CREATED_ON <= (Today u2013 60 Days)
                   and ZINT_DATA.STATUS = u2018OKu2019
    So I want to create a table for log history recorded as
    Delete Date         Log description
    01.01.2008        1500 rows deleted
    30.03.2008        2000 rows deleted.
    30.04.2008        300  rows deleted.
    Eg The table are ZINT_DATA.
    The report starts like this
    REPORT z_eslp_command.
    DATA:
      fs_zint_data TYPE zint_data.
    DATA:
      t_zint_data TYPE
              TABLE OF
                      ZINT_DATA.
    START-OF-SELECTION.
    SELECT *
       FROM ZINT_DATA
       INTO TABLE t_ZINT_DATA PACKAGE SIZE 10000.
    ENDSELECT.
    LOOP AT t_zint_data INTO fs_zint_data.
    INSERT INTO ZINT_DATA_DEL
          VALUES fs_zint_data.
    select count(*) from zint_data_del.
    ENDLOOP.
    IF sy-subrc EQ 0.
      WRITE:
        'DATA INSERTED FROM ZINT_DATA into ZINT_DATA_DEL'.
    ENDIF.
    But Instead of creating another table , I want only log to be recorded as described.
    Thanks
    Regards
    Piroz

    Hi Kiran
    See the final modification of the report but I am getting an error as
    Field " Corresponding_fields" is unknown, it is neithere in one of the specified tables nor defined by a
    DATA statement, but I have already created an internal table itab1 , could you check and revert with the correction.
    REPORT  ZSD1DELETION                .
    TYPE-POOLS:SLIS.
    *Used in ZSDI_INTERFACE1 Program.
    TABLES:ZINT_DATA_DEL  . 
    *DATA: BEGIN OF ITAB1 OCCURS 0.
    *DATA: SL_NO TYPE SY-TABIX.
         INCLUDE STRUCTURE zint_data_del.
    *DATA:END OF ITAB1.
    DATA: BEGIN OF ITAB1 occurs 0 ,
          MANDT type zint_data_del-mandt,
          ZINT_ID type zint_data_del-zint_id,
          ZINT_TY type zint_data_del-zint_ty,
          CREATED_ON type zint_data_del-created_on,
          KEY_VAL type zint_data_del-key_val,
          SEQUENCE type zint_data_del-sequence,
          STATUS type zint_data_del-status,                 
          LENGTH type zint_data_del-length,           
          RAW_DATA type zint_data_del-raw_data,       
          end of itab1.
    *DATA: i_data TYPE TABLE OF ITAB1, " internal table
    *wa_data TYPE ITAB1. " work area
    DATA:LINE1(10) TYPE C,
         LINE2(10) TYPE C,
         date1(10) type c,
         date2(10) type c,
         name1(60),
         string1(100),
         title1(65),
         title2(100) type c,
         FNAME TYPE STRING.
    *Declarations for ALV
    DATA:itfieldcat TYPE slis_t_fieldcat_alv WITH HEADER LINE.
    DATA:itrepid TYPE sy-repid.
    itrepid = sy-repid.
    DATA:itevent TYPE slis_t_event.
    DATA:itlistheader TYPE slis_t_listheader.
    DATA:walistheader LIKE LINE OF itlistheader.
    DATA:itlayout TYPE slis_layout_alv.
    DATA:top TYPE slis_formname.
    DATA:itsort TYPE slis_t_sortinfo_alv WITH HEADER LINE.
    SELECTION-SCREEN BEGIN OF BLOCK B1 WITH FRAME TITLE TEXT-001.
    *PARAMETERS:P_WERKS LIKE BSEG-WERKS.
    SELECT-OPTIONS: S_DATE FOR ZINT_DATA_DEL-CREATED_ON OBLIGATORY.              
    SELECTION-SCREEN END OF BLOCK B1.
    *Validations w.r.t the Date
    AT SELECTION-SCREEN ON S_DATE.
    IF S_DATE IS INITIAL.
    MESSAGE 'Enter the Date' type 'E'.
    *Records from 2007 can't be deleted.
    ELSEIF S_DATE-LOW+0(4) >= '2007' AND
           S_DATE-HIGH+0(4) >= '2007'.
    MESSAGE 'Records from the Year 2007 cannot  be Deleted' type 'E'.
    ENDIF.
    CONCATENATE  s_DATE-low6(2) '.' s_DATE-low4(2) '.' s_DATE-low+0(4)
    INTO date1.
    CONCATENATE  s_DATE-high6(2) '.' s_DATE-high4(2) '.' s_DATE-high+0(4)
    INTO date2.
    PERFORM GETDATA.
    *&      Form  DOWNLOAD
          text
    -->  p1        text
    <--  p2        text
    form GETDATA.
    SELECT * FROM ZINT_DATA_DEL
             INTO CORRESPONDING_FIELDS OF TABLE ITAB1
             WHERE CREATED_ON IN S_DATE.
    IF ITAB1[] IS NOT INITIAL.
    DESCRIBE TABLE ITAB1 LINES LINE1.
    PERFORM DELETION.
    PERFORM ALV.
    ELSE.
    MESSAGE 'No Data' type 'S'.
    ENDIF.
    endform.                    " GETDATA
    *&      Form  DELETION
          text
    -->  p1        text
    <--  p2        text
    form DELETION .
    DELETE FROM ZINT_DATA_DEL WHERE CREATED_ON IN S_DATE.
    endform.                    " DELETION
    *&      Form  alv
          Fieldcatalog for ALV Report
    FORM alv.
    LOOP AT ITAB1.
    ITAB1-SL_NO = SY-TABIX.
    MODIFY ITAB1.
    ENDLOOP.
      DEFINE m_fieldcat.
        itfieldcat-fieldname = &1.
        itfieldcat-col_pos = &2.
        itfieldcat-seltext_l = &3.
        itfieldcat-do_sum = &4.
        itfieldcat-outputlen = &5.
        itfieldcat-edit = &6.
        append itfieldcat to itfieldcat.
        clear itfieldcat.
      END-OF-DEFINITION.
      m_fieldcat 'MANDT'     '' 'Client' '' 03 ''.
      m_fieldcat 'ZINT_ID' ''   'Id' '' 10 ''.
      m_fieldcat 'ZINT_TY'   '' 'Type.'  '' 05 ''.
      m_fieldcat 'CREATED_ON' '' 'Date Created on' '' 25 ''.
      m_fieldcat 'KEY_VAL'       '' 'key value'  '' 04  ''.
      m_fieldcat 'SEQUENCE' '' 'sequence' '' 06 ''  .
      m_fieldcat 'STATUS'   '' 'status.' '' 10 ''.
      m_fieldcat 'LENGTH'    '' 'Length.' '' 18 ''.
      m_fieldcat 'RAW_DATA'    '' 'Raw Data' '' 15 '' .
      itlayout-zebra = 'X'.
      itlayout-colwidth_optimize = 'X'.
      CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
          EXPORTING
            i_callback_program      = sy-repid
            is_layout               = itlayout
          i_callback_user_command =  ' '
            i_callback_top_of_page  = 'TOP'
            it_fieldcat             = itfieldcat[]
            i_save                  = 'A'
         is_variant              = ITVARIANT
            it_events               = itevent[]
         is_print                = ITPRINTPARAMS
            it_sort                 = itsort[]
          TABLES
            t_outtab                = itAB1
            EXCEPTIONS
            program_error           = 1
            OTHERS                  = 2.
      IF sy-subrc <> 0.
        MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
                WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
      ENDIF.
    ENDFORM.                    "alv
    *&      Form  TOP
        Top of page for ALV Report
    FORM top.
       CALL FUNCTION 'REUSE_ALV_EVENTS_GET'
         EXPORTING
            i_list_type           = 0
         IMPORTING
            et_events             = itevent
    EXCEPTIONS
      LIST_TYPE_WRONG       = 1
      OTHERS                = 2
      IF sy-subrc  0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
    string1 = 'Records from'.
    CONCATENATE string1 date1 'to' date2 INTO title1
    SEPARATED BY space.
    walistheader-typ = 'H'.
    walistheader-info = title1.
    APPEND walistheader TO itlistheader.
    CONCATENATE 'Records Deleted' '-' LINE1 INTO title2.
    walistheader-typ = 'H'.
    walistheader-info = title2.
    APPEND walistheader TO itlistheader.
      CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
        EXPORTING
          it_list_commentary      = itlistheader
        I_LOGO                   = ''.
        I_END_OF_LIST_GRID       =
       ENDIF.
      CLEAR itlistheader.
    ENDIF.
    ENDFORM.                    "TOP
    Regrds
    Piroz

  • Reg:-How to delete PO from Table

    Hi,
        I need to know how to delete PO from the table.I know for item deletion.
    Edited by: Venkadesh on May 22, 2009 2:53 PM

    Hi
    PO's cannot be deleted from the table, we can only archive them from the data base being used.
    Deletion flag in the PO will not remove data from table.
    Thanks & Regards
    Kishore

  • How to delete data in table control

    Hi,
    I am doing module pool programming. After the user enters the data in table control after saving the data. if the user wants to  remove the line item the line item shd be removed from the screen and data base.
    Please Give me vaulable Suggestions
    Regards

    Hi,
    Screen 8002 (with table control) --> select records --> press delete button --> delete selected records
    Now you wan to delete those records selected by the user at runtime when DELETE button is clicked.
    Take another internal table and work area same as the initial internal table and work area used in screen 8002 which is to be used to delete the selected data.
    Take the names of the input/output fields as work_area-field_name and select column in table control as work_area-flag.
    Also take a flag field of size 1 datatype character as the last field in the internal table and work area while declaration.
    You must have passed a code in PBO of the screen for reading internal table into the table control.
    So it reads the internal table into the table control whenever you perform any action on use command.
    All you need to do is to write a code to modify the internal table form the table control while performing any user action.
    Remember to change the LINE SEL option in attributes of table control as MULTIPLE.
    At screen logic,
    PROCESS BEFORE OUTPUT.
      MODULE status_8002. "for pf-status
      LOOP WITH CONTROL po_tab. "po_tab is table control
        MODULE pass_data. "to pass data into table control from internal table
      ENDLOOP.
    PROCESS AFTER INPUT.
      MODULE user_command_8002. "for user command(back and exit)
      LOOP WITH CONTROL po_tab.
        MODULE modify_data. "to modify data from table control into table control
      ENDLOOP.
      MODULE delete. "to delete the selected records
    In PBO,
    *&      Module  STATUS_8002 OUTPUT
    MODULE status_8002 OUTPUT.
      SET pf-status 'ZAB_PFSTA'. " pf-status
      DATA : line_count TYPE i.
      DESCIRBE TABLE it_ekpo
      LINES line_count.
      po_tab-lines = line_count + 10.
      " to make table control scrollable
    ENDMODULE.                 " STATUS_8002  OUTPUT
    *&      Module  PASS_DATA  OUTPUT
    MODULE pass_data OUTPUT.
      READ TABLE it_ekpo into wa_ekpo INDEX po_tab-current_line.
    ENDMODULE.                 " PASS_DATA  OUTPUT
    "it_ekpo is internal table and wa_ekpo is the work area
    In PAI,
    *&      Module  MODIFY_DATA  INPUT
    MODULE MODIFY_DATA INPUT.
      MODIFY IT_EKPO INDEX PO_TAB-CURRENT_LINE FROM WA_EKPO.
      "modify records from table control into the internal table
    ENDMODULE.                 " MODIFY_DATA  INPUT
    *&      Module  DELETE  INPUT
    MODULE DELETE INPUT.
      OK_CODE = SY-UCOMM.
      CASE OK_CODE.
        WHEN 'DELETE'. "when delete button is clicked
          SORT IT_EKPO BY FLAG DESCENDING. "sort by flag(selection column value)
          CLEAR WA_EKPO1.
          CLEAR WA_EKPO.
          REFRESH IT_EKPO1.
          LOOP AT IT_EKPO INTO WA_EKPO WHERE FLAG = 'X'.
            DATA : J TYPE I.
            CLEAR J.
            J = SY-TABIX. "assign index value if a record is selected
            MOVE-CORRESPONDING WA_EKPO TO WA_EKPO1. "append selected records to another
            "work area and append to another internal table to delete
            APPEND WA_EKPO1 TO IT_EKPO1.
            DELETE IT_EKPO. "delete the selected records from initial internal table
            " to reflect the changes on the table control
          ENDLOOP.
          IF J = 0.
            MESSAGE I006. "if no record selected
          ELSE. "if some records are selected
            DELETE ZEKPO FROM TABLE IT_EKPO1. "delete from database table
            COMMIT WORK.
            IF SY-SUBRC = 0.
              MESSAGE S007. "success message (records deleted)
            ENDIF.
          ENDIF.
      ENDCASE.
    ENDMODULE.                 " DELETE  INPUT
    Now at PAI, you have delete records and these changes are reflected back to the internal table.
    Now when PBO is executed it will again read the initial internal table and will not show the deleted records.
    Hope this solves your problem.
    Thanks & Regards,
    Tarun Gambhir

Maybe you are looking for

  • How to disable Cool N Quiet driver when it isnt in the bios or registry for Roxio game capture?

    1. HP G60-120 US Notebook PC 2. Windows 7 32-bit 3. No error messages 4. No changes before issue occured. I was told by Roxio (company of the capture card I bought to record gameplay on my Xbox) to call HP and get my Cool N Quiet driver disabled afte

  • Photostream/Cameraroll Photos not showing up on iPhone 4S

    I have been taking photos from lock screen (home button twice, photo icon on screen, plus volume button), and the photos are not showing up in Camera Roll on the iphone 4s. They show up in Photostream on mac, but not on the phone its self. Help, Idea

  • Imported Stills are Over-saturated

    We're using PPro CS4 on a 64-bit Vista machine.  We've imported video into our timeline and it looks fine.  However, when we import the JPEGs we made in Photoshop CS4, they come in much more saturated than they show in Bridge.  We've checked in Camer

  • Business Process mapping

    Dear All, I want to issue a stock for testing and when testing is completed it has to update only qty and value should be zero.\ Regards Subhash

  • Where can I find release notes for ECC EHP4 SPS 03

    SAP used to deliver release notes. I want to find release notes for EHP4 SP03 but can't locate documents with what each Stack delivers. Also same for java stacks? any idea where I can get this information? Thanks Wayland Yutani