Problem in editing JTable fields.....

Hi there!!
I have got 2 classes in my package,one contains a public static JTable while the other has got some variables whose values I want the JTable's fields to populate with.Now the problem I have is that I can't populate the JTable's fields after making it's class's object and accessing the JTable using that object...Can anybody help plz?
Thanks...

Hi Cantry!!
I'm embedding my code in this post,,had to simplify the code as my application's code may not have been understandable,,,
Here's the code
//THIS IS THE CLASS CONTAINING JTable
import java.sql.*;
import java.util.StringTokenizer;
import javax.swing.JOptionPane;
import javax.swing.JTextField;
import javax.swing.*;
public class Test_GUI extends javax.swing.JFrame {
    /** Creates new form Test_GUI */
    public Test_GUI() {
        initComponents();
    // <editor-fold defaultstate="collapsed" desc=" Generated Code ">                     
    private void initComponents() {
        jScrollPane1 = new javax.swing.JScrollPane();
        jTable1 = new javax.swing.JTable();
        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
        setTitle("New Allocations");
        jTable1.setModel(new javax.swing.table.DefaultTableModel(
            new Object [][] {
                {null, null, null, null},
                {null, null, null, null},
                {null, null, null, null},
                {null, null, null, null}
            new String [] {
                "Title 1", "Title 2", "Title 3", "Title 4"
        jScrollPane1.setViewportView(jTable1);
        org.jdesktop.layout.GroupLayout layout = new
org.jdesktop.layout.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(layout.createSequentialGroup()
                .add(57, 57, 57)
                .add(jScrollPane1, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 344,
org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(106, Short.MAX_VALUE))
        layout.setVerticalGroup(
            layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(layout.createSequentialGroup()
                .add(55, 55, 55)
                .add(jScrollPane1, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 143,
org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(247, Short.MAX_VALUE))
        pack();
    }// </editor-fold>                       
     * @param args the command line arguments
    public static void main(String args[]) {
        Test_GUI tg2=new Test_GUI();
        tg2.SetTableValues();
        java.awt.EventQueue.invokeLater(new Runnable() {
            public void run() {
                new Test_GUI().setVisible(true);
        try
javax.swing.UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
                catch(Exception e)
                    e.printStackTrace();
        Test_GUI tg=new Test_GUI();
        tg.setVisible(true);
    // Variables declaration - do not modify                    
    private javax.swing.JScrollPane jScrollPane1;
    public static javax.swing.JTable jTable1;
    // End of variables declaration                  
    private javax.swing.JTextField jTextField6;
    public static void SetTableValues()
        System.out.println("here");
        Data_Class dc=new Data_Class();
        jTable1.setValueAt(dc.Test_data,0,0);
and code from the other calss,,,
//CLASS FROM WHERE I'M FETCHING THE DATA
public class Data_Class {
    static String Test_data="testdata";
    /** Creates a new instance of Data_Class */
    public Data_Class() {
}thanks in advance...

Similar Messages

  • CL_GUI_ALV_GRID problem: editable quantity field

    Hi,
    I have this ALV with editable quantity field type MEINS.
    The quantity is displayed with 3 decimals.
    eg. 1.000
    when I try to change the value to 99
    and call method CHECK_CHANGED_DATA to get the updated value.
    it turns into 0.099 in my internal table.
    same thing happens when i change the value to 99.000.
    Did i miss out anything?
    Please help.

    Hi Jeff,
    This can be done by setting ref_fieldname and ref_tabname in the field catalogue for Currency and Quantity fields .
    Hope this helps.

  • Problem printing the JTable

    Hi all,
    I have a problem with printing JTable.
    My application has a submit button,JTable and Print Button.
    As I click on the Submit button, the data is retrieved from the Database(MS Access) and displayed on the JTable.
    Now when I click on the Print button, the printer properties dialog box is displayed. But when I click on the print button in the dialog box, nothing is printed on the paper.
    I checked the printers and faxes in the control panel, It showed Java printing under the Document name and Printing under the Status. It is displayed for sometime and then disappeared after some time. But nothing is printed on the paper(not even the blank paper).
    I tried a lot but couldn't understand the problem.
    I have used the following files:
    PrintJTable.java
    import javax.swing.*;
    import java.awt.*;
    import java.awt.event.*;
    import java.awt.print.*;
    import java.awt.geom.*;
    import java.awt.Dimension;
    import java.applet.*;
    import java.sql.*;
    import java.util.*;
    import java.net.*;
    import java.lang.*;
    import javax.swing.table.*;
    import javax.swing.event.*;
    import javax.swing.border.*;
    class PrintJTable implements ActionListener,Printable
    Connection connect;
    ResultSet rs;
    JTable table;
    JScrollPane tableAggregate;
    DisplayTable displayTable;
    JButton print,submitButton;
    public PrintJTable()
    JFrame frame = new JFrame("Table");
    frame.addWindowListener(new WindowAdapter() {
    public void windowClosing(WindowEvent e) {System.exit(0);}});
    connect();
    displayTable= new DisplayTable();
    JButton submitButton= new JButton("SUBMIT");
    submitButton.addActionListener(this);
    JButton printButton= new JButton("PRINT!");
    // for faster printing turn double buffering off
    RepaintManager.currentManager( frame).setDoubleBufferingEnabled(false);
    printButton.addActionListener( new ActionListener(){
    public void actionPerformed(ActionEvent evt) {
    PrinterJob pj=PrinterJob.getPrinterJob();
    pj.setPrintable(PrintJTable.this);
    pj.printDialog();
    try{
    pj.print();
    }catch (Exception PrintException) {}
    tableAggregate = createTable();
    tableAggregate.setBorder(new BevelBorder(BevelBorder.LOWERED));
    frame.getContentPane().setLayout(new BorderLayout());
    frame.getContentPane().add(submitButton,BorderLayout.NORTH);
    frame.getContentPane().add(tableAggregate,BorderLayout.CENTER);
    frame.getContentPane().add(printButton,BorderLayout.SOUTH);
    frame.pack();
    frame.setVisible(true);
    } // end of constructor
    public void connect()
    try {
    Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
    System.out.println("Opening db connection");
    connect = DriverManager.getConnection("jdbc:odbc:Driver={MicroSoft Access Driver (*.mdb)};DBQ=C:/db1.mdb","","");
    catch (ClassNotFoundException ex) {
    System.err.println("Cannot find the database driver classes.");
    System.err.println(ex);
    catch (SQLException ex) {
    System.err.println("Cannot connect to this database.");
    System.err.println(ex);
    public JScrollPane createTable() {
    displayTable= new DisplayTable();
    JTable table = new JTable(displayTable);
         table.setAutoResizeMode(JTable.AUTO_RESIZE_OFF);
         table.getTableHeader().setReorderingAllowed(false);
    JScrollPane scrollpane = new JScrollPane(table,
    JScrollPane.VERTICAL_SCROLLBAR_ALWAYS,
    JScrollPane.HORIZONTAL_SCROLLBAR_ALWAYS);
    return scrollpane;
    } // end of createTable()
    public void actionPerformed(ActionEvent ie)
    try
    Statement statement6=connect.createStatement();
    ResultSet rs6=statement6.executeQuery("select * from benf_details");
    displayTable.executeQuery(rs6);
    statement6.close();
    catch(SQLException sqle)
    JOptionPane.showMessageDialog(null,"error2"+sqle);
    }// end of actionPerformed
    public int print(Graphics g, PageFormat pageFormat, int pageIndex) throws PrinterException {
    Graphics2D g2 = (Graphics2D)g;
    g2.setColor(Color.black);
    int fontHeight=g2.getFontMetrics().getHeight();
    int fontDesent=g2.getFontMetrics().getDescent();
    double pageHeight = pageFormat.getImageableHeight()-fontHeight; //leave room for page number
    double pageWidth = pageFormat.getImageableWidth();
    System.out.println("page width = " + pageWidth );
    double tableWidth = (double) table.getColumnModel().getTotalColumnWidth();
    System.out.println("table width = " + tableWidth );
    double scale = 1;
    if (tableWidth >= pageWidth) {
    scale = pageWidth / tableWidth;
    System.out.println("scale = " + scale );
    double headerHeightOnPage = table.getTableHeader().getHeight() * scale;
    double tableWidthOnPage = tableWidth * scale;
    double oneRowHeight = (table.getRowHeight() + table.getRowMargin()) * scale;
    int numRowsOnAPage = (int)((pageHeight - headerHeightOnPage) / oneRowHeight);
    double pageHeightForTable = oneRowHeight * numRowsOnAPage;
    int totalNumPages = (int)Math.ceil(((double)table.getRowCount())/numRowsOnAPage);
    if(pageIndex >= totalNumPages) {
    return NO_SUCH_PAGE;
    g2.translate(pageFormat.getImageableX(), pageFormat.getImageableY());
    g2.drawString("Page: "+ (pageIndex + 1),(int)pageWidth / 2 - 35,
    (int)( pageHeight + fontHeight - fontDesent ));//bottom center
    g2.translate( 0f, headerHeightOnPage );
    g2.translate( 0f, -pageIndex * pageHeightForTable );
    //If this piece of the table is smaller than the size available,
    //clip to the appropriate bounds.
    if (pageIndex + 1 == totalNumPages) {
    int lastRowPrinted = numRowsOnAPage * pageIndex;
    int numRowsLeft = table.getRowCount() - lastRowPrinted;
    g2.setClip(0, (int)(pageHeightForTable * pageIndex),
    (int) Math.ceil(tableWidthOnPage),
    (int) Math.ceil(oneRowHeight * numRowsLeft));
    //else clip to the entire area available.
    else{
    g2.setClip(0, (int)(pageHeightForTable * pageIndex),
    (int) Math.ceil(tableWidthOnPage),
    (int) Math.ceil(pageHeightForTable));
    g2.scale(scale,scale);
    table.paint(g2);
    g2.scale(1/scale,1/scale);
    g2.translate( 0f, pageIndex * pageHeightForTable);
    g2.translate( 0f, -headerHeightOnPage);
    g2.setClip(0, 0,(int) Math.ceil(tableWidthOnPage), (int)Math.ceil(headerHeightOnPage));
    g2.scale(scale,scale);
    table.getTableHeader().paint(g2);//paint header at top
    return Printable.PAGE_EXISTS;
    } // end of print()
    public static void main(String[] args) {
    new PrintJTable();
    }// end of PrintJTable
    DisplayTable.java
    import java.util.Vector;
    import java.sql.*;
    import javax.swing.*;
    import javax.swing.table.AbstractTableModel;
    import javax.swing.event.TableModelEvent;
    public class DisplayTable extends AbstractTableModel {
    Connection connection;
    Statement statement;
    ResultSet resultSet;
    String[] columnNames = {};
    Vector          rows = new Vector();
    ResultSetMetaData metaData;
    String db_uname,db_passwd;
    public DisplayTable() {
    public void executeQuery(ResultSet resultSet) {
    try {
    metaData = resultSet.getMetaData();
    int numberOfColumns = metaData.getColumnCount();
    columnNames = new String[numberOfColumns];
    // Get the column names and cache them.
    // Then we can close the connection.
    for(int column = 0; column < numberOfColumns; column++) {
    columnNames[column] = metaData.getColumnLabel(column+1);
    // Get all rows.
    rows = new Vector();
    while (resultSet.next()) {
    Vector newRow = new Vector();
    for (int i = 1; i <= getColumnCount(); i++) {
         newRow.addElement(resultSet.getObject(i));
    rows.addElement(newRow);
    // close(); Need to copy the metaData, bug in jdbc:odbc driver.
    fireTableChanged(null); // Tell the listeners a new table has arrived.
    catch (SQLException ex) {
    System.err.println(ex);
    public void close() throws SQLException {
    System.out.println("Closing db connection");
    resultSet.close();
    statement.close();
    connection.close();
    protected void finalize() throws Throwable {
    close();
    super.finalize();
    // Implementation of the TableModel Interface
    // MetaData
    public String getColumnName(int column) {
    if (columnNames[column] != null) {
    return columnNames[column];
    } else {
    return "";
    public Class getColumnClass(int column) {
    int type;
    try {
    type = metaData.getColumnType(column+1);
    catch (SQLException e) {
    return super.getColumnClass(column);
    switch(type) {
    case Types.CHAR:
    case Types.VARCHAR:
    case Types.LONGVARCHAR:
    return String.class;
    case Types.BIT:
    return Boolean.class;
    case Types.TINYINT:
    case Types.SMALLINT:
    case Types.INTEGER:
    return Integer.class;
    case Types.BIGINT:
    return Long.class;
    case Types.FLOAT:
    case Types.DOUBLE:
    return Double.class;
    case Types.DATE:
    return java.sql.Date.class;
    default:
    return Object.class;
    // to make the cells editable
    public boolean isCellEditable(int row, int column) {
    try {
    return metaData.isWritable(column+1);
    catch (SQLException e) {
    return false;
    public int getColumnCount() {
    return columnNames.length;
    // Data methods
    public int getRowCount() {
    return rows.size();
    public Object getValueAt(int aRow, int aColumn) {
    Vector row = (Vector)rows.elementAt(aRow);
    return row.elementAt(aColumn);
    public String dbRepresentation(int column, Object value) {
    int type;
    if (value == null) {
    return "null";
    try {
    type = metaData.getColumnType(column+1);
    catch (SQLException e) {
    return value.toString();
    switch(type) {
    case Types.INTEGER:
    case Types.DOUBLE:
    case Types.FLOAT:
    return value.toString();
    case Types.BIT:
    return ((Boolean)value).booleanValue() ? "1" : "0";
    case Types.DATE:
    return value.toString(); // This will need some conversion.
    default:
    return "\""+value.toString()+"\"";
    public void setValueAt(Object value, int row, int column) {
    try {
    String tableName = metaData.getTableName(column+1);
    // Some of the drivers seem buggy, tableName should not be null.
    if (tableName == null) {
    System.out.println("Table name returned null.");
    String columnName = getColumnName(column);
    String query =
    "update "+tableName+
    " set "+columnName+" = "+dbRepresentation(column, value)+
    " where ";
    // We don't have a model of the schema so we don't know the
    // primary keys or which columns to lock on. To demonstrate
    // that editing is possible, we'll just lock on everything.
    for(int col = 0; col<getColumnCount(); col++) {
    String colName = getColumnName(col);
    if (colName.equals("")) {
    continue;
    if (col != 0) {
    query = query + " and ";
    query = query + colName +" = "+
    dbRepresentation(col, getValueAt(row, col));
    System.out.println(query);
    System.out.println("Not sending update to database");
    // statement.executeQuery(query);
    catch (SQLException e) {
    // e.printStackTrace();
    System.err.println("Update failed");
    Vector dataRow = (Vector)rows.elementAt(row);
    dataRow.setElementAt(value, column);
    }

    Java 1.5 incorporates a very simple way to print from a JTable. I am using a mysql DB but it is the same concept. Review my code and let me know if you have any questions.
    package emsmain;
    import java.awt.*;
    import java.awt.event.ActionEvent;
    import java.awt.event.ActionListener;
    import java.io.*;
    import java.sql.*;
    import java.text.MessageFormat;
    import java.util.*;
    import javax.print.*;
    import javax.print.attribute.HashPrintRequestAttributeSet;
    import javax.print.attribute.PrintRequestAttributeSet;
    import javax.swing.*;
    import javax.swing.JTable;
    import javax.swing.table.*;
    import java.awt.print.*;
    public class TableFromDatabase extends JFrame implements ActionListener{
        JButton jbtprint = new JButton("Print Report");
        JTable Reporttable;
        Connection conn = Connect_Database.getConnection();
         public TableFromDatabase()
    Vector columnNames = new Vector();
    Vector data = new Vector();     
              try{  
                String query = null;
                Statement ps = null;
                ResultSet rs = null;
                  //Class Master List
                  if (Report_Menu.jrbMaster_list.isSelected()){
                      query =("Select * from students") ;
                  //Classes taken by student
                  if (Report_Menu.jrbClass_taken.isSelected()){
                      String taken = Report_Menu.jtfStudent.getText();
                      query = ("select program.course_num, course_name, course_start_date, course_stat_desc from registration, program where student_id = '"+taken+"' and program.course_num = registration.course_num");
                  //Birthday report
                  if (Report_Menu.jrbBirthday.isSelected()){
                      String birthday = (String) Report_Menu.jcb_birthday.getSelectedItem();
                      query = ("SELECT student_id, fname, lname, address, city, state_name, zipcode, dob FROM students where substring(dob, 6,2) = '"+birthday+"'"); 
                  //Course Catologue
                  if (Report_Menu.jrbCourseCatologue.isSelected()){
                      String course = (String) Report_Menu.jcbChooseCourse.getSelectedItem();
                      query = ("select  course_name, course_length, course_cost, course_credits from course where course_name = '"+course+"'");
                  //Certification expiration report
                  if (Report_Menu.jrbExpiration.isSelected()){
                      String month = (String) Report_Menu.jcbMonth.getSelectedItem();
                      String year = (String) Report_Menu.jcbYear.getSelectedItem();
                      query = ("SELECT FNAME, LNAME FROM STUDENTS, REGISTRATION WHERE substring(expiration_date, 6,2) = '"+month+"' and substring(expiration_date, 1,4) = '"+year+"' and registration.student_id = students.student_id") ;
                  //Class Roster
                  if (Report_Menu.jrbRoster.isSelected()){
                      String c_number = Report_Menu.jtfClassNumber.getText();
                      query = ("Select course_name, course_start_date, fname, lname from program, registration, students where program.course_num = '"+c_number+"' and registration.student_id = students.student_id;");
                  //Squad list and counts
                  if (Report_Menu.jrbSquadCount.isSelected()){
                      query = ("SELECT Squad_Name, count(student_id) from students group by Squad_Name");
                  //Student List
                  if (Report_Menu.jrbStudent_list.isSelected()){
                      String Choose_month = (String) Report_Menu.jcbcourse_month.getSelectedItem();
                      String Choose_Course = (String) Report_Menu.jcbcourse_name.getSelectedItem();
                      query = ("select count(student_id) from (registration, program) where program .course_name = '"+Choose_Course+"' and substring(course_start_date, 6,2) = '"+Choose_month+"'and registration.course_num = program.course_num;");
                ps = conn.createStatement();
                //Run Selected Report
                ps.execute(query);
                rs = ps.executeQuery(query);
                ResultSetMetaData md = rs.getMetaData();
                int columns = md.getColumnCount();
                //  Get column names
                for (int i = 1; i <= columns; i++)
                    columnNames.addElement( md.getColumnName(i) );
                //  Get row data
                while (rs.next())
                    Vector row = new Vector(columns);
                    for (int i = 1; i <= columns; i++)
                        row.addElement( rs.getObject(i) );
                    //add row data to JTable
                    data.addElement( row );
                rs.close();
                ps.close();
            catch(Exception e)
                JOptionPane.showMessageDialog(null,e.getMessage());
            //  Create Jtable with database data 
            Container c = getContentPane();
            c.setLayout(new BorderLayout());
            Reporttable = new JTable(data, columnNames);
            JScrollPane scrollPane = new JScrollPane( Reporttable );
            c.add( scrollPane );
            JPanel buttonPanel = new JPanel();
            buttonPanel.setLayout(new FlowLayout(FlowLayout.RIGHT));
            buttonPanel.add(jbtprint);
            c.add(buttonPanel,BorderLayout.SOUTH);
            jbtprint.addActionListener(this);
        public void actionPerformed(ActionEvent e){
             if(e.getActionCommand().equals("Print Report")){
               PrintForm();
    public void PrintForm(){ 
         try {
             String name = null;
             // Will display correct heading for print job
             if (Report_Menu.jrbMaster_list.isSelected()){
             name = "Master List";
             if (Report_Menu.jrbBirthday.isSelected()){
             name = "Birthday List";
             if (Report_Menu.jrbClass_taken.isSelected()){
             name = "Classes taken by Student";
             if (Report_Menu.jrbCourseCatologue.isSelected()){
             name = "Course Catalogue";
             if (Report_Menu.jrbExpiration.isSelected()){
             name = "Certification Expiration Report";
             if (Report_Menu.jrbRoster.isSelected()){
             name = "Class Roster";
             if (Report_Menu.jrbSquadCount.isSelected()){
             name = "Squad list with Student Counts";
             if (Report_Menu.jrbStudent_list.isSelected()){
             name = "Student count by Course";
             // fetch the printable
             Printable printable = Reporttable.getPrintable(JTable.PrintMode.FIT_WIDTH,
                                                      new MessageFormat(name),
                                                      new MessageFormat("Page - {0}"));
             // fetch a PrinterJob
             PrinterJob job = PrinterJob.getPrinterJob();
             // set the Printable on the PrinterJob
             job.setPrintable(printable);
             // create an attribute set to store attributes from the print dialog
             PrintRequestAttributeSet attr = new HashPrintRequestAttributeSet();
             // display a print dialog and record whether or not the user cancels it
             boolean printAccepted = job.printDialog(attr);
             // if the user didn't cancel the dialog
             if (printAccepted) {
                    try {
                          // do the printing (may need to handle PrinterException)
                        job.print(attr);
                    } catch (PrinterException ex) {
                        ex.printStackTrace();
         } finally {
             // restore the original table state here (for example, restore selection)
    }

  • Unable to edit certain fields in order type RE comparing with OR

    Dear friend,
    When I am creating return order with order type 'RE', I find out there are certain fields that are not editable. However, this issue doesnt happen with standard order(order type 'OR'). please refer to the following snapshot:
    where you can see fields such as 'intercom', 'payment term' is eidtiable in order type or, but not in RE. Anybody could tell me why? and what configuration control this screen layout? how to edit this? thanks!
    Best Regards
    T.P

    Hi Peng,
    do you face this only for you ID/few users or for every user these 2 fields are not editable ? you have to check this by asking your colleagues/users .
    If it is problem with few users then they have done some authorization check here only for few users.
    if it is for all, then as mentioned by Venugopal, some enhancement is done for this to make non editable these fields.
    What to you want, do you want to make it editable fields or do you just want to know why it has done ?
    Regards
    Sundar

  • Unable to edit "Note:" field in Address Book

    I have updated to Mac OS X 10.6.4 one week ago (from 10.5.).
    Now for the first, I am trying to edit the "Note:" field of one of my contacts, but I am neither able to add text, nor can I delete text.
    I have 47 lines of text in that Note field and wanted to add a few words, but after typing it, it keeps disappearing after a few seconds. If I delete a few lines of text, they keep reappearing after a few seconds.
    Editing the Note field (which has less lines of text) in another contact first exhibited the same behavior, but now works flawlessly.
    Having the "Edit" button depressed or not, does not make a difference.
    Address Book Help says that this happens when there is not enough disk space, but I have over 41GB left.

    Hello Marcus and others,
    I have experienced the same issues with my Address Book (version 5.0). First things first, let me suggest you complete a back up of your address book:
    1. Go to the File drop down menu
    2. Click on Export
    3. Select *Address Book Archive* from the 2 choices
    4. Choose where you would like to store this back up. Let's just say the Desktop for now.
    5. Disclaimer, any unsaved data will be lost during this reset, so please back up all files you will need.
    6. After you have successfully archived your Address Book, turn off your computer.
    7. Now here's the important part, hold down the power button for at least 6 seconds or until you hear a loud sound or tone. This should reset your settings back to default.
    This is how I just fixed the problem with editing the Notes of my contacts in my Address Book 5.0
    Good luck and I hope this helps someone.
    Nupeologist

  • Problem in editing  the table and again saving back to database through web

    hi ,
    i have created ztable and sucessfully able to display through webdynpro but my requirement is that the user should be able to select any of the record n that should be editable and after that the editable data should be saved again to data database .
    i have also alv components in methods of a view
    Create component usage for alv component
      data: l_ref_cmp_usage type ref to if_wd_component_usage.
      l_ref_cmp_usage =   wd_this->wd_cpuse_alv( ). >>>>>>errror
      if l_ref_cmp_usage->has_active_component( ) is initial.
        l_ref_cmp_usage->create_component( ).
      endif.
    Get config model
      data: l_ref_interfacecontroller type ref to iwci_salv_wd_table .
      l_ref_interfacecontroller = wd_this->wd_cpifc_alv( ).>>>>>error
      data: l_value type ref to cl_salv_wd_config_table.
      l_value = l_ref_interfacecontroller->get_model( ).
    set visible row count
    l_value->if_salv_wd_table_settings~set_visible_row_count( '5' ).
    Sort rows by seatsocc descending
    data: lr_field  type ref to cl_salv_wd_field.
    lr_field =
       l_value->if_salv_wd_field_settings~get_field( 'SEATSOCC' ).
    lr_field->if_salv_wd_sort~create_sort_rule( sort_order =
       if_salv_wd_c_sort=>sort_order_descending ).
    Display icon in column seatsocc
      data: lr_column type ref to cl_salv_wd_column,
            lr_image     type ref to cl_salv_wd_uie_image,
            lv_icon      type string.                           "#EC NEEDED
      lr_column = l_value->if_salv_wd_column_settings~get_column(
    'SEATSOCC'
      create object lr_image.
      lr_image->set_source_fieldname( 'STATUS' ).
      lr_column->set_cell_editor( lr_image ).              "Display traffic
    *light images in column 'SEATSOCCC'
    delete column STATUS
    l_value->if_salv_wd_column_settings~delete_column( 'STATUS' ).
    set cell editor for input fields (~make colum PRICE editable)
    DATA: lr_column_settings TYPE REF TO if_salv_wd_column_settings,
    lr_input_field TYPE REF TO cl_salv_wd_uie_input_field.
    lr_column_settings ?= l_value.
    lr_column = lr_column_settings->get_column( 'MATERIAL' ).
    CREATE OBJECT lr_input_field EXPORTING value_fieldname = 'MATERIAL'.
    lr_column->set_cell_editor( lr_input_field ).
    data: lr_table_settings type ref to if_salv_wd_table_settings.
    lr_table_settings ?= l_value.
    lr_table_settings->set_read_only( abap_false ).
    here in the code >>>error i have marked  it is saying that the method  wd_cpuse_alv  is unknown even with the method wd_cpifc_alv, firstly iam uable to edit the fields , ater that i can go futher , plz give me the step by step solution as iam new to it

    Hi shaik,
        I couldn't find any problem in the code.
    Whether that is the first method you are initializing the alv model?
    Try this, Comment the whole code in that method. Activate the whole component including views and then uncomment the code.
    Regards...
    Arun.

  • I need to substitute the default font (times roman) in my editable form fields with a san serif...

    I am making a PDF with editable form fields out of InDesign CS6. When I make the interactive PDF, the font, Helvetica Neue  is being substituted with the default font, Times Roman. The client has provided me with last years PDF which has a nice San Serif for the editable fields. I need to change the font either to Helvetica Neue, or at least to a nice San Serif common system font. I have Acrobat X.
    Thanks in advance!!

    I called a friend of mine who walked me through this so I will post the instructions for anyone else who may be having this problem...
    1. Open the PDF with the form fields in a recent version of Acrobat.
    2. Click on the Toolls tab.
    3. Under Forms, click Edit.
    4. Now you will see your fields listed under "Field" > "Sort by"...  "Text Field 1"...  etc.
    5. Holding "control" click where it says "Text Field 1" and some options will pop up.
    6. Click on "Properties".
    7. A "Text Fields Properties" window will pop up.
    8. Click on the "Appearance" tab.
    9. Here you can change your fonts and font sizes.
    Good luck!

  • What would cause a single user not to be able to edit the fields in a form? All other users are able to edit the form.

    I have a user who is unable to edit his time sheet in Adobe Reader XI. It worked fine in Adobe Reader 9.6. I recently upgraded his reader to version XI and he lost the ability to edit the fields. I re-imaged his machine and re-did his profile. He was able to edit his time sheet. A week later he's back to where he was. He was able to go to another machine with Adobe XI and edit his time sheet but he can't do it on his normal workstation. His time sheet shows the purple bar at the top telling him to fill out the form and that he can save data typed into the form. We're running XP SP3. How can I troubleshoot this?

    My guess would be keyboard related.  I'm guessing the field you're trying to fill has a keystroke event allowing only certain types of character.  If the keyboard is faulty OR if the keyboard's layout (English, french, numLock, capLock) have been changed, allowed character could be someplace else.
    I would first verify the presence of a particular format or a keystroke event in the format tab.  I would then test my layout by typing charaters in another application such as notepad.  Any chance the maximum character allowed would have mistaken be set to 0?
    Also, I see you mentionned:
    He was able to go to another machine with Adobe XI and edit his time sheet but he can't do it on his normal workstation
    By Adobe, I'm guessing you mean Reader.  Is it possible the default application on this other machine is Acrobat instead?  If it is the case, the problem would probably be the way the file was created and maybe it would require to enable Extended features.......

  • Problem with the quantity field

    hi every one
    i am facing a problem with the quantity field (vbap-kwmeng)
    as per my requirement i need to display this quantity field along with some other item fields from VBAP in an alv grid.
    among all the fields displayed in the alv grid only this quantity field is editable(end user can change this quantity)
    once end user changes this quantity and press save button i need to capture this new quantity in my internaltable.
    problem is input of length of quantity is 15 and the output length is 19
    so when i am pressing save
    say my quantity is 50 when i am pressing save '0.050' is coming because of the length difference
    how can i capture the original changed value.
    vamsi

    what about define two fields in  you inner table ,one as char and the other as vbap-kwmeng, you can show the char one in the ALV gird , when user input value and press SAVE ,you can move the value to vbap-kwmeng.
    you can test it,mybe some one has one better idea.

  • CS2 Pixel Problems when editing

    Hi, I am an amatuer Photoshop user.  I have recently had problems with editing pics either resizing or adjusting levels,  saving then trying to post to a website.  The pictures show up awfully pixeled.  I downloaded the same pics without editing and they look fine.  I have also had pics printed and I dont have the pixel problem.  I assume something is wrong with my PS CS2 software.  Is there a update to fix this problem or do I need to delete and reload my PS CS2 software program?

    Further information on this problem:  It seems to be linked to the condition of the data fields in the Revise HyperTrend window.
    Within this window is a box containing data lines corresponding to the items to be graphed.  The headings are:   Expression    Line Color    Min/Max/Pos/Height.
    There is room in this box for 19 lines of data.  If more than 19 Items are entered, a scroll bar appears to the right.
    It appears that attempting to adjust the widths of any of these fields (to view more of the data in a field, for example) triggers this problem.  It may also be triggered if the width of the data displayed is covered by the scroll bar.
    Can anyone figure out why this is happening and what to do about it?

  • Is it possible to have editable text field in interactive report?

    Is it possible to have editable text field in interactive report?
    Thanks,
    Dip

    Hi,
    I followed your suggestion and defined an IR with apex_item.text columns and it works fine. Now however I face a new problem when I run the page and use the standard Search Bar:
    - Click on Actions/Filter
    - Select a column, for example the employee name.
    - Open the Expression field LOV: I correctly see the different names.
    - When I select one of the names, in the Expression field, instead of the name, I see:
    "<input type="text" name="f03" size="20" maxlength="2000" value="Eugene" />"
    Horrible!!!!!!
    Is there a way to see the name and not that expression? The same thing get downloaded, so it´s really annoying.
    Thank you very much in advance for your help!!!
    Regards
    Francesco

  • Start or stop edit jtable cell editing

    Hello,
    I got a problem with the jtable DefaultModel isCellEditable.
    If I set the IsCellEditable to false, I would not be able to enable the cell selection as and when I want it.
    What I have in mind is the add a mouselister so that if the user select a row using fast left mouse click like the procedure shown below
    private class MouseClickHandler extends MouseAdapter {
    public void mouseClicked(MouseEvent event) {
    int no_mouseclick = 0;
    no_mouseclick = event.getClickCount();
    if (no_mouseclick >= 2) {
    int cur_row = 0;
    cur_row = table.getSelectedRow();
    // table.setColumnSelectionAllowed(true);
    // table.setRowSelectionAllowed(true);
    for (int i=0;i<table.getColumnCount();i++){
    table.editCellAt(cur_row,i);
    System.out.println("mouse row--->" + cur_row);
    I could overwrite the IsCellEditable to true to enable that particular or cell contains in that row to be able to accept input and overwrite any data which in my case obtained from the Sql database a sort of like input module using tabulation . I am also thinking of using text component or combobox to display the value for user selection , but I do not know how to enable a particular cell for editing if the Jtable created is using a non-editable DefaultModel. If I set the IsCellEditable to true, every single cell would be enable for editing , and this defeat the purpose of enable user input only upon double mouseclicks.
    By the way , I am interested to know how to track the data changes in the cell within the jtable so that only those have been modified are notify from the Table model and updated into the Sql table
    Could anyone of you out there provide some hints please
    Thanks

    Hello,
    Tablemodellistener could detect the changes in the data, how about the backend database updating and transactional activity that must be associated with the data changes?
    What is on my mind is that , the moment there is changes in the data detected by the TableModellistener, whatever records associated with or brougt up by Jtable would be all deleted from the database and then follow by the new set of new records to be inserted into the database. The disadvantage of this method is that everytime the backend database connection and activity need to be executed the moment there is a change in the data in the jtable cell. For example the user may be just amendment to only one cell , but all the records associated need to be deleted and then inserted again.
    Perhaps there are better solution to deal with Jtable and JDBC backend connection where in this case, I am using JDO to undertake the database activity like the observable modelling .
    Could someone provide the hint please
    Thank

  • Problem in editable  alv table .

    hello friends ,
    i am facing a problem in editable alv ,the problem is  while saving my data in internal table through editable alv one of my numeric field  is being  wrongly  updated  .
    for eg :  if i am entering  '2.00 ' in the field the value updated is 0.02.
    regards ,
    arpit.

    Dear Arpit
    Please check the below code and it may very useful
    TABLES: VBAK, VBAP.
    TYPE-POOLS: SLIS, ICON.
    DATA: BEGIN OF ITAB OCCURS 0,
          VBELN LIKE VBAK-VBELN,
          ERDAT LIKE VBAK-ERDAT,
          END OF ITAB.
    DATA: BEGIN OF JTAB OCCURS 0,
          VBELN LIKE VBAP-VBELN,
          MATNR LIKE VBAP-MATNR,
          KWMENG LIKE VBAP-KWMENG,
          END OF JTAB.
    DATA: TB_FCAT TYPE SLIS_T_FIELDCAT_ALV,
          WA_FCAT LIKE LINE OF TB_FCAT,
          WA_LAYOUT TYPE SLIS_LAYOUT_ALV,
          TB_EVENT TYPE SLIS_T_EVENT,
          WA_EVENT LIKE LINE OF TB_EVENT,
          TB_HEADER TYPE SLIS_T_LISTHEADER,
          WA_HEADER LIKE LINE OF TB_HEADER,
          WA_KEYINFO TYPE SLIS_KEYINFO_ALV.
    CLEAR WA_FCAT.
    WA_FCAT-ROW_POS = '1'.
    WA_FCAT-COL_POS = '1'.
    *WA_FCAT-REF_FIELDNAME  = 'VBELN'.
    WA_FCAT-REF_TABNAME = 'VBAK'.
    *WA_FCAT-OUTPUTLEN = '10'.
    WA_FCAT-FIELDNAME = 'VBELN'.
    WA_FCAT-EDIT = 'X'.
    WA_FCAT-SELTEXT_M = 'DOCUMENT'.
    APPEND WA_FCAT TO TB_FCAT.
    CLEAR WA_FCAT.
    WA_FCAT-ROW_POS = '1'.
    WA_FCAT-COL_POS = '2'.
    *WA_FCAT-REF_FIELDNAME  = 'ERDAT'.
    WA_FCAT-REF_TABNAME = 'VBAK'.
    WA_FCAT-FIELDNAME = 'ERDAT'.
    *WA_FCAT-EDIT = 'X'.
    WA_FCAT-SELTEXT_M = 'DATE'.
    APPEND WA_FCAT TO TB_FCAT.
    CASE SY-UCOMM.
      WHEN 'VBELN'.
        WA_FCAT-SELTEXT_M = 'SURENDRA'.
        MODIFY TB_FCAT FROM WA_FCAT.
    ENDCASE.
    SELECT VBELN ERDAT FROM VBAK INTO CORRESPONDING FIELDS OF TABLE ITAB UP TO 15 ROWS.
    CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
    EXPORTING
       I_CALLBACK_PROGRAM                = SY-REPID
       IS_LAYOUT                         = WA_LAYOUT
       IT_FIELDCAT                       = TB_FCAT
    TABLES
        T_OUTTAB                          = ITAB
    IF SY-SUBRC <> 0.
    * MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    Thanks
    Surendra P

  • While generating a crystal report can we edit database fiels in field explorer (at middle can we edit database fields)

    while generating a crystal report can we edit database fiels in field explorer (at middle can we edit database fields)

    Wrong forum to post the question, try to post the question in crystal reports community.
    Its not possible to edit the database fields while creating the reports, its only used to call the rows of values in it. Can you explain me in detail what are you actually looking for .
    --SumanT

  • Problem with Edit IN function between LR 2.3 and PS CS3

    I recently upgraded my system to a Windows Vista 64 bit Core 2 Quad with 8 GB.  Lightroom now works and loads images the way it should. I do have one major concern and need any help possible.
    I am using LR 2.3 in 64 bit and PS CS3 ver 10.0.1 (which is 32 bit - loads slowly but otherwise works fine).  The problem I am encountering is in LR Develop / Photo / Edit In...  - using any of the menu items:
    "Edit in Abode Photoshop CS3"
    "Open as Smart Object In Photoshop"
    "Merge to Panorama in Photoshop"
    "Merge to HDR in Photoshop"
    "Open as layers in Photoshop"
    Photoshop opens but no image(s) are exported and I receive the message in LR - "The file could not be edited because Adobe Photoshop CS3 could not be launched."
    Photoshop, however, was launched but no image exported and so I can't work on the image in PS.  The appropriate TIFF image is created in LR for the first two menu items - nothing for the last three menu items.
    I can create a partial work around by setting PS as an external editor, however, I can't use 4 of 5 of the menu items.
    All the menu items work fine in Windows XPpro.
    Any help is much appreciated.
    PS I also tried the most recent Window 7 RC with exactly the same results.
    Thanks
    Bob

    Don
    I wasn't shouting - I just cut and paste the exact text and font in its original size and type as was shown in the message.  Never had a thought that someone would be offended by cutting and pasting exactly what was in a message - it would appear that John Williams saw it for what it was.
    However, sorry if I offended you.
    Bob
    Date: Mon, 1 Jun 2009 19:15:15 -0600
    From: [email protected]
    To: [email protected]
    Subject: Problem with Edit IN function between LR 2.3 and PS CS3
    There is no reason to shout. There are only other users here trying to help.
    >

Maybe you are looking for

  • So my ipod was stolen and i got it back but its still in his account

    so my ipod was stolen and i got it back but its still in his account how do i get out of it

  • Automatic Plant determination logic in the order line item level

    Dear all, I would like to know if there is a possibility to determine plants automatically, avoiding the standard plant determination logic at line item level, to determine plant based on stock availability. The process will be to skip the standard p

  • A rmiregistry problem!

    i type rmiregistry & but return a error... Invalid JAVA_HOME: .;d:\JBuilerX\jdk1.4;d:\JBuilderx\jdk1.4\jre\lib i don't know why ,look forward to answering

  • FitFrameToContent is going too small

    I'm using InDesign server to create documents. The document must precisely position a single character. I'm using FitFrameToContent expecting to get the bounds of the character, but the frame is reducing beyond that size. I've attached a JPG to show

  • IWeb is only importing 644 of 1064 pics... help

    I have no idea why iWeb refuses to make a complete gallery of my event in iPhoto (1000+ pic/mov). It stops at 643 for some reason. I've tried creating a new site, etc. etc. I'm not getting anywhere. Any suggestions?