Delete records from a Table. Please help

Hello Folks,
I have a table that contains 7 records with a Button to delete each record.
I am unable to delete any records from the table.
Please can some one just have a look into my class and tell me how
to delete a record from the table when the button is clicked.
You can also run this class from the your command Prompt
Just cut this and create a new java file.
Please assist.
Code Attached :
import javax.swing.*;
import javax.swing.table.*;
import javax.swing.event.*;
import java.awt.event.*;
import java.awt.*;
import java.util.*;
public class ButtonTableFactory {
public static JTable createTable(Vector data, String buttonLabel, ActionListener action) {
return createTable(data.iterator(), buttonLabel, action);
public static JTable createTable(
Iterator dataIterator,
String buttonLabel,
ActionListener action) {
DefaultTableModel model = new DefaultTableModel() {
public boolean isCellEditable(int row, int col) {
return col == 1;
model.setColumnCount(2);
while (dataIterator.hasNext()) {
Object[] row = { dataIterator.next().toString(), null };
model.addRow(row);
DefaultTableColumnModel columnModel = new DefaultTableColumnModel();
columnModel.addColumn(new TableColumn(0, 100));
columnModel.addColumn(new TableColumn(1, 80,
new TableButtonCellRenderer(buttonLabel),
new TableButtonCellEditor(buttonLabel, action)
JTable table = new JTable(model, columnModel) {
public void valueChanged(ListSelectionEvent e) {
super.valueChanged(e);
table.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
return table;
private static class TableButtonCellRenderer implements TableCellRenderer {
final JButton button;
TableButtonCellRenderer(String buttonLabel) {
button = new JButton(buttonLabel);
public Component getTableCellRendererComponent(
JTable table,
Object value,
boolean isSelected,
boolean hasFocus, int row, int column) {
return button;
private static class TableButtonCellEditor
extends AbstractCellEditor
implements TableCellEditor, ActionListener {
final JButton button;
final ActionListener callback;
TableButtonCellEditor(String buttonLabel, ActionListener callback) {
button = new JButton(buttonLabel);
this.callback = callback;
button.addActionListener(this);
public Component getTableCellEditorComponent(
JTable table,
Object value,
boolean isSelected,
int row, int column) {
return button;
public Object getCellEditorValue() {
return null;
public void actionPerformed(ActionEvent e) {
button.getParent().requestFocus();
callback.actionPerformed(e);
static JTable table;
public static void main(String[] args) {
JFrame frame = new JFrame();
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
Vector items = new Vector();
for (int i = 0; i < 7; i++) {
items.add(Integer.toString(i));
ActionListener al = new ActionListener() {
public void actionPerformed(ActionEvent e) {
System.out.println("You clicked row: " + table.getSelectedRow());
table = ButtonTableFactory.createTable(items, "More:", al);
frame.getContentPane().add(new JScrollPane(table));
frame.pack();
frame.show();

This will get you closer:
import javax.swing.*;
import javax.swing.table.*;
import javax.swing.event.*;
import java.awt.event.*;
import java.awt.*;
import java.util.*;
public class ButtonTableFactory {
    private JTable table;
    private Vector items = new Vector();
    private JScrollPane scroll;
    private JPanel main;
    private ActionListener al;
    public static JTable createTable(Vector data, String buttonLabel, ActionListener action) {
        return createTable(data.iterator(), buttonLabel, action);
    public static JTable createTable(
            Iterator dataIterator,
            String buttonLabel,
            ActionListener action) {
        DefaultTableModel model = new DefaultTableModel() {
            public boolean isCellEditable(int row, int col) {
                return col == 1;
        model.setColumnCount(2);
        while (dataIterator.hasNext()) {
            Object[] row = { dataIterator.next().toString(), null };
            model.addRow(row);
        DefaultTableColumnModel columnModel = new DefaultTableColumnModel();
        columnModel.addColumn(new TableColumn(0, 100));
        columnModel.addColumn(new TableColumn(1, 80,
                new TableButtonCellRenderer(buttonLabel),
                new TableButtonCellEditor(buttonLabel, action)
        JTable table = new JTable(model, columnModel) {
            public void valueChanged(ListSelectionEvent e) {
                super.valueChanged(e);
        table.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
        return table;
    private static class TableButtonCellRenderer implements TableCellRenderer {
        final JButton button;
        TableButtonCellRenderer(String buttonLabel) {
            button = new JButton(buttonLabel);
        public Component getTableCellRendererComponent(
                JTable table,
                Object value,
                boolean isSelected,
                boolean hasFocus, int row, int column) {
            return button;
    private static class TableButtonCellEditor
            extends AbstractCellEditor
            implements TableCellEditor, ActionListener {
        final JButton button;
        final ActionListener callback;
        TableButtonCellEditor(String buttonLabel, ActionListener callback) {
            button = new JButton(buttonLabel);
            this.callback = callback;
            button.addActionListener(this);
        public Component getTableCellEditorComponent(
                JTable table,
                Object value,
                boolean isSelected,
                int row, int column) {
            return button;
        public Object getCellEditorValue() {
            return null;
        public void actionPerformed(ActionEvent e) {
            button.getParent().requestFocus();
            callback.actionPerformed(e);
    public void init() {
        main = new JPanel();
        main.setLayout(new BorderLayout());
        for (int i = 0; i < 7; i++) {
            items.add(Integer.toString(i));
        al = new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                System.out.println("You clicked row: " + table.getSelectedRow());
                items.remove(table.getSelectedRow());
                buildTable(items);
        buildTable(items);
    public void buildTable(Vector items) {
        table = ButtonTableFactory.createTable(items, "More:", al);
        scroll = new JScrollPane(table);
        main.removeAll();
        main.add(scroll);
        main.revalidate();
        main.repaint();
    public JPanel getContent() {
        return main;
    public static void main(String[] args) {
        ButtonTableFactory factory = new ButtonTableFactory();
        factory.init();
        JFrame frame = new JFrame();
        frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        frame.getContentPane().add(factory.getContent());
        frame.setSize(300, 300);
        frame.setVisible(true);
//        frame.pack();
//        frame.show();
}

Similar Messages

  • Need assistance searching records from multiple tables - Please Help!

    Hi, I've been trying to solve this problem for several weeks now, and I have exhausted all of my knowledge and experience.  I need help, and I hope someone here can give me some direction.
    I am using VB 2008, and the CR that comes bundled with VS 2008 Pro.  My database is a SQL Server 2005 CE v3.5 (a *.sdf file).  I am connecting to the database through a dataset, and I am displaying the report in a CrystalReportViewer.
    My dataset consistes of two tables:
    1) tblCustomers which has a primary key "CustID", and contains only customer contact and personal information. 
    2) tblDateVisited which has a primary key of "VisitID", but it also has a column titled "CustID". Basically, every time a customer visits the business, details of that visit are recorded in tblDateVisited, and that record is associated with the customer by their CustID.
    Here's what I'm trying to accomplish:  I want to be able to display only Customer records when the customer has visited and that visit matches certain criteria.  Right now, I am trying to match visits from the "tblVisitDate.PlayerType" column.  If the customer has ever had a visit where they matched a particular player type, I want to see those customer records.
    I don't know what I'm doing wrong, though.  I can search a dataset if I am only querying one table and pulling records from that table.  However, whenever I try to add a second table and perform queries on that table to get records from the first table, I can't return any records. 
    If it helps, I am trying to use one CrystalReportViewer to display multiple reports (user choice) and here's how I'm loading the report into the viewer:
    Me.tblCustomersTableAdapter.Fill(Me.dsPlayerTypeReports.tblCustomers)
    Me.tblDateVisitedTableAdapter.Fill(Me.dsPlayerTypeReports.tblDateVisited)
    Me.ReportFile.SetDataSource(dsPlayerTypeReports.Tables(1))
    I am suspicious that my problem is in the Tables(1) method.  It confuses me that I can only assign one table as a datasource when I obviously need access to two tables to make this selection work. 
    Whatever the case, I'm at the end of my rope with this one.  I'm not prone to giving up, but I'm at a dead end currently. 
    Any attempt to assist me with this will be greatly appreciated, successful or not.
    Thanks in advance!
    -Will

    No, I am connected via ADO.NET.  I don't think SQL CE can connect through ODBC (or if it can, I haven't been able to figure out how, yet).  So this isn't a stored procedure.
    When I examine the link, I can only choose an Inner Join or a Left Outer Join.  Right Outer and Full Outer are not available.  Could this be a problem with the dataset I'm using?
    Could you explain what you mean by display all of the records and then choose the selection criteria?

  • Delete records from multiple table

    Hi,
    I need to delete records from multiple tables using a single delete statement. Is it possible ? If so please let me know the procedure.
    Kindly Help.
    Thanks,
    Alexander.

    Hi Tim,
    Syntax of DELETE statement does not allow for multiple tables to be specified in this way. Infact, none of the DMLs allow you to specify table names like this.
    Technically, there are other ways of deleting from multiple tables with one statement.
    1. "Use a trigger":
    What was probably meant by this is that you have a driving-table on which you create a on-delete trigger. In this trigger, you write the logic for deleting from other tables that you want to delete from.
    This does mean a one-time effort of writing the trigger. But the actual DML operation of deleting from all the tables would be simply triggered by a delete on driving-table.
    2. Dynamic SQL:
    Write a PL/SQL code to open a cursor with table-names from which you want the data to be deleted from. In the cursor-for loop, write a dynamic SQL using the table-name to delete from that table.
    3. Using Foreign-Key constraint with Cascade-Delete:
    This I feel is a more 'cleaner' way of doing this.
    Having to delete data from multiple tables means that there is some kind of parent-child relationship between your tables. These relationships can be implemented in database using foreign-key constraints. While creating foreign-key constraint give the 'on delete cascade' clause to ensure that whenever data is deleted from parent-table, its dependent data is deleted from child-table.
    Using foreign-key constraint you can create a heirarchy of parent-child relationships and still your DELETE would be simple as you would only have to delete from parent-table.
    IMPORTANT: Implementing foreign-key constraints would also impact other DML operations that you should keep in mind.

  • Delete records from internal table

    hi all,
    i want to delete records from intenal table which are starting with a particular starting number .
    eg internal table
    10000
    20000
    90000
    91000
    92000
    88880
    i want delete the records starting with 9 i.e. 90000 91000 92000.
    Thanks in Adv
            RAJ

    You can test this piece of code.
    DATA:
    i_tab TYPE STANDARD TABLE OF mara,
    wa_tab TYPE mara.
    wa_tab-matnr = '1000'.
    APPEND wa_tab TO i_tab.
    CLEAR wa_tab.
    wa_tab-matnr = '1001'.
    APPEND wa_tab TO i_tab.
    CLEAR wa_tab.
    wa_tab-matnr = '1002'.
    APPEND wa_tab TO i_tab.
    CLEAR wa_tab.
    wa_tab-matnr = '1003'.
    APPEND wa_tab TO i_tab.
    CLEAR wa_tab.
    wa_tab-matnr = '2001'.
    APPEND wa_tab TO i_tab.
    CLEAR wa_tab.
    wa_tab-matnr = '3001'.
    APPEND wa_tab TO i_tab.
    CLEAR wa_tab.
    wa_tab-matnr = '4010'.
    APPEND wa_tab TO i_tab.
    CLEAR wa_tab.
    <REMOVED BY MODERATOR>
    Edited by: Alvaro Tejada Galindo on Aug 8, 2008 4:49 PM

  • HT203167 Hi. 2 days ago I bought a cd ATB. And yesterday I deleted everything from iTunes. Please help in recovering all purchased cd

    Hi. 2 days ago I bought a cd ATB. And yesterday I deleted everything from iTunes. Please help in recovering all purchased cd

    Did you just delete them from iTunes, or did you also tell it to delete the music files from your Mac ? If just from iTunes then they might still be stored under /Users/username/Music - if they are then you can add them back via File > Add To Library
    If not, then whether you can redownload music depends upon what country that you are in. If you can redownload music (and if you haven't changed countries since buying it and it's still in your country's store) then it should show under the Purchased link under Quicklinks on the right-hand side of the iTunes store homepage :
    If you can't redownload music then do you have a copy of it on your backup of your downloads/library that you can copy it back from ?

  • Maximum Open cursor  Exceeded error when deleting records from a table

    I have a strange problem.
    I have a table EMP_MASTER . Whenever I am trying to delete a record from this table, I am getting Maximum no. of open cursor exceeded error. But this error doesnot come when i delete from any other tables. And no. of open cursor is much lesser than OPEN_CURSOR parameter.
    All other tables (around 700) has foreign key constraint to this EMP_MASTER table for created_user paramater.
    Is it some thing like, when I am trying to delete a record from EMP_master, implicit cursor opens up and checks all referenced tables. and that limit gets exceeded ?
    Please help.
    Thanks,
    Raj

    Raji03 wrote:
    There is no trigger defined for this table.
    Is there a limit on which no.of references made to a column ? Because one column in this field, Emp no is being referenced in almost every other table. around 700 tables. Will it have any adverse effect ?That should have nothing to do with your problem directly. Again, those tables could have triggers defined on them and you are leaking cursors in one of those triggers (wild guess).
    An example of a table with many many others foreign key'd to it.
    create table parent_of_everything
       column1 number primary key
    insert into parent_of_everything select level from dual connect by level <= 1000;
    commit;
    --create 1000 tables all with foreign keys to the parent_of_everything
    begin
       for i in 1 .. 1000
       loop
          execute immediate 'create table child_' || i || ' (column1 number, column2 number, constraint child_' || i || '_fk foreign key (column1) references parent_of_everything (column1) on delete cascade)';
          execute immediate 'insert into child_' || i || ' select level, mod(level, ' || i || ') from dual connect by level <= 1000';
          commit;
       end loop;
    end;
    TUBBY_TUBBZ?delete parent_of_everything;
    1000 rows deleted.
    Elapsed: 00:02:53.03No problems were had (none were expected).
    Cleanup script.
    --remove the 1000 child tables
    begin
       for i in 1 .. 1000
       loop
          begin
             execute immediate 'drop table child_' || i || ' purge';
          exception when others
             then
                null;
          end;
       end loop;
    end;
    /

  • How to delete records from MTL_SYSTEM_ITEMS table

    Hello Experts,
    BANNER
    =======
    Oracle8i Enterprise Edition Release 8.1.7.4.0 - Production
    PL/SQL Release 8.1.7.4.0 - Production
    CORE     8.1.7.0.0     Production
    TNS for IBM/AIX RISC System/6000: Version 8.1.7.4.0 - Production
    NLSRTL Version 3.4.1.0.0 - Production
    I am working on Oracle Apps - 11.5.8 version.
    I have some doubts in deleting the records from MTL_SYSTEM_ITEMS table.
    There are few records which have junk characters and currently resides in table.
    I need to delete those records.
    But as per the approach; we should not delete any data directly from MTL table as it would cause huge impact.
    I have followed the below approach; but didnt worked out well.
    Script
    =======
    1)
    I have modified the below parameter in the MTL_SYSTEM_ITEMS_INTERFACE table --> SET_PROCESS_ID =0,TRANSACTION_TYPE ='DELETE',PROCESS_FLAG=1 .
    Apart from that; everything remains the same as in MTL_SYSTEM_ITEM table.
    2) Called the "Import Items" concurrent program.
    It got successfully completed. But record still exists in MTL_SYSTEM_ITEMS_INTERFACE table
    Your help is highly appreciated.
    Insert into MTL_SYSTEM_ITEMS_INTERFACE
       (SET_PROCESS_ID ,TRANSACTION_TYPE,PROCESS_FLAG ,INVENTORY_ITEM_ID, ORGANIZATION_ID, LAST_UPDATE_DATE, LAST_UPDATED_BY, CREATION_DATE, CREATED_BY, LAST_UPDATE_LOGIN,
    SUMMARY_FLAG, ENABLED_FLAG, DESCRIPTION, BUYER_ID, SEGMENT1, ATTRIBUTE3, ATTRIBUTE4, ATTRIBUTE9, ATTRIBUTE15, PURCHASING_ITEM_FLAG, SHIPPABLE_ITEM_FLAG,
    CUSTOMER_ORDER_FLAG, INTERNAL_ORDER_FLAG, SERVICE_ITEM_FLAG, INVENTORY_ITEM_FLAG, ENG_ITEM_FLAG, INVENTORY_ASSET_FLAG, PURCHASING_ENABLED_FLAG,
    CUSTOMER_ORDER_ENABLED_FLAG, INTERNAL_ORDER_ENABLED_FLAG, SO_TRANSACTIONS_FLAG, MTL_TRANSACTIONS_ENABLED_FLAG, STOCK_ENABLED_FLAG, BOM_ENABLED_FLAG, BUILD_IN_WIP_FLAG,
    REVISION_QTY_CONTROL_CODE, CATALOG_STATUS_FLAG, RETURNABLE_FLAG, TAXABLE_FLAG, QTY_RCV_EXCEPTION_CODE, ALLOW_ITEM_DESC_UPDATE_FLAG, RECEIPT_REQUIRED_FLAG,
    RFQ_REQUIRED_FLAG, QTY_RCV_TOLERANCE, LIST_PRICE_PER_UNIT, PRICE_TOLERANCE_PERCENT, ENFORCE_SHIP_TO_LOCATION_CODE, ALLOW_SUBSTITUTE_RECEIPTS_FLAG,
    ALLOW_UNORDERED_RECEIPTS_FLAG, DAYS_EARLY_RECEIPT_ALLOWED, DAYS_LATE_RECEIPT_ALLOWED, RECEIPT_DAYS_EXCEPTION_CODE, RECEIVING_ROUTING_ID, LOT_CONTROL_CODE,
    SHELF_LIFE_CODE, SHELF_LIFE_DAYS, SERIAL_NUMBER_CONTROL_CODE, RESTRICT_SUBINVENTORIES_CODE, RESTRICT_LOCATORS_CODE, LOCATION_CONTROL_CODE, ACCEPTABLE_EARLY_DAYS,
    PLANNING_TIME_FENCE_CODE, LEAD_TIME_LOT_SIZE, ACCEPTABLE_RATE_INCREASE, ACCEPTABLE_RATE_DECREASE, PLANNING_TIME_FENCE_DAYS, END_ASSEMBLY_PEGGING_FLAG,
    REPETITIVE_PLANNING_FLAG, BOM_ITEM_TYPE, PICK_COMPONENTS_FLAG, REPLENISH_TO_ORDER_FLAG, ATP_COMPONENTS_FLAG, ATP_FLAG, WIP_SUPPLY_TYPE, PRIMARY_UOM_CODE,
    PRIMARY_UNIT_OF_MEASURE, ALLOWED_UNITS_LOOKUP_CODE, COST_OF_SALES_ACCOUNT, SALES_ACCOUNT, DEFAULT_INCLUDE_IN_ROLLUP_FLAG, INVENTORY_ITEM_STATUS_CODE,
    INVENTORY_PLANNING_CODE, PLANNING_MAKE_BUY_CODE, FIXED_LOT_MULTIPLIER, ROUNDING_CONTROL_TYPE, CARRYING_COST, POSTPROCESSING_LEAD_TIME, PREPROCESSING_LEAD_TIME,
    FULL_LEAD_TIME, MRP_SAFETY_STOCK_CODE, FIXED_DAYS_SUPPLY, RESERVABLE_TYPE, VENDOR_WARRANTY_FLAG, SERVICEABLE_COMPONENT_FLAG, SERVICEABLE_PRODUCT_FLAG,
    PREVENTIVE_MAINTENANCE_FLAG, PRORATE_SERVICE_FLAG, INVOICEABLE_ITEM_FLAG, INVOICE_ENABLED_FLAG, MUST_USE_APPROVED_VENDOR_FLAG, OUTSIDE_OPERATION_FLAG,
    COSTING_ENABLED_FLAG, AUTO_CREATED_CONFIG_FLAG, CYCLE_COUNT_ENABLED_FLAG, ITEM_TYPE, SHIP_MODEL_COMPLETE_FLAG, MRP_PLANNING_CODE, RETURN_INSPECTION_REQUIREMENT,
    EFFECTIVITY_CONTROL, CHECK_SHORTAGES_FLAG, EQUIPMENT_TYPE, WEB_STATUS, BULK_PICKED_FLAG, LOT_STATUS_ENABLED, SERIAL_STATUS_ENABLED, LOT_SPLIT_ENABLED,
    LOT_MERGE_ENABLED, DUAL_UOM_CONTROL, SERV_BILLING_ENABLED_FLAG, LOT_TRANSLATE_ENABLED, DEFAULT_SO_SOURCE_TYPE, CREATE_SUPPLY_FLAG)
    Values
       (0,'DELETE',1,464852, 102, TO_DATE('01/11/2007 16:15:11', 'MM/DD/YYYY HH24:MI:SS'), 3443, TO_DATE('08/24/2006 14:13:03', 'MM/DD/YYYY HH24:MI:SS'), 3443, 21069398,
    'N', 'Y', 'pentaseal 6 X 320 SL-807202 Klockner', 4223, '0006320161', 'No', 'No', 'MRPM', 'N', 'Y', 'N', 'N', 'N', 'N', 'Y', 'N', 'Y', 'Y', 'N', 'N', 'N', 'N', 'Y',
    'Y', 'Y', 1, 'N', 'Y', 'N', 'WARNING', 'Y', 'Y', 'N', 3, 0, 20, 'WARNING', 'Y', 'Y', 5, 5, 'WARNING', 3, 1, 2, 1825, 1, 2, 2, 2, 10, 4, 1, 0, 0, 1, 'B', 'N', 4, 'N',
    'N', 'N', 'N', 2, 'EA', 'EACH', 3, 12916, 14296, 'Y', 'Uncosted', 6, 1, 100, 1, 2, 0, 5, 50, 1, 20, 1, 'N', 'N', 'N', 'N', 'N', 'N', 'N', 'N', 'N', 'Y', 'N', 'Y',
    'CMPC', 'N', 3, 2, 1, 'N', 2, 'UNPUBLISHED', 'N', 'N', 'N', 'N', 'N', 1, 'N', 'N', 'INTERNAL', 'Y');---------

    Hi,
    You have to use the delete item utility of Oracle Inventory.
    Responsibility: Inventory Superuser or similar
    Navigation: Items -> Delete Items
    Enter a meaningful name in the Group field.
    Type - Item
    Select the organization you want to delete the item from.
    In the details section, enter the items you want to delete.
    Once all the items entered, click on the "Chcek Group" button. This will validate whether the items you have entered are eligible to delete (i.e. whether any child record such as transactions exist).
    It will submit a concurrent program and once the program finishes you will be able to see the result in the Results tab.
    Finally click on the "Delete Group" button to delete the eligible items.
    Thanks,
    PS.

  • Deleting records from Z table via an ABAP

    Hello hoping someone can help me
    I am about to start writing an abap that will delete records from three seperate z tables that have been in there for over 18 months.
    Hoping that someone can give me a shove in the right direction to start me off as never had to do anything like this before.
    Iv had a search through the forum but cant seem to find what im after
    Thanks

    Hi,
    The below statement will do the purpose.
    DELETE zcustom FROM TABLE ITAB.

  • Deleting Records from Referential Tables

    Hi,
    Can anyone help me in deleting records from tables in a hierarcial manner. For e.g C refers B and B refers A. I need to delete data from all three tables related to a where clause in A.I tried using User_constraints and User_cons_columns views. But i am not able to find a hierarchial delete statement.
    Venkatesh

    Did you look into the option of specifying ON DELETE CASCADE for your foreign key constraints. That way, if you delete a
    row from the master table Oracle will automatically go and delete the child rows. Take a look at the following script.
    Here, when I delete a row from table A for NUM = 1 the child rows from table B (WHERE num = 1) are automatically deleted.
    drop table b
    drop table a
    create table a (num number, name varchar2(40))
    create table b (num number, name varchar2(40))
    alter table a add constraint pk_a primary key(num)
    alter table b add constraint fk_b_num foreign key (num) references a(num) on delete cascade
    insert into a values (1, 'Test#1')
    insert into a values (2, 'Test#2')
    insert into b values (1, 'Referes#1')
    insert into b values (2, 'Referes#2')
    select * from a
    select * from b
    delete from a where num = 1
    select * from a
    select * from b
    Sridhar,
    Thanks a lot for your help.My exact need was to delete records in 50 tables starting with the key table for a specific condition in the key table.
    Assume table A has 100 records,B 200 records,C 150 records,D 400 records, etc
    When i want to delete some records in table A, i will not be able to do that as child records exists in table B and this structure will carry on till that last table in my application. How do i delete those specific records
    Venkatesh

  • Any way to restore deleted record from VBAP table.

    Hi Guru,
    Is their any way to restore deleted record from vabp.
    Back is taken but , All quality server back is taken, any way to restore only
    deleted VBAP data from all Back.
    Regards
    Durgesh

    Hi Sahu ji,
    you will not be able to get those records.
    Check this : If this issue is in Development than no need to worry.
    If in quality and production , then usually a copy of the system is there , and this can help you.
    Also , check is there any report that exports this data in some other form for backup.
    Hope it help you.

  • Deleting records from internal tabl

    Hi All,
    Here i need delete records from one internal table, from another internal table. both contains same field as name1, so here , i need to delete records from t_itab , the records which are existed in t_itab1.
    first internal table t_itab contains
    vinesh01
    vinesh02
    vinesh03
    vinesh04
    second internal table t_itab1 contains
    vinesh01
    vinesh02
    here i need to delte t_itab1 entries from t_itab.
    regards,
    vinesh.

    Hi,
    try this code.
    first internal table t_itab contains
    vinesh01
    vinesh02
    vinesh03
    vinesh04
    second internal table t_itab1 contains
    vinesh01
    vinesh02
    loop at t_itab1.
    loop at t_itab.
    if t_itab-name1 = t_itab1-name1.
    delete t_itab.
    (OR)
    delete itab where t_itab-name = t_itab1-name.
    endif.
    endloop.
    endloop.
    regards.
    sriram.

  • My apple store is deleted completely from my mac, please help

    i cannot update my mac book pro because my app store is deleted from my mac, please help.

    Change App Store back to Malaysia
    1. Tap "Settings"
    2. Tap "iTunes & App Stores"
    3. Tap on your Apple ID
    4.Tap "View Apple ID"
    5. Enter your user name and password.
    6. Tap "Country/Region."
    7. Tap "Change Country/Region"
    8. Select the country/region where you are located; re-select country/region even if it is correct
    9. Tap "Done".
    Note: If the change doesn't take effect, sign out of account and sign in again.

  • Help needed writing trigger for deleting records from multipul tables

    i am trying to write a trigger which would help me delete the record from 3 different tables
    lets say i have table a , b and c
    i an trying to write a trigger which would help me delete the same record from table a and c.
    drop trigger az_zzz_trigger;
    create trigger az_zzz_trigger
    before INSERT or UPDATE or DELETE ON az_employ
    FOR EACH ROW
    BEGIN
    IF DELETING then
    delete from za_payroll
    delete from az_salary_audit
    end if;
    end;
    while executing this trigger all data of table za_payroll is delete.
    what should i do so that only the record which i delete from az_employ gets deleted from az_payroll and az_salary_audit

    872959 wrote:
    i am trying to write a trigger which would help me delete the record from 3 different tables
    lets say i have table a , b and c
    i an trying to write a trigger which would help me delete the same record from table a and c.
    drop trigger az_zzz_trigger;
    create trigger az_zzz_trigger
    before INSERT or UPDATE or DELETE ON az_employ
    FOR EACH ROW
    BEGIN
    IF DELETING then
    delete from za_payroll
    delete from az_salary_audit
    end if;
    end;
    while executing this trigger all data of table za_payroll is delete.
    what should i do so that only the record which i delete from az_employ gets deleted from az_payroll and az_salary_auditutilize appropriate WHERE clause

  • Delete records from z-table

    Hi ,
    delete statement is not working .
    i am using the logic like this .
    loop at itab into work_area.
    delete z-table from work_area .
    endloop.
    but i am unable to delete the records from the z-table .
    could you please look into this.
    Thanks,
    kumar.

    hi suresh,
    <b>DELETE  dbtab FROM wa.</b>
    After the statement is executed, the sytem field SY-DBCNT contains the number of lines that were deleted (0 or 1).
    The Return Code is set as follows:
    SY-SUBRC = 0:
    The line was deleted.
    SY-SUBRC = 4:
    No line could be deleted since there was no line with the primary key specified.
    example:
    <b>
    DATA wa TYPE sbook.
    wa-carrid = 'LH'.
    wa-connid = '0400'.
    wa-fldate = '20010228'.
    wa-bookid = '00000003'.
    DELETE sbook FROM wa.</b>
    check this link:
    http://help.sap.com/saphelp_47x200/helpdata/en/a6/0c723c590a9f6fe10000000a11405a/frameset.htm
    http://help.sap.com/saphelp_47x200/helpdata/en/a4/35ff395ef548e5add909b73ca12878/frameset.htm
    reward me if useful...
    Harimanjesh AN

  • Deleting records from a table with 12 million records

    We need to delete some records on this table.
    SQL> desc CDR_CLMS_ADMN.MDL_CLM_PMT_ENT_bak;
    Name Null? Type
    CLM_PMT_CHCK_NUM NOT NULL NUMBER(9)
    CLM_PMT_CHCK_ACCT NOT NULL VARCHAR2(5)
    CLM_PMT_PAYEE_POSTAL_EXT_CD VARCHAR2(4)
    CLM_PMT_CHCK_AMT NUMBER(9,2)
    CLM_PMT_CHCK_DT DATE
    CLM_PMT_PAYEE_NAME VARCHAR2(30)
    CLM_PMT_PAYEE_ADDR_LINE_1 VARCHAR2(30)
    CLM_PMT_PAYEE_ADDR_LINE_2 VARCHAR2(30)
    CLM_PMT_PAYEE_CITY VARCHAR2(19)
    CLM_PMT_PAYEE_STATE_CD CHAR(2)
    CLM_PMT_PAYEE_POSTAL_CD VARCHAR2(5)
    CLM_PMT_SUM_CHCK_IND CHAR(1)
    CLM_PMT_PAYEE_TYPE_CD CHAR(1)
    CLM_PMT_CHCK_STTS_CD CHAR(2)
    SYSTEM_INSERT_DT DATE
    SYSTEM_UPDATE_DT
    I only need to delete the records based on this condition
    select * from CDR_CLMS_ADMN.MDL_CLM_PMT_ENT_bak
    where CLM_PMT_CHCK_ACCT='00107' AND CLM_PMT_CHCK_NUM>=002196611 AND CLM_PMT_CHCK_NUM<=002197018;
    Thsi table has 12 million records.
    Please advise
    Regards,
    Narayan

    user7202581 wrote:
    We need to delete some records on this table.
    SQL> desc CDR_CLMS_ADMN.MDL_CLM_PMT_ENT_bak;
    Name Null? Type
    CLM_PMT_CHCK_NUM NOT NULL NUMBER(9)
    CLM_PMT_CHCK_ACCT NOT NULL VARCHAR2(5)
    CLM_PMT_PAYEE_POSTAL_EXT_CD VARCHAR2(4)
    CLM_PMT_CHCK_AMT NUMBER(9,2)
    CLM_PMT_CHCK_DT DATE
    CLM_PMT_PAYEE_NAME VARCHAR2(30)
    CLM_PMT_PAYEE_ADDR_LINE_1 VARCHAR2(30)
    CLM_PMT_PAYEE_ADDR_LINE_2 VARCHAR2(30)
    CLM_PMT_PAYEE_CITY VARCHAR2(19)
    CLM_PMT_PAYEE_STATE_CD CHAR(2)
    CLM_PMT_PAYEE_POSTAL_CD VARCHAR2(5)
    CLM_PMT_SUM_CHCK_IND CHAR(1)
    CLM_PMT_PAYEE_TYPE_CD CHAR(1)
    CLM_PMT_CHCK_STTS_CD CHAR(2)
    SYSTEM_INSERT_DT DATE
    SYSTEM_UPDATE_DT
    I only need to delete the records based on this condition
    select * from CDR_CLMS_ADMN.MDL_CLM_PMT_ENT_bak
    where CLM_PMT_CHCK_ACCT='00107' AND CLM_PMT_CHCK_NUM>=002196611 AND CLM_PMT_CHCK_NUM<=002197018;
    Thsi table has 12 million records.
    Please advise
    Regards,
    NarayanDELETE from CDR_CLMS_ADMN.MDL_CLM_PMT_ENT_bak
    where CLM_PMT_CHCK_ACCT='00107' AND CLM_PMT_CHCK_NUM>=002196611 AND CLM_PMT_CHCK_NUM<=002197018;

Maybe you are looking for

  • How to work with SYSFAIL in Queues

    Hi I am working on monitoring part, when the messages are sturcked in the queue with a queue status of SYSFAIL. How can we handle this. How to process the failed message as well as blocked messages in the queues. Thanks, Ram

  • Extended desktop wallpaper support videowallpaper

    hi  i just have 1 request can in the future windows play mp4 video without sound to use as desktop wallpaper we re in 2015 and still the only thing you can place as desktop wallpaper are just pictures {BORING} would be nice to have an loopable extrac

  • Migrating from a B&W G3 to an iMac 2.8

    After nearly 9 years I'm putting my B&W G3 (with many, many upgrades) into semi-retirement and should have a new 2.8 Ghz iMac arriving next week. Unfortunately I've just discovered that the B&W doesn't support Target Mode. From what I gather the best

  • Error with FileUpload UI Element

    Hi,     I am trying to develop an application that using which one can upload a file.When I click on the upload button I get the following error:     com.sap.tc.webdynpro.services.sal.util.cache.WDResourceNotFoundException: Object could not be found

  • Photoshop trial issues every time I open a picture I get an error message

    it says photshop has encountered a a problem and needs to close.  And then it  wont shut off it just acts like it is trying to close and I cant close it or use it. Please help.