Table Changed / TableModelEvent

Hello,
I am trying to use the event handler for data changes in a JTable. I running into a problem using the setValueAt method in the method for the event handler. I keep getting a stack overflow. The overflow only happens when I use setValueAt. Here is my code: (if I try the statement without the for loop i get the same result, so I know it has to something with that particular method).
public void tableChanged(TableModelEvent e)
          if(e.getType() == 0)
               for(int j = 0;j < 5;j++)
                    if(unitTableModel.getValueAt(e.getFirstRow(),0) == unit.getItemAt(j))
                         unitTableModel.setValueAt(unitDescript[j],e.getFirstRow(),1);
     }

Ok. Here is the code for the JInternalFrame that has the table to be updated. It's a lot of code to post, I just don't what you want to see, so I am posting the whole thing.
7
import javax.swing.*;
import javax.swing.event.*;
import javax.swing.border.*;
import java.awt.*;
import java.awt.event.*;
import java.io.Serializable;
import java.io.*;
import javax.swing.table.*;
import javax.sql.*;
import java.sql.*;
import java.util.*;
import com.microsoft.jdbc.sqlserver.SQLServerDriver;
public class orderGenerator extends JInternalFrame implements ActionListener,TableModelListener,KeyListener,ItemListener
     private JTextField phone,contactName,contactEmail;
     private JTextField customerName;
     private JTable address;
     private JLabel grandLabel,grandTotal,customerLabel,contactLabel,unitEntry;
     private JComboBox unit,tax;
     private String[] unitNames,unitDescript,unitPrices;
     private String[] columnNames,taxValues;
     private JPanel unitPanel;
     private JTable unitTable;
     private DefaultTableModel unitTableModel;
     private Object[] data;
     private JButton addRow,removeRow,insertData,selectCustomer,selectContact,customerListAll,contactListAll;
     private String sqlPort,database,url;
     private Statement statement;
     private Connection conn;
     private ResultSet result;
     private String tempCustId,tempContactId;
     private JTable customerResults,contactResults;
     private Font verdana = new Font("Verdana",Font.PLAIN,11);
     private String tempCustomerName,tempPhone,tempStreetAddress,tempCity,tempState,tempZip,tempCountry,tempContactName,tempEmail,tempBusinessId;
     public orderGenerator(String s,String d, String u)
          super("Idealstor Orders Entry",true,true,true,true);
          sqlPort = s;
          database = d;
          url = u;
          Container c = getContentPane();
          c.setLayout(null);
          addRow = new JButton("Add");
          removeRow = new JButton("Remove");
          taxValues = new String[6];
          taxValues[0] = "1.0";
          taxValues[1] = "1.045";
          taxValues[2] = "1.05";
          taxValues[3] = "1.055";
          taxValues[4] = "1.08";
          taxValues[5] = "1.085";
          tax = new JComboBox(taxValues);
          unitNames = new String[5];
          unitNames[0] = "BASB-1E";
          unitNames[1] = "BA2U-2E";
          unitNames[2] = "BA4U-4E";
          unitNames[3] = "BA4U-6E";
          unitNames[4] = "BA4U-8E";
          unitPrices = new String[5];
          unitPrices[0] = "3995.00";
          unitPrices[1] = "6995.00";
          unitPrices[2] = "10995.00";
          unitPrices[3] = "12995.00";
          unitPrices[4] = "14995.00";
          unitDescript = new String[5];
          unitDescript[0] = "One Bay Idealstor Unit";
          unitDescript[1] = "Two Bay Idealstor Unit";
          unitDescript[2] = "Four Bay Idealstor Unit";
          unitDescript[3] = "Six Bay Idealstor Unit";
          unitDescript[4] = "Eight Bay Idealstor Unit";
          unit = new JComboBox(unitNames);
          grandTotal = new JLabel("0");
          grandLabel = new JLabel("GrandTotal:");
          insertData = new JButton("Submit");
          //### Customer results table set up #######################
          customerLabel = new JLabel("Customer List:");
          customerLabel.setBounds(15,90,100,20);
          customerLabel.setFont(verdana);
          selectCustomer = new JButton("Select");
          selectCustomer.setBounds(15,245,100,20);
          selectCustomer.addActionListener(this);
          customerListAll = new JButton("List All");
          customerListAll.setBounds(120,245,100,20);
          customerListAll.addActionListener(this);
          customerResults = new JTable();
          JScrollPane customersPane = new JScrollPane(customerResults);
          customersPane.setBounds(15,115,250,120);
          c.add(customersPane);
          c.add(customerLabel);
          c.add(selectCustomer);     
          c.add(customerListAll);
          //### Contact results table set up #########################
          contactLabel = new JLabel("Contact List:");
          contactLabel.setBounds(290,90,100,20);
          contactLabel.setFont(verdana);
          selectContact = new JButton("Select");
          selectContact.setBounds(290,245,100,20);
          selectContact.addActionListener(this);
          contactListAll = new JButton("List All");
          contactListAll.setBounds(395,245,100,20);
          contactListAll.addActionListener(this);
          contactResults = new JTable();
          JScrollPane contactPane = new JScrollPane(contactResults);
          contactPane.setBounds(290,115,250,120);
          c.add(contactPane);
          c.add(contactLabel);
          c.add(selectContact);
          c.add(contactListAll);
          //### SET UP THE PANEL ########################
          setupUnitPanel();
          //### Set up the address table ###############
          String[] addressColumns = new String[5];
          addressColumns[0] = "Street Address";
          addressColumns[1] = "City";
          addressColumns[2] = "State / Province";
          addressColumns[3] = "Zip";
          addressColumns[4] = "Country";
          DefaultTableModel addressModel = new DefaultTableModel(addressColumns,1);          
          address = new JTable(addressModel);
          JScrollPane addressPane = new JScrollPane(address);
          addressPane.setBounds(80,40,600,40);
          customerName = new JTextField();
          phone = new JTextField();
          contactName = new JTextField();
          contactEmail = new JTextField();
          //### component size and locations ###########
          address.setBounds(80,40,100,20);
          customerName.setBounds(80,12,100,20);
          phone.setBounds(245,12,100,20);
          contactName.setBounds(410,12,100,20);
          contactEmail.setBounds(610,12,100,20);     
          addRow.setBounds(15,615,100,20);
          removeRow.setBounds(120,615,100,20);     
          grandTotal.setBounds(90,645,100,20);
          grandLabel.setBounds(15,645,100,20);
          insertData.setBounds(225,615,100,20);
          tax.setBounds(330,615,100,20);
          //### Event listeners ####################
          addRow.addActionListener(this);
          removeRow.addActionListener(this);
          insertData.addActionListener(this);
          customerName.addKeyListener(this);
          contactName.addKeyListener(this);
          tax.addActionListener(this);
          unit.addItemListener(this);
          c.add(addressPane);
          c.add(customerName);
          c.add(phone);
          c.add(contactName);
          c.add(contactEmail);
          c.add(unitPanel);
          c.add(addRow);
          c.add(removeRow);     
          c.add(grandTotal);
          c.add(grandLabel);
          c.add(insertData);
          c.add(tax);
          c.add(unitEntry);
          //### Setup the class for sql operation ########################
          try
               Class.forName("com.microsoft.jdbc.sqlserver.SQLServerDriver");
          catch(ClassNotFoundException e)
               JOptionPane.showMessageDialog(null,"Driver class does not exist.","Error",JOptionPane.ERROR_MESSAGE);
          try
               conn = DriverManager.getConnection("jdbc:microsoft:sqlserver://"+url+":"+sqlPort+";DatabaseName="+database,"someUser","somePassword");
               statement = conn.createStatement();
          catch(SQLException e)
               //e.printStackTrace();
               JOptionPane.showMessageDialog(null,"Connection parameters are not valid","Error",JOptionPane.ERROR_MESSAGE);
     public void paint(Graphics dc)
          super.paint(dc);
          setBackground(new Color(255,0,0));
          dc.drawString("Address:",15,83);
          dc.drawString("Customer:",15,53);
          dc.drawString("Phone:",200,53);
          dc.drawString("Contact:",365,53);
          dc.drawString("Contact Email:",530,53);
     //### Setup the panel that holds the table for data entry #####################
     private void setupUnitPanel()
          columnNames = new String[7];
          columnNames[0] = "Unit";
          columnNames[1] = "Unit Description";
          columnNames[2] = "Serial Number";
          columnNames[3] = "Windows License";
          columnNames[4] = "Extended Warranty";
          columnNames[5] = "Quantity";
          columnNames[6] = "Price";
          data = new Object[7];
          data[0] = "";
          data[1] = "";
          data[2] = "";
          data[3] = "";
          data[4] = "";
          data[5] = "";
          data[6] = "";
          JComboBox extWarranty = new JComboBox();
          extWarranty.addItem("N");
          extWarranty.addItem("Y");
          unitTableModel = new DefaultTableModel(columnNames,1);
          unitEntry = new JLabel("Units Sold:");
          unitEntry.setBounds(15,270,100,20);
          unitEntry.setFont(verdana);
          unitPanel = new JPanel();
          unitPanel.setBounds(15,290,800,320);
          unitTable = new JTable(unitTableModel);
          TableColumn column0 = unitTable.getColumnModel().getColumn(0);
          column0.setCellEditor(new DefaultCellEditor(unit));
          TableColumn column3 = unitTable.getColumnModel().getColumn(4);
          column3.setCellEditor(new DefaultCellEditor(extWarranty));
          unitPanel.setLayout(null);
          JScrollPane tablePane = new JScrollPane(unitTable);
          tablePane.setBounds(0,0,800,320);
          unitPanel.add(tablePane);
          unitTable.setValueAt("1",0,5);
          unitTable.setValueAt("N",0,4);
          unitTable.getModel().addTableModelListener(this);
     //### Action method for actionListeners #####################################
     public void actionPerformed(ActionEvent e)
          if(e.getSource() == addRow)
               unitTableModel.addRow(data);
               unitTable.setValueAt("1",unitTable.getRowCount() - 1,5);
               unitTable.setValueAt("N",unitTable.getRowCount() - 1,4);
          if(e.getSource() == removeRow)
               try
                    unitTableModel.removeRow(unitTable.getSelectedRow());
               catch(Exception T)
                    JOptionPane.showMessageDialog(this,"You must select a row then remove.","Row not selected",JOptionPane.INFORMATION_MESSAGE);
          if(e.getSource() == insertData)
               runRowInsertion();
          if(e.getSource() == selectCustomer)
               populateCustomer();
          if(e.getSource() == selectContact)
               populateContact();
          if(e.getSource() == tax)
               reCalculate();
          if(e.getSource() == customerListAll)
               listAllCustomers();
          if(e.getSource() == contactListAll)
               listAllContacts();
     //### Auto Fill customer info ###########################################
     public void populateCustomer()
          try
               tempCustId = "";
               if(customerResults.getRowCount() > 0 && customerResults.getSelectedRowCount() > 0)
                    tempCustId = customerResults.getValueAt(customerResults.getSelectedRow(),0).toString();
               else
                    throw new Exception();
               if(tempCustId != null && tempCustId.length() > 0)
                    try
                         result = statement.executeQuery("Select * from customers where customerId = "+tempCustId+";");
                         result.next();
                         customerName.setText(tempCustomerName = result.getObject(2).toString());
                         phone.setText(tempPhone = result.getObject(3).toString());
                         address.setValueAt(tempStreetAddress = result.getObject(4).toString(),0,0);
                         address.setValueAt(tempCity = result.getObject(5).toString(),0,1);
                         address.setValueAt(tempState = result.getObject(6).toString(),0,2);
                         address.setValueAt(tempZip = result.getObject(7).toString(),0,3);
                         address.setValueAt(tempCountry = result.getObject(8).toString(),0,4);
                    catch(SQLException s)
                         //s.printStackTrace();
                         JOptionPane.showMessageDialog(this,"Data could not be retrieved for customer.\n Please make sure that a customer is selected.","Error - Data",JOptionPane.ERROR_MESSAGE);
          catch(Exception e)
               JOptionPane.showMessageDialog(this,"Must Select a customer or customers not listed.","Customer Not Selected",JOptionPane.INFORMATION_MESSAGE);               
          String query = "Select contactId,contactName from contact where customerId = "+tempCustId+";";
          resultSetModel resultsModel = new resultSetModel(sqlPort,database,url,query);
          contactResults.setModel(resultsModel);
     //### Auto fill contact info #############################################
     public void populateContact()
          try
               tempContactId = "";
               if(contactResults.getRowCount() > 0 && contactResults.getSelectedRowCount() > 0)
                    tempContactId = contactResults.getValueAt(contactResults.getSelectedRow(),0).toString();
               else
                    throw new Exception();
               if(tempContactId != null && tempContactId.length() > 0)
                    try
                         result = statement.executeQuery("Select * from contact where contactId = "+tempContactId+";");
                         result.next();
                         contactName.setText(tempContactName = result.getObject(2).toString());
                         contactEmail.setText(tempEmail = result.getObject(3).toString());
                         tempBusinessId = result.getObject(4).toString();
                    catch(SQLException s)
                         //s.printStackTrace();
                         JOptionPane.showMessageDialog(this,"Data could not be retrieved for contact.\n Please make sure that a customer is selected.","Error - Data",JOptionPane.ERROR_MESSAGE);
          catch(Exception e)
               JOptionPane.showMessageDialog(this,"Must Select a contact or contacts not listed.","Customer Not Selected",JOptionPane.INFORMATION_MESSAGE);               
     //### insert the rows from the table into the database #################
     private void runRowInsertion()
          int rowNumber = 0;
          boolean filledIn = true;
          while(rowNumber < unitTable.getRowCount() && filledIn == true)
               for(int j = 0;j < 6;j++)
                    if(unitTable.getValueAt(rowNumber,j) == null || unitTable.getValueAt(rowNumber,j).toString().length() == 0)
                         filledIn = false;
               rowNumber++;
          if(contactEmail.getText().length() == 0)
               filledIn = false;
          if(contactName.getText().length() == 0)
               filledIn = false;
          rowNumber = 0;
          while(rowNumber < address.getRowCount() && filledIn == true)
               for(int j =0;j < 5;j++)
                    if(address.getValueAt(rowNumber,j) == null || address.getValueAt(rowNumber,j).toString().length() == 0)
                         filledIn = false;
               rowNumber++;
          if(phone.getText().length() == 0)
               filledIn = false;
          if(customerName.getText().length() == 0)
               filledIn = false;
          if(filledIn == false)
               JOptionPane.showMessageDialog(this,"All fields need to be filled in","Fill in all Fields",JOptionPane.INFORMATION_MESSAGE);
          if(filledIn == true)
               try
                    boolean match = false;
                    boolean contactMatch = false;
                    String query = "";
                    //### Begin with customer insert ###########
                    if((tempCustomerName.equals(customerName.getText())) && (tempPhone.equals(phone.getText())))
                         if(address.getValueAt(0,0).toString().equals(tempStreetAddress) && address.getValueAt(0,1).toString().equals(tempCity) && address.getValueAt(0,2).toString().equals(tempState) && address.getValueAt(0,3).toString().equals(tempZip) && address.getValueAt(0,4).toString().equals(tempCountry))
                              match = true;
                    if(match == false)
                         query = "declare @counter int;declare find cursor scroll for select customerId from customers;open find;fetch last from find into @counter;close find;deallocate find;insert into customers values(@counter+1,'"+customerName.getText()+"','"+phone.getText()+"','"+address.getValueAt(0,0)+"','"+address.getValueAt(0,1)+"','"+address.getValueAt(0,2)+"','"+address.getValueAt(0,3)+"','"+address.getValueAt(0,4)+"');";
                    //### scroll cursor for order detail ####
                    query += "declare @orderNumber int;declare orderNumberFind cursor scroll for select orderNo from orderDetail;open orderNumberFind;fetch last from orderNumberFind into @orderNumber;close orderNumberFind;deallocate orderNumberFind;";
                    //### orderDetail inserts ##########
                    if(match == false)
                         for (int j = 0;j < unitTable.getRowCount();j++)
                              query += "insert into orderDetail values (getDate(),@orderNumber+1,'"+unitTable.getValueAt(j,0)+"','"+unitTable.getValueAt(j,1)+"',"+unitTable.getValueAt(j,5)+","+grandTotal.getText()+",'"+unitTable.getValueAt(j,2)+"','"+unitTable.getValueAt(j,4)+"','"+unitTable.getValueAt(j,3)+"','O',"+unitTable.getValueAt(j,6)+","+tax.getSelectedItem()+",@counter+1);";
                    else if(match == true)
                         for (int j = 0;j < unitTable.getRowCount();j++)
                              query += "insert into orderDetail values (getDate(),@orderNumber+1,'"+unitTable.getValueAt(j,0)+"','"+unitTable.getValueAt(j,1)+"',"+unitTable.getValueAt(j,5)+","+grandTotal.getText()+",'"+unitTable.getValueAt(j,2)+"','"+unitTable.getValueAt(j,4)+"','"+unitTable.getValueAt(j,3)+"','O',"+unitTable.getValueAt(j,6)+","+tax.getSelectedItem()+","+tempCustId+");";     
                    if(contactName.getText().toString().equals(tempContactName) && contactEmail.getText().toString().equals(tempEmail))
                         contactMatch = true;
                    if(contactMatch == false)
                         query += "declare @contactCounter int;declare findContact cursor scroll for select contactId from contact;open findContact;fetch last from findContact into @contactCounter;close findContact;deallocate findContact;";
                    if(contactMatch == false && match == false)
                         query += "insert into contact values(@contactCounter+1,'"+contactName.getText()+"','"+contactEmail.getText()+"',@counter+1);";
                    else if(contactMatch == false && match == true)
                         query += "insert into contact values(@contactCounter+1,'"+contactName.getText()+"','"+contactEmail.getText()+"',"+tempCustId+");";
                    String contactType;
                    String customerType;
                    if(contactMatch == true)
                         contactType = "using an existing ";
                    else
                         contactType = "adding a new ";
                    if(match == false)
                         customerType = "adding a new ";
                    else
                         customerType = "using an existing ";
                    int confirm = JOptionPane.showConfirmDialog(this,"Do you want to proceed?\n\nYou are "+contactType+"contact\n\nYou are "+customerType+"customer\n\nNote: If any of the information of the customer and/or contact \nhave been modified, then the customer and/or contact get\n treated as if they are a new data entry.","Proceed?",JOptionPane.YES_NO_OPTION);
                    if(confirm == 0)
                         statement.executeUpdate(query);
                         //statement.close();
                         JOptionPane.showMessageDialog(this,"The data has been successfully added.","Data added",JOptionPane.INFORMATION_MESSAGE);
               catch(Exception e)
                    JOptionPane.showMessageDialog(this,"Data could not be added to the database.","Error",JOptionPane.ERROR_MESSAGE);
                    //e.printStackTrace();
     public void tableChanged(TableModelEvent e)
          if(e.getType() == 0)
               boolean filledIn = true;
               for(int j = 0;j < unitTable.getRowCount();j++)
                    if(unitTable.getValueAt(j,6) == null || unitTable.getValueAt(j,6).toString().length() == 0)                         {
                         filledIn = false;
               try
                    double sum = 0.0;
                    if(filledIn == true)
                         for(int j = 0;j < unitTable.getRowCount();j++)
                              sum += Double.parseDouble(unitTable.getValueAt(j,6).toString());
                         sum = sum * Double.parseDouble(tax.getSelectedItem().toString());
                         grandTotal.setText(""+sum);
               catch(NumberFormatException N)
                    JOptionPane.showMessageDialog(this,"Can not compute total. Make sure the price is a number.","Error - Number Format",JOptionPane.ERROR_MESSAGE);
               //updateOtherColumns();
     //### Recalculate the prices ##################################
     private void reCalculate()
          boolean filledIn = true;
          for(int j = 0;j < unitTable.getRowCount();j++)
               if(unitTable.getValueAt(j,6) == null || unitTable.getValueAt(j,6).toString().length() == 0)
                    filledIn = false;               
          double sum = 0.0;
          if(filledIn == true)
               for(int j = 0;j < unitTable.getRowCount();j++)                         
                    sum += Double.parseDouble(unitTable.getValueAt(j,6).toString());
               sum = sum * Double.parseDouble(tax.getSelectedItem().toString());
               grandTotal.setText(""+sum);
     public void keyTyped(KeyEvent e)
     public void keyReleased(KeyEvent e)
          if(e.getSource() == customerName)
               checkRecords();
          if(e.getSource() == contactName)
               checkContacts();
     public void keyPressed(KeyEvent e)
     //### check records ##########################
     private void checkRecords()
          String query = "Select customerId,customerName from customers where customerName like '"+customerName.getText()+"%';";
          resultSetModel resultsModel = new resultSetModel(sqlPort,database,url,query);
          customerResults.setModel(resultsModel);
     private void checkContacts()
          String query = "Select contactId,contactName from contact where contactName like '"+contactName.getText()+"%';";
          resultSetModel resultsModel = new resultSetModel(sqlPort,database,url,query);
          contactResults.setModel(resultsModel);
     public void itemStateChanged(ItemEvent e)
          if(e.getSource() == unit)
     private void updateOtherColumns()
          int rowSource = unitTable.getSelectedRow();
          for(int j = 0;j < 5;j++)
               if(unitTable.getValueAt(rowSource,0).toString().equals(unitNames[j]))
                    unitTable.setValueAt(unitDescript[j],rowSource,1);
                    unitTable.setValueAt(unitPrices[j],rowSource,6);
     private void listAllContacts()
          String query = "Select contactId,contactName from contact;";
          resultSetModel resultsModel = new resultSetModel(sqlPort,database,url,query);
          contactResults.setModel(resultsModel);
     private void listAllCustomers()
          String query = "Select customerId,customerName from customers;";
          resultSetModel resultsModel = new resultSetModel(sqlPort,database,url,query);
          customerResults.setModel(resultsModel);
}

Similar Messages

  • Right way to fire table changes

    suppose i have a class that extends AbstractTableModel and i used a List to store data, like
    public class MyTableModel extends AbstractTableModel
    List dataList = Collections.synchronizedList(new LinkedList());
    public void insertMyData(String data)
    synchronized(dataList)
    // ... do something
    ##Line A##
    ##Line B##
    If i want to fire table changes, say like using
    this.fireTableDataChanged();
    where should i place it?
    at ##Line A## or ##Line B## ???
    or should I use
    SwingUtilities.invokeLater(new Runnable(){public void run(){
      this.fireTableDataChanged();
    Moreover, i would like to ask, if I implement my own TableCellRender and overriding the getTableCellRendererComponent method, all the calls like setText, setBackground, setForeground,...
    should i use SwingUtilities.invokeLater to do that? or just call it as usual ?
    Thanks alot

    Since you mention synchronized several times, I assume your model will be accessed from different threads
    (although you didn't write this.) Client code will have to be careful: getRowCount may return 10, but by the
    time the client gets to row 7 it may no longer exist! What does your model do when getValueAt is based
    indices that are out of bounds?
    As far as synchronization goes, I think you are going overboard with:
    List dataList = Collections.synchronizedList(new LinkedList());...since you are using synchronization blocks elsewhere. In general, I find little use for those synchronizedXXX
    factory methods -- usually the class having a collection member provides the thread safety.
    As far as the listeners go, model listeners assume their event handlers are executing in the EDT, so
    you will have to call the fire*** methods from the EDT. This means you have to use invokeLater or invokeAndWait.
    Using invokeAndWait defeats the multithreading you are building, so I think you
    should call invokeLater, and since this is an asynchronous-style call it makes no sense doing it
    from within a synchronized block. Just be aware that your JTable class may quety the model
    out of bounds.
    Also, if your model's data is written or changed seldom but read often, I would use the serial immutable
    pattern. Have the List reference dataList point to list whose state is immutable. If you want to change
    the data, you make a copy, change that and then have dataList refer to the updated copy.

  • Data in the table changes when multiple users try to submit data

    I have a dynamic table. The table is created in the wdDoModifyView. The user can load data into the table from an excel file. So I have a "Load" button that loads the data from the selected excel file to the table. I also have a "Submit" button. This "Submit" button converts the data to an xml file and make a call to an oracle stored procedure for validation check. If there's an error it will be returned and displayed to the user. If none, a summary of data for posting will be displayed to the user. If the data is correct and the user hit the ok button, the same data will be return to oracle sp for loading in the table.
    The problem we encountered is when multiple users are loading and submitting at the same time, the data displayed in the dynamic tables changes after clicking the ok button. It is as if, the table displays the data being loaded by other user.
    This is an error that is difficult to recreate. This doesn't happen all the time. I hope you somebody could enlighten me why this is happening. I'm not sure if it has something to do with multithreading or session.
    Edited by: Marlyn Agco on Apr 14, 2009 3:57 PM

    Hi Armin,
    Did you mean storing view instances in static references and accessing them outside the wdDoModifyView is not a good idea? In wdDoInit the nodes are dynamically created according to the xml file being returned by the database. This node is stored in a static variable which is also used in wdDoModifyView to create the dynamic table.
    What do you suggest? We're still encountering same issue when multiple users are uploading data.

  • Initial Balances for some of the G/L Accounts  in GLPCT table changed

    Sub : G/L Account Balance( T code FAGLB03 )  and EC-PCA: Totals Table (Table GLPCT) initial balances are not same for some of the G/L accounts ( Initial Balances for some of the G/L Accounts and profit centers in GLPCT table changed )
    Dear Friends
    We are in SAP ECC 5.0. We are using New G/L Accounting
    G/L Account  Balance(Initial Balance)( T code FAGLB03 )  and EC-PCA: Totals Table (Table GLPCT) initial balances are not same for some of the G/L accounts ( Initial Balances for some of the G/L Accounts and Profit centers in GLPCT table changed )
    G/L Account : 1110001 AR Trade - Recon
    G/L Account Initial  Balance( T code FAGLB03 )          36,789,209.26 USD
    EC-PCA: Totals initial balance  (GLPCT table)                14,178,848.14 USD
    I found in GLPCT table initial balances for G/L 1110001 and some of the profit centers are changed. The initial balances are not supposed to change for the entire financial year
    I have checked   none of  documents for this G/L and these Profit centers of last financial year  have been posted or reversed in current financial year.
    Please try to help me what has caused to changed the initial balances and how to correct it
    Please let me know if you guys need more details
    Thanks in advance
    Thanks
    MVS

    Hi Vinay,
    If I understood correctly you are trying to balance  Accumulated Depreciation accounts (from the AA module) with the Cost Depreciation Accounts.
    If they don`t balance zero, it mostly likely means, that some user has posted manually deprecian in your GL, not using the depreciation program.
    Hope this helps.
    KR
    Severina Koleva

  • Help with creating a sql file that will capture any database table changes.

    We are in the process of creating DROP/Create tables, and using exp/imp data into the tables (the data is in flat files).
    Our client is bit curious to work with. They do the alterations to their database (change the layout, change the datatype, drops tables) without our knowing. This has created a hell lot of issues with us.
    Is there a way that we can create a sql script which can capture any table changes on the database, so that when the client trys to execute imp batch file, the sql file should first check to see if any changes are made. If made, then it should stop execution and give an error message.
    Any help/suggestions would be highly appreciable.
    Thanks,

    Just to clarify...
    1. DDL commands are like CREATE, DROP, ALTER. (These are different than DML commands - INSERT, UPDATE, DELETE).
    2. The DDL trigger is created at the database level, not on each table. You only need one DDL trigger.
    3. You can choose the DDL commands for which you want the trigger to fire (probably, you'll want CREATE, DROP, ALTER, at a minimum).
    4. The DDL trigger only fires when one of these DDL commands is run.
    Whether you have 50 tables or 50,000 tables is not significant to performance in this context.
    What's signficant is how often you'll be executing the DDL commands on which the trigger is set to fire and whether the DDL commands execute in acceptable time with the trigger in place.

  • Do indices change, when data of table changes?

    Hello,
    if a table has got many indices and is changed frequently, do the indices change as well. Are all indices corresponding to that table changed. Are these indices processed in any way?
    thanks, resi

    "in indexes, the space can be reused only by rows with the same key-filed"
    That is incorrect. The space left in a index by a deleted row can be used by any key that is between the prior and next keys. For example, if you have Index entries
    Entry 1  Ball
    Entry 2  Bell
    Entry 3  BollNow, you delete Bell, the inndex would look like:
    Entry 1  Ball
    Entry 2  
    Entry 3  BollNow, add Bill, and the index would look like:
    Entry 1  Ball
    Entry 2  Bill
    Entry 3  Bollno wasted space.
    Rebuilding indexes is a waste of time and resources in the vast majority of cases.
    Search Tom Kyte's site here for rebuilding indexes or reorganizong indexes for many, often lively, discussions.
    John

  • Logging of table changes

    Hi All,
              We are working on ERP 6.0. Recently Basis team has been asked to activate the table changes logs in Production system. Accordingly we activated the rec/client parameter for Production system client. We are also required to click the log changes tab in the table for which the logs are to be activated.This is to be done through t code SE13. While trying to do so, I have found that our Production system is not allowing to make changes directly as it is configured in non modifiable stage. I have also tried to make changes in devp clinet and then transport it to quality an Production,however it is not working.
    Kindly let me know the exact method by which I can activate the tab in the table.
    Thanks,
    Prasad Thakur

    Hello Prasad,
    This is strange. It is understandable that the table content changes is not getting recorded in case rec/client (in default profile) is not set along with recclient="XXX" (in transport profile) but  table logging activation not getting reflected in QA is a bit weird.
    Are you sure that the transport carried correct contents. Can you list the contents of the transport. It should have an entry related to DD09L.
    Is the table showing as activated ? Just try to activate/generate it.
    For more info on recording please check OSS notes 1916 and 84052.
    With Regards.
    Ruchit Khushu.

  • Table changes in database are not captured in ODI model level

    Hi All,
    Can any one help me how to fix the bug in ODI.
    Table changes in database are not captured in ODI model level.
    Thanks in advance

    I created the interface which is running successfully.
    Now i did some changes in target table(data base level).
    I reversed the updated table in model section. Till here its ok
    The table which is updated in the model section is not automatically updated in the interface.
    I have to drop the existed datastore in the interface and and re do the entire process of bringing the updated datastore, mapping,etc..
    Please tell the any alternate way.
    Regards
    suresh

  • Track of table changes in a database

    how to keep track of table changes in a database.
    Some records have been deleleted, is there away of seeing that change.

    basically, if you havn't already set up a mechanism to track these sorts of changes, they are already lost.
    there are a number of things you can do. one method that we use is a trigger on the table to insert a record into an audit table for every row that gets changed or deleted.
    oracle has some other built in auditing tools that I'm not familiar with though.

  • How to trigger a workflow when data inside a table changes

    Hi
    How to trigger a workflow when data inside a table changes ??
    We need to trigger a workflow when STAT2 field value in PA0000 table changes.
    rgds
    Chemmanz

    Make use of Business Object BUS1065. In this business Object you have an attribute Status which you can use. There are a number of events that will get triggered when the status is changed.
    Thanks
    Arghadip

  • Transporting table changes

    Hi folks,
    I've made changes to a custom table in SE11(including keys and add new fields). Question is, if these changes are being transported to QA system, will the current table in QA system will be overwritten? how about the current content of table? will it be overwritten as well? do we need to adjust the table again in QA?
    Thanks,
    Tremonti

    Hello Karchy,
    You will not loose the data in your QA table once you move the Table changes. The conversion will be managed through a temporary table at the back end. You can expect a few dumps in your QA system while the transport is being imported, if there are programs accessing this table during that time. Basically the DB system will use one of ALTER TABLE or table conversion methodology to adjust your table (as you have data in it). Only if the table is empty, its dropped and re-created (fastest method).
    Once the transport is imported, its better to confirm the status of the table in SE14. If required "Activate and Adjust" the table and look out for issues in the logs.
    When you move this table to the productive environment, do so in a quite time (when the system is least active).
    Regards,
    Jinesh.

  • Control Table changes

    Hello All,
    Can anyione help me on this. I am not able to understand what control table changes mean. I know what Table controls are but not known to control table.
    And they are different from each other.
    Can anyone please help me on this.
    Regards
    anu

    hi,
    WELCOME  TO SDN.
    *Control Tables
    The search indexes for address data, as well as the address data itself, are client-dependent. There can now be other differentiations within a client. These are called "Index pools".
    The division reflects the fact that multiple areas of master data are involved, which differ from the business embedding in the SAP System and from the technical implementation.
    Two such index pools are currently defined in table TSADRVGRP with a technical key derived from control table TSADRV:
    For More details
    http://help.sap.com/saphelp_nw04/helpdata/en/81/23a63a8e1d1e49e10000000a11402f/content.htm
    Hope this will help you.
    Rewrd points, if found helpful
    Regards
    ANVER

  • Table changes to TBSL...

    How do I find table changes ? I want to find the table changes done to table TBSL.
    Regards,
    Rajesh.

    Check the table DBTABLOG:
    Pass the name of your table TBSL to the field: TABNAME to get the log of changes done to your table.
    Regards,
    Ravi

  • Table changes by timestamp

    I have a table that has a TIMESTAMP column that stores the last time the record was changed. I have to create a dbms_scheduler job (repeats at on 15 min interval) that will give me a list of all the table changes that happened during the timeframe. So I created a job that calls a stored procedure and executes every 15 minutes:
    table:
    emp
    last_name varchar2,
    last_change_date timestamp
    job:
    dbms_scheduler.create_job
    (job_name => 'CHECK_TABLE_DATA_JOB',
    job_type => 'PLSQL_BLOCK',
    job_action =>
    'begin
    CHECK_TABLE_DATA;
    end;',
    repeat_interval => 'FREQ=MINUTELY; INTERVAL=15'
    enabled=>true,
    auto_drop=>false);
    I'm a little unsure of the best way to query the changes in my procedure. I need to make sure that I catch all changes only 1 time, so I need to be precise on querying the 'last_change_date' timestamp column with time when job runs. Any ideas?

    >
    Thanks. Sorry, should have used ename (see below). I will read up on the MV log INCLUDING NEW VALUES.
    I understand your reason why the record would get skipped based on 'versions_startime' or 'versions_endtime', but isn't the
    'FROM emp versions BETWEEN TIMESTAMP SYSTIMESTAMP - INTERVAL '15' MINUTE AND SYSTIMESTAMP' statement using the internal (committted) timestamp to bring back the records?
    SELECT ename, versions_starttime,versions_operation
    FROM emp versions BETWEEN TIMESTAMP SYSTIMESTAMP - INTERVAL '15' MINUTE AND SYSTIMESTAMP
    ORDER BY ename, versions_endtime asc;
    >
    Well now you risk confusing the heck out of anyone reading this thread since you have abandoned the original question and have moved on to a new one.,
    The original question was how to use YOUR column in YOUR table to query data changes that occur to your table. That has been answered as far as I can tell.
    Now you are asking about FLASHBACK QUERY options and that is a new question. Many people that might be able to help you may not read the thread because your thread title is about something else altogether.
    I suggest that you open a new thread with a subject including FLASHBACK QUERY. Post a link to this thread so people have the context.
    Yes - you can use FLASHBACK QUERY functionality to identify changes to your table.
    See the Advanced App Dev Guide for details
    http://docs.oracle.com/cd/E11882_01/appdev.112/e25518/adfns_flashback.htm#i1019938
    The 'Using Oracle Flashback Version Query' section discusses the topic you mentioned.
    >
    Use Oracle Flashback Version Query to retrieve the different versions of specific rows that existed during a given time interval. A row version is created whenever a COMMIT statement is executed.
    Specify Oracle Flashback Version Query using the VERSIONS BETWEEN clause of the SELECT statement. The syntax is:
    VERSIONS {BETWEEN {SCN | TIMESTAMP} start AND end}
    where start and end are expressions representing the start and end, respectively, of the time interval to be queried. The time interval includes (start and end).
    Oracle Flashback Version Query returns a table with a row for each version of the row that existed at any time during the specified time interval. Each row in the table includes pseudocolumns of metadata about the row version, described in Table 12-1. This information can reveal when and how a particular change (perhaps erroneous) occurred to your database.
    >
    There are several examples in that section.

  • Table Changes 11.5.10 to 12.1

    I am looking for technical documentation that tells me the EBS table changes from 11.5.10 to 12.1. Don't tell me I have to read every trm and compare!! Thanks

    Hi again;
    Please also check Hussein Sawwan greatest pervious post about similar topic
    Table Chnages in R12
    Regard
    Helios

Maybe you are looking for

  • Podcasts not syncing to Podcasts folder on ipod 80gb

    I have subscribed to 6 podcasts and they do sync to my ipod but they go into the Music folder rather than the Podcast folder. How do I get them to sync into the Podcast folder going forward, and how do I get them out of my music folder. I thought App

  • How do I transfer contacts from palm treo 700w to my macbook?

    I really need to move my contacts from my treo to my new mac and eventually put them on my iphone. I'm a newbie and would really appreciate some help figuring this out. Thanks

  • Specifying Question and Answer fields in Response sheet from Pre-existing Interactive PDF

    I am creating a new form from an existing interactive pdf, which has text boxes to supply answers. How can I get the response sheet to reflect the questions that are in the pdf? That is how does FormsCentral determine what the question and answer are

  • OCM JEA JEE6?

    Hi I am planning to do the OCM JEA and I have a questions related to it. The current OCM JEA is based on JEE 5, is there any plans for a JEE6 version? Is it comming soon? Should I wait for the JEE6? I would like to do my certification in the next 3 t

  • JTree hiding nodes

    Hi, I have an extrange problem. It seems that I'm unable to hide nodes with the treeRenderer and I don't know why. What I'm looking is to hiding leaf nodes, but leaving the nodes to expand. I don't want them remove because, they could become parents.