Cancel cell moving after type enter in jtable

Hello !
Im working with a swing jtable, I want to do something at event jTableKeyPressed, with Enter, It's Ok. But after that I want to cancel the Enter movment to the next row.
Can anybody tell me how to do that ?

And that is why Swing related questions should be posted in the Swing forum, because Swing developers do know the technique.agree
Why? Again we don't know the OPs full requirement. All the OP said was he didn't want it to go to the next row. So I would say the solution is working correctly. It doesn't go to the next row.also agree.
I was just thinking from users perspective. If I were using such application, after editing cell and hitting ENTER I would expect the cell to loose focus so I could move to next one. As you mentioned in another thread - list all drawbacks of your solution so others can make decision weather to use it or not. Just listened to your advice.

Similar Messages

  • Return to the cell after data validation in JTable

    Hi,
    I am implementing an editable JTable. I want the focus or selection return to the current editing cell when the user inputing a wrong format data. I can catch the validation error and pop up a error message to user. But I can not return the focus or selection to the editing cell.
    If anyone has already solved this problem, please give me your solution.
    Thank you!
    I have tried:
    1.
    In tableChanged(TableModelEvent e) method:
    int row = e.getFirstRow();
    int column = e.getColumn();
    Object data = newJTable.getValueAt(row, column);
    if(!validation(data)) // return true if validation OK
    editFailed = true;//class variable
    previousRow = row;//class variable
    previousCol = column;//class variable
    Add a focus listener to the table and implement the focus listener's focusLost method with:
    if(validationFailed)
    table.editCellAt(previousRow, previousCol);
    This does move the focus to the editing cells if you want to continue to edit the table.
    Problems are
    If you move the focus out of the table, the wrong date will be in the table or not edited.
    The selection color was shown on the next cell where you pointed your mouse to after you leave the editing cells.
    2. I have also tried to use:
    in the above focusLost method
    table.clearSelection();
    table.editCellAt(previousRow, previousCol);
    table.setRowSelectionInterval(previousRow, previousRow);
    table.setColumnSelectionInterval(previousCol, previousRow);
    But it did not change the selection.
    Shaolong

    This is the fix for the above problem.
    Basically we need to handle both mouse/keyboard actions on our own.
    This code returns the control to errorCell..
    /* TableCellValidator class */
    /* The class basically validates the input entry in a cell and */
    /* pops up a JOptionPane if its an invalid input */
    /* And an OK is clicked on the JOptionPane, the control returns back */
    /* to the same cell */
    /* Basic Idea: The controls Arrow/Tab/mouse clicks are handled by our */
    /* ----------- custom table. Its has been slightly tricky to handle */
    /* mouse clicks, since when you click the next cell, the */
    /* editingrow/editingcol advances. Hence the */
    /* previousrow/previouscol has been captured in the */
    /* setValueAt method. */
    /* To capture Table/Arrow/Numeric Arrow, The keyStrokes(TAB etc)*/
    /* assigned different AbstractionActions to execute like */
    /* validateBeforeTabbingToNextCell */
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    import javax.swing.table.*;
    public class TableCellValidator {
    * Constructor.
    * Basically instantiates the class and sets up the
    * JFrame object and the table.
    public TableCellValidator() {
    JFrame f = new JFrame("JTable test");
    f.getContentPane().add(new JScrollPane(createTable()), "Center");
    f.pack();
    f.setVisible(true);
    f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    * A method which created our custom table.
    * The JTable methods processMouseEvent
    * and setValueAt are overridden to handle
    * Mouseclicks.
    * The Tables ActionMap is fed with different
    * AbstractAction classes eg: (validateBeforeTabbingToNextCell)
    * (Scroll down below for the innerclass
    * validateBeforeTabbingToNextCell).
    * So basically when TAB is pressed the stuff present
    * in the validateBeforeTabbingToNextCell's actionPerformed(..)
    * method is performed.
    * So we need to handle all the stuff a TAB does.
    * ie. if a TAB hits the end of the row, we need to increment
    * it to the next Row (if the validation is successful)
    * in the current row etc..
    * @return JTable
    * @see validateBeforeTabbingToNextCell
    * @see validateBeforeShiftTabbingToNextCell
    * @see validateBeforeMovingToNextCell
    * @see validateBeforeMovingDownToCell
    * @see validateBeforeMovingUpToCell
    * @see validateBeforeMovingLeftToCell
    private JTable createTable() {
    JTable table = new JTable(createModel()){
    private int previousRow =0;
    private int previousCol =0;
    * Processes mouse events occurring on this component by
    * dispatching them to any registered
    * <code>MouseListener</code> objects.
    * <p>
    * This method is not called unless mouse events are
    * enabled for this component. Mouse events are enabled
    * when one of the following occurs:
    * <p><ul>
    * <li>A <code>MouseListener</code> object is registered
    * via <code>addMouseListener</code>.
    * </ul>
    * <p>Note that if the event parameter is <code>null</code>
    * the behavior is unspecified and may result in an
    * exception.
    * @param e the mouse event
    * @see java.awt.event.MouseEvent
    * @see java.awt.event.MouseListener
    * @see #addMouseListener
    * @see #enableEvents
    * @since JDK1.1
    protected void processMouseEvent(MouseEvent e) {
    boolean canMoveFocus = true;
    int currentRowAndColumn[] = getCurrentRowAndColumn(this); //we pull the current row and column
    int row = currentRowAndColumn[0];
    int column = currentRowAndColumn[1];
    if ( e.getID() == MouseEvent.MOUSE_PRESSED || e.getID() == MouseEvent.MOUSE_CLICKED) {
    stopCurrentCellBeingEdited(this); //stop the cellbeing edited to grab its value
    final String value = (String)getModel().getValueAt(row,column);
    try {
    Integer.parseInt(value);
    } catch (NumberFormatException nfe) {
    SwingUtilities.invokeLater(new Runnable(){
    public void run() {
    JOptionPane.showMessageDialog(null,"Alpha value ="+ value ,"Invalid entry!",JOptionPane.WARNING_MESSAGE);
    changeSelection(previousRow,previousCol, true, true);
    editCellAt(previousRow, previousCol);
    requestFocus(); // or t.getEditorCompo
    if ( canMoveFocus ) {
    super.processMouseEvent(e);
    * The method setValueAt of the JTable is overridden
    * to save the previousRow/previousCol to enable us to
    * get back to the error cell when a Mouse is clicked.
    * This is circumvent the problem, when a mouse is clicked in
    * a different cell, the control goes to that cell and
    * when you ask for getEditingRow , it returns the row that
    * the current mouse click occurred. But we need a way
    * to stop at the previous cell(ie. the cell that we were editing
    * before the mouse click occurred) when an invalid data has
    * been entered and return the focus to that cell
    * @param aValue
    * @param row
    * @param col
    public void setValueAt(Object aValue,int row, int col) {     
    this.previousRow = row;
    this.previousCol = col;
    super.setValueAt(aValue,row,col);
    /* These are the various KeyStrokes like
    ENTER,SHIFT-TAB,TAB,Arrow Keys,Numeric Arrow keys being assigned an Abstract action (key string ) in to the
    inputMap first . Then an Action is assigned in the ActionMap object
    table.getInputMap(JTable.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT).put(KeyStroke.getKeyStroke(KeyEvent.VK_TAB,0) ,"validateBeforeTabbingToNextCell");
    table.getInputMap(JTable.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT).put(KeyStroke.getKeyStroke(KeyEvent.VK_TAB,1) ,"validateBeforeShiftTabbingToNextCell");
    table.getInputMap(JTable.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT).put(KeyStroke.getKeyStroke(KeyEvent.VK_RIGHT,0) ,"validateBeforeMovingToNextCell");
    table.getInputMap(JTable.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT).put(KeyStroke.getKeyStroke(KeyEvent.VK_KP_RIGHT,0) ,"validateBeforeMovingToNextCell");
    table.getInputMap(JTable.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT).put(KeyStroke.getKeyStroke(KeyEvent.VK_DOWN,0) ,"validateBeforeMovingDownToCell");
    table.getInputMap(JTable.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT).put(KeyStroke.getKeyStroke(KeyEvent.VK_KP_DOWN,0) ,"validateBeforeMovingDownToCell");
    table.getInputMap(JTable.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT).put(KeyStroke.getKeyStroke(KeyEvent.VK_ENTER,0) ,"validateBeforeMovingDownToCell");
    table.getInputMap(JTable.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT).put(KeyStroke.getKeyStroke(KeyEvent.VK_UP,0) ,"validateBeforeMovingUpToCell");
    table.getInputMap(JTable.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT).put(KeyStroke.getKeyStroke(KeyEvent.VK_KP_UP,0) ,"validateBeforeMovingUpToCell");
    table.getInputMap(JTable.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT).put(KeyStroke.getKeyStroke(KeyEvent.VK_LEFT,0) ,"validateBeforeMovingLeftToCell");
    table.getInputMap(JTable.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT).put(KeyStroke.getKeyStroke(KeyEvent.VK_KP_LEFT,0) ,"validateBeforeMovingLeftToCell");
    table.getActionMap().put("validateBeforeTabbingToNextCell",
    new validateBeforeTabbingToNextCell());
    table.getActionMap().put("validateBeforeShiftTabbingToNextCell",
    new validateBeforeShiftTabbingToNextCell());
    table.getActionMap().put("validateBeforeMovingToNextCell",
    new validateBeforeMovingToNextCell());
    table.getActionMap().put("validateBeforeMovingDownToCell",
    new validateBeforeMovingDownToCell());
    table.getActionMap().put("validateBeforeMovingUpToCell",
    new validateBeforeMovingUpToCell());
    table.getActionMap().put("validateBeforeMovingLeftToCell",
    new validateBeforeMovingLeftToCell());
    table.setPreferredScrollableViewportSize(table.getPreferredSize());
    return table;
    * A table model is created here for 5 rows/5 columns.
    * And the isCellEditable is overridden to return true,
    * indicating that the cell can be edited.
    * So fine tuned control can be done here by saying,
    * the user can be allowed to edit Row 1,3 or 5 only.
    * or column 1 only etc..
    * @return DefaultTableModel
    private DefaultTableModel createModel() {
    DefaultTableModel model = new DefaultTableModel(5, 5) {
    public boolean isCellEditable(int row, int column) {
    return true;
    return model;
    * This method basically returns the currentRow/currentCol value
    * If the current Row/Col is being edited then
    * it returns the getEditingRow/getEditingColumn
    * If its not being edited,
    * it return the getAnchorSelectionIndex of the JTables
    * ListSelectionModel.
    * If the column or row is -1, then it return 0.
    * The first element in the int[] array is the row
    * The second element in the int[] array is the column
    * @param t input a JTable
    * @return int[]
    * @see ListSelectionModel
    * @see JTable
    private int[] getCurrentRowAndColumn(JTable t){
    int[] currentRowAndColum = new int[2];
    int row, column;
    if (t.isEditing()) {
    row = t.getEditingRow();
    column = t.getEditingColumn();
    } else {
    row = t.getSelectionModel().getAnchorSelectionIndex();
    if (row == -1) {
    if (t.getRowCount() == 0) {
    //actually this should never happen.. we need to return an exception
    return null;
    column =t.getColumnModel().getSelectionModel().getAnchorSelectionIndex();
    if (column == -1) {
    if (t.getColumnCount() == 0) {
    //actually this should never happen.. we need to return an exception
    return null;
    column = 0;
    currentRowAndColum[0]=row;
    currentRowAndColum[1]=column;
    return currentRowAndColum;
    * Tbis basically a wrapper method for CellEditors,
    * stopCellEditing method.
    * We need to do this because,
    * for instance we have entered a value in Cell[0,0] as 3
    * and when we press TAB or mouse click or any other relevant
    * navigation keys,
    * ** IF the cell is BEING EDITED,
    * when we do a getValueAt(cellrow,cellcol) at the TableModel
    * level , it would return "null". To overcome this problem,
    * we tell the cellEditor to stop what its doing. and then
    * when you do a getValueAt[cellrow,cellcol] it would
    * return us the current cells value
    * @param t Input a JTable
    * @see CellEditor
    private void stopCurrentCellBeingEdited(JTable t){
    CellEditor ce = t.getCellEditor(); /*this not the ideal way to do..
    since there is no way the CellEditor could be null.
    But a nullpointer arises when trying to work with mouse.. rather than just
    keyboard" */
    if (ce!=null) {
    ce.stopCellEditing();
    * The following Action class handles when a
    * RIGHT ARROW or NUMERIC RIGHT ARROW is pressed.
    * There just a basic checking for Numeric values
    * (Integer.parseInt) inside the code.
    * When validation is successfull, we need to move it to the
    * next Cell.. else take it back to the currentCell
    class validateBeforeMovingToNextCell extends AbstractAction {
    * The following Action class handles when a
    * DOWN ARROW or NUMERIC DOWN ARROW is pressed.
    * There is just a basic checking for Numeric values
    * (Integer.parseInt) inside the code.
    * When validation is successfull, we need to move it to
    * down by one Cell.. else take it back to the currentCell
    * @param e
    public void actionPerformed(ActionEvent e) {
    JTable t = (JTable) e.getSource();
    int currentRowAndColumn[] = getCurrentRowAndColumn(t);
    int row = currentRowAndColumn[0];
    int column = currentRowAndColumn[1];
    stopCurrentCellBeingEdited(t);
    String value = (String)t.getModel().getValueAt(row,column);
    if (value!= null && !value.equals("")) {
    try {
    Integer.parseInt(value);
    } catch (NumberFormatException nfe) {
    JOptionPane.showMessageDialog(null,"Please input numeric values at cell[row="+row+","+"col="+column+"]","Invalid Input!!",JOptionPane.WARNING_MESSAGE);
    t.changeSelection(row, column, true, true);
    t.editCellAt(row,column);
    t.getEditorComponent().requestFocus();
    return;
    column++;
    if (column >= t.getColumnCount())
    column = column-1;
    if (t.isCellEditable(row, column)) {
    t.changeSelection(row, column, true, true);
    t.editCellAt(row, column);
    if ((t.getEditingRow() == row)
    && (t.getEditingColumn() == column)) {
    t.requestFocus();
    return;
    * The following Action class handles when a
    * DOWN ARROW or NUMERIC DOWN ARROW is pressed.
    * There just a basic checking for Numeric values
    * (Integer.parseInt) inside the code.
    * When validation is successfull, we need to move it to the
    * down by Cell.. else take it back to the currentCell
    class validateBeforeMovingDownToCell extends AbstractAction {
    public void actionPerformed(ActionEvent e) {
    JTable t = (JTable) e.getSource();
    int currentRowAndColumn[] = getCurrentRowAndColumn(t);
    int row = currentRowAndColumn[0];
    int column = currentRowAndColumn[1];
    stopCurrentCellBeingEdited(t);
    String value = (String)t.getModel().getValueAt(row,column);
    if (value!= null && !value.equals("")) {
    try {
    Integer.parseInt(value);
    } catch (NumberFormatException nfe) {
    JOptionPane.showMessageDialog(null,"Please input numeric values at cell[row="+row+","+"col="+column+"]","Invalid Input!!",JOptionPane.WARNING_MESSAGE);
    t.changeSelection(row, column, true, true);
    t.editCellAt(row,column);
    t.getEditorComponent().requestFocus();
    return;
    row++;
    if (row >= t.getRowCount())
    row = row - 1;
    if (t.isCellEditable(row, column)) {
    t.changeSelection(row, column, true, true);
    t.editCellAt(row, column);
    if ((t.getEditingRow() == row)
    && (t.getEditingColumn() == column)) {
    t.requestFocus();
    return;
    * The following Action class handles when a
    * UP ARROW or NUMERIC UP ARROW is pressed.
    * There just a basic checking for Numeric values
    * (Integer.parseInt) inside the code.
    * When validation is successfull, we need to move the cursor/
    * editable status up by a Cell.. else take it back to the currentCell
    class validateBeforeMovingUpToCell extends AbstractAction {
    public void actionPerformed(ActionEvent e) {
    JTable t = (JTable) e.getSource();
    int currentRowAndColumn[] = getCurrentRowAndColumn(t);
    int row = currentRowAndColumn[0];
    int column = currentRowAndColumn[1];
    stopCurrentCellBeingEdited(t);
    String value = (String)t.getModel().getValueAt(row,column);
    if (value!= null && !value.equals("")) {
    try {
    Integer.parseInt(value);
    } catch (NumberFormatException nfe) {
    JOptionPane.showMessageDialog(null,"Please input numeric values at cell[row="+row+","+"col="+column+"]","Invalid Input!!",JOptionPane.WARNING_MESSAGE);
    t.changeSelection(row, column, true, true);
    t.editCellAt(row,column);
    t.getEditorComponent().requestFocus();
    return;
    row--;
    if (row <0)
    row = 0;
    if (t.isCellEditable(row, column)) {
    t.changeSelection(row, column, true, true);
    t.editCellAt(row, column);
    if ((t.getEditingRow() == row)
    && (t.getEditingColumn() == column)) {
    t.requestFocus();
    return;
    * The following Action class handles when a
    * LEFT ARROW or NUMERIC LEFT ARROW is pressed.
    * There just a basic checking for Numeric values
    * (Integer.parseInt) inside the code.
    * When validation is successfull, we need to move the cursor/
    * editable status up by a Cell.. else take it back to the currentCell
    class validateBeforeMovingLeftToCell extends AbstractAction {
    public void actionPerformed(ActionEvent e) {
    JTable t = (JTable) e.getSource();
    int currentRowAndColumn[] = getCurrentRowAndColumn(t);
    int row = currentRowAndColumn[0];
    int column = currentRowAndColumn[1];
    stopCurrentCellBeingEdited(t);
    String value = (String)t.getModel().getValueAt(row,column);
    if (value!= null && !value.equals("")) {
    try {
    Integer.parseInt(value);
    } catch (NumberFormatException nfe) {
    JOptionPane.showMessageDialog(null,"Please input numeric values at cell[row="+row+","+"col="+column+"]","Invalid Input!!",JOptionPane.WARNING_MESSAGE);
    t.changeSelection(row, column, true, true);
    t.editCellAt(row,column);
    t.getEditorComponent().requestFocus();
    return;
    column--;
    if (column <0)
    column = 0;
    if (t.isCellEditable(row, column)) {
    t.changeSelection(row, column, true, true);
    t.editCellAt(row, column);
    if ((t.getEditingRow() == row)
    && (t.getEditingColumn() == column)) {
    t.requestFocus();
    return;
    * The following Action class handles when a TAB is pressed.
    * There just a basic checking for Numeric values
    * (Integer.parseInt) inside the code.
    * When validation is successfull, we need to move the cursor/
    * editable status up by a Cell.. else take it back to the currentCell
    class validateBeforeTabbingToNextCell extends AbstractAction {
    public void actionPerformed(ActionEvent e) {
    JTable t = (JTable) e.getSource();
    int currentRowAndColumn[] = getCurrentRowAndColumn(t);
    int row = currentRowAndColumn[0];
    int column = currentRowAndColumn[1];
    stopCurrentCellBeingEdited(t);
    String value = (String)t.getModel().getValueAt(row,column);
    if (value!= null && !value.equals("")) {
    try {
    Integer.parseInt(value);
    } catch (NumberFormatException nfe) {
    JOptionPane.showMessageDialog(null,"Please input numeric values at cell[row="+row+","+"col="+column+"]","Invalid Input!!",JOptionPane.WARNING_MESSAGE);
    t.changeSelection(row, column, true, true);
    t.editCellAt(row,column);
    t.getEditorComponent().requestFocus();
    return;
    column++;
    int rows = t.getRowCount(), columns = t.getColumnCount();
    while (row < rows) {
    while (column < columns) {
    if (t.isCellEditable(row, column)) {
    t.changeSelection(row, column, true, true);
    t.editCellAt(row, column);
    if ((t.getEditingRow() == row)
    && (t.getEditingColumn() == column)) {
    t.requestFocus();
    return;
    column++;
    row++;
    column = 0;
    row = 0;
    if (t.isCellEditable(row, column)) {
    t.changeSelection(row, column, true, true);
    t.editCellAt(row, column);
    if ((t.getEditingRow() == row)
    && (t.getEditingColumn() == column)) {
    t.requestFocus();
    return;
    * The following Action class handles when a SHIFT TAB is pressed.
    * There just a basic checking for Numeric values
    * (Integer.parseInt) inside the code.
    * When validation is successfull, we need to move the cursor/
    * editable status up by a Cell.. else take it back to the currentCell
    class validateBeforeShiftTabbingToNextCell extends AbstractAction {
    public void actionPerformed(ActionEvent e) {
    JTable t = (JTable) e.getSource();
    int currentRowAndColumn[] = getCurrentRowAndColumn(t);
    int row = currentRowAndColumn[0];
    int column = currentRowAndColumn[1];
    stopCurrentCellBeingEdited(t);
    String value = (String)t.getModel().getValueAt(row,column);
    if (value!= null && !value.equals("")) {
    try {
    Integer.parseInt(value);
    } catch (NumberFormatException nfe) {
    JOptionPane.showMessageDialog(null,"Please input numeric values at cell[row="+row+","+"col="+column+"]","Invalid Input!!",JOptionPane.WARNING_MESSAGE);
    t.changeSelection(row, column, true, true);
    t.editCellAt(row,column);
    t.getEditorComponent().requestFocus();
    return;
    column--;
    int rows = t.getRowCount(), columns = t.getColumnCount();
    while ((row < rows) && (row >= 0)) {
    while ((column < columns) && (column >= 0)) {
    if (t.isCellEditable(row, column)) {
    t.changeSelection(row, column, true, true);
    t.editCellAt(row, column);
    if ((t.getEditingRow() == row)
    && (t.getEditingColumn() == column)) {
    t.requestFocus();
    return;
    column--;
    row--;
    column = columns - 1;
    row = rows - 1;
    if (t.isCellEditable(row, column)) {
    t.changeSelection(row, column, true, true);
    t.editCellAt(row, column);
    if ((t.getEditingRow() == row)
    && (t.getEditingColumn() == column)) {
    t.requestFocus();
    return;
    public static void main(String[] args) {
    new TableCellValidator();

  • Cancel of GRN after Clearing from QM

    Hi,
      We have one material for which we have mainatin QM view now we have created GR and thematerial is updated from Quality and laso the material is updated in store now the ,aterial is in store  but we want to canel the GRN  i have try with MBST and MIGO  but system is giving as
    You cannot cancel GR, since inspection lot is already partly posted
    and also it is not aloowing to change the stock type in MBST 
    Now HOW TO CANCEL the GRN
    regards,
    zafar

    Hi,
    In SAP stand you can not cancel the GR once the material is podted to QA reason the moment you do GR system will create inpection lot and material is moved to QA. You have to go to QA32 to clear the material depnding upon the UD once UD is made automatically stock will moved to Unrestricated or Blocked type from where you can return to vendor in case of rejection.
    But still if you wants to cancel there exit available in QA to cancel the UD after that you can cancel the GR.
    What you can do is carry out return delivery with 122 for entire qty or partial qty as per your requirement  Then do Re-GR for & complete the process. While doing Re -GR note that for exciseable material enter delivery & Excise invoice No with DOT to differeinitate invoice NO as you can not same invoice no twice.
    Regards

  • How to cancel the GR after UD

    Hi
    i have created a GR (migo) and in this step i have also captured the excise invoice. QC people done the UD. after that i came to know that GR is wrong. now i want to cancel the GR.
    and make the new GR against the same PO.
    Thanks & Regards
    Pankaj Garg

    Dear,
    Choose Logistics -> Materials Management -> Inventory Management -> Goods Movement -> Goods receipt -> For purchase order -> PO number known.
    - The initial screen for creating a goods receipt for a purchase order appears.
    - In the field for the movement type, enter 102 (goods receipt for a purchase order into warehouse - reversal). 
    - In the field for the purchase order, enter the purchase order number for the original goods receipt. 
    - You can copy the purchase order number from the inspection lot.
    - Choose Enter to display the selection screen for the purchase order items. 
    - Select the purchase order item for which you want to create the goods receipt and set the Stock type indicator to the stock to which the goods were originally posted with the usage decision (for example, F for unrestricted-use stock or S for blocked stock). 
    - Save the goods receipt and exit the Materials Management component. 
    Choose Logistics -> Quality management -> Quality inspection -> Inspection lot -> Usage decision -> Change with history.
    - The initial screen for changing a usage decision appears.
    - Enter the number of the inspection lot for which you previously made the usage decision and choose Usage decision (UD). 
    To cancel the inspection lot, choose Usage decision -> Functions -> Cancel lot in the usage decision screen.
    Refer sap note 175842 ',Inspection lot: Reversal of goods movements from UD.
    Regards,
    Syed Hussain.

  • Moving a ResultSet into a JTable, cheaply and efficiently.

    Hi,
    This may be something interesting for the more advanced Java programmers.
    I've recently run into an issue, with moving a ResultSet into a JTable. Now, this may seem simple, and believe me it is, but, all the ways I have seen it done, and tried, just don't suite my need.
    DBSql dbsql = new DBSql(); // My database handler class
    tableResults.setModel(new javax.swing.table.DefaultTableModel(dbsql.execute(script), dbsql.getColumns()));
    * Queries the DataBase and populates
    * the values into a two-dimensional object array
    * @param SqlQry
    * @return Object[][]
    public Object[][] execute(String SqlQry) throws SQLException {
    Object[][] obj = null;
    select = connection.createStatement(ResultSet.TYPE_SCROLL_SENSITIVE,
    ResultSet.CONCUR_READ_ONLY);
    ResultSet rs = select.executeQuery(SqlQry);
    rsmd = rs.getMetaData();
    try {
    if (rs.next()) {
    boolean found = true;
    rs.last();
    recordCount = rs.getRow();
    rs.first();
    obj = new Object[recordCount][rsmd.getColumnCount()];
    int i = 0;
    while (found) {
    for (int j = 0; j < rsmd.getColumnCount(); j++) {
    obj[i][j] = rsmd.getColumnType(j + 1) != Constants.TYPE_INTEGER ? rs.getString(j + 1) : rs.getInt(j + 1);
    i++;
    found = rs.next();
    } else {
    recordCount = 0;
    return null;
    } catch(OutOfMemoryError oome) {
    System.gc();
    throw new SQLException("Out Of Memory");
    if(rs != null) rs.close();
    return obj;
    The application I have created is used to connect to any database I want. I have tested it with JavaDB, Microsoft Access, and DB2. The problem is, most DB2's have tables with many records and columns, while most new Relational Databases, have small tables with few records. This code works fantastic with a couple thousand records, with very few columns. But, doesn't cut it when it comes to 50000 records or more. For, instance I queried a DB2 table that has 34000 records and 117 columns ("select * from table"), it doesn't take too long, but it uses way too much memory. If I run that query the application resources 298mb, then when I run it again, it uses a little more and throws an OutOfMemoryError.
    The second issue I have is, I queried another table that has 147000 records and selected 4 columns. No OutOfMemoryError this time - 70mb resourcing - but, the application did take at least 20 minutes to collect those records.
    I have tried using the Vector<Vector<String>> type into the JTable, but, frankly that's just asking for an OutOfMemoryError.
    I have tried creating my own custom table model, with a created data object.
    I have tried inserting rows into a table model in the method itself and returning the table model.
    Eg.
    while (found) {
    Object[] obj = new Object[rsmd.getColumnCount()];
    for (int j = 0; j < rsmd.getColumnCount(); j++) {
    obj[j] = rsmd.getColumnType(j + 1) != Constants.TYPE_INTEGER ? rs.getString(j + 1) : rs.getInt(j + 1);
    tablemodel.insertRow(obj);
    found = rs.next();
    ^I think you can use a vector for this too.
    So far, nothing has solved my problem.
    One thing I have not tried however, is a different table component for this kind of thing.
    I'm basically looking for, a method of doing this, with less overhead and quicker table population.
    Any Ideas?
    Regards,
    That_Gui

    Thanks for the reply.
    "1) Swing related questions should be posted in the Swing forum."
    Apologies, I was caught between swing and essentials, as it seemed to me as, more of a "better ways to do things" kind of question.
    "Also, the approach you are using requires two copies of the data, one in the ResultSet and one in the TableModel."
    I understand that transferring a ResultSet into an Object Array may probably be resource intensive, my delphi colleague made mention of that to me, not too long ago. That is why I'm trying to transfer the ResultSet directly into the table. That is why I used the ListTableModel, which also uses a lot of memory, I have looked at that - I had forgotten to mention that.
    "I have seen approaches where you try to only read a specific number of records. Then as you scroll additional records are read as needed. I can't point you to any specific solution though."
    Using an approach of reading the data as you scroll, sounds great, but also sounds like unnecessary work for the program to do, just like this Object/Vector story. In RPG, if you are working with subfiles (like a JTable), you will display 10 records at a time, and if the user hits the Page Down button you will display the next 10, that is how I'm understanding it.
    "I rarely use DefaultTableModel, creating your own model from AbstractTableModel is a lot more flexible when it comes to how you organise your storage, and it's pretty simple once you get the hang of it."
    This is the dream, I just need to design one that works as I need it.
    "You'd do a select count(*) on your query first to get the total rows expected. Of course one of the problems is that the databased table may change after you've retrieved the length or the items."
    Unfortunately, this is not an option for me, it wont work for what I need.
    I'm going to give the ResultSetTableModel a go - which I think it is actually similar to the ListTableModel - and I will get back to you.

  • Cancelling material document after usage decision

    hi experts,
    how to cancell a material document after usage decision has been made (quality to unresricted stock).
    thanks in advance
    regards
    jai

    Hi,
    whenever you do cancellation for material doument then its always done for the same stock type for which you have made GR....
    If you wanna do from it then Choose cancellation and material doc and enter the mrtl doc no.
    and execute ...
    Hope it helps..
    Regards,
    Priyanka.P
    AWARD IF HELPFULL

  • I'm trying to connect to my home wifi with my imac gh5. After I enter the password it says connection timeout or password incorrect. I know there's no issue with the connection but I don't know what else to do. Does anyone know how to fix this problem?

    I'm trying to connect to my home wifi with my imac gh5. After I enter the password it says connection timeout or password incorrect. I know there's no issue with the connection but I don't know what else to do. Does anyone know how to fix this problem?

    What is the make & model of your home Wi-Fi router that you are attempting to connect your G5 iMac to? Which exact model of iMac do you have?
    What wireless security type is your router using: WEP, WPA, or WPA2? If you temporarily disable wireless security, can the iMac connect to it now?

  • Order types entered in a Ztable, system will not perform material listing.

    Hi Guys,
    I have a requirement where user will enter the list of order types to be excluded from material listing  through a custom table.
    For all those order types entered in the custom table the  system will not perform any material listing check, regardless if the material is existing in the material listing.
    Can you please tell me how to do this through coding???Any particular exit or where can i code this.???
    Many Thanks in Advance,
    Rajendra
    Moderator message : Requirements dumping not allowed, show the work you have already done.  Thread locked.
    Edited by: Vinod Kumar on Jan 13, 2012 4:08 PM

    Swagat,
          Thank you for your response, what I am still not getting is - even in manual transfers via LT10 shouldn't the system restrict the movements to certain storage types? If you think from the shopfloor perspective the WM material movements are done at WM level only - meaning moving materials from one storage type to another and LT10 is widely used as it is one step tcode.
    I know we can restrict movements when storage class is assigned in search strategy, but this applies only to hazardous materials. The material in question is not hazardous so I am still thinking if there is any way to restrict material movements.
    Do you have any documentation link which mentions search strategies are not taken into consideration during manual transfer? If yes please send that would be helpful.
    Once again thanks for your time.

  • When i am typing in safari browser in Macbook dot's (..) are missing after pressing enter

    Hello
    My boss is having a Macbook. When he is typing a web address in safari ( for example www.hotmail.com) he is able to type full url with dot but after pressing enter it's coming like wwwhotmailcom
    And it's throwing error. Any help would appreciate.
    Regards
    Akther

    If you think getting your web pages to appear OK in all the major browsers is tricky then dealing with email clients is way worse. There are so many of them.
    If you want to bulk email yourself, there are apps for it and their templates will work in most cases...
    http://www.iwebformusicians.com/Website-Email-Marketing/EBlast.html
    This one will create the form, database and send out the emails...
    http://www.iwebformusicians.com/Website-Email-Marketing/MailShoot.html
    The alternative is to use a marketing service if your business can justify the cost. Their templates are tested in all the common email clients...
    http://www.iwebformusicians.com/Website-Email-Marketing/Email-Marketing-Service. html
    "I may receive some form of compensation, financial or otherwise, from my recommendation or link."

  • Report gets cancelled or terminated after eight hours

    While doing load testing of reports, all of my reports got cancelled or terminated after eight hours. I bang the report server and database with 30 long running reports using RWCGI60. The rwcgi60/showmyjobs shows that all are running for 8 hours and after that boom... all gets cancelled one by one with in a five minute period. I still see the SQL session activity on database. The report server log says the server engines are crashed one after the other. I have Maxengine set to 15. When I submit 30 reports I see 15 running and 15 enqueued.
    Is there any timeout parameter set on RWCGI60 where by it lost contact of database? RWCLI60 works fine and finished all reports.
    Thanks and Please let me know if you further information...

    Hi
    The timeout is a seeting in http server on which you host Reports CGI. Once that time limit is reached and no output is written, the web server would time out for that request. Reports CGI does not have any timeout parameter property.
    Thanks
    Rohit

  • My imac will not load after I enter my password. The only thing I get is the arrow from my mouse on top of a blank white screen.  Can anyone tell me what this is?  I've restarted and turned off several times.  I left it on in this state for 8 hours and

    My imac will not load after I enter my password. The only thing I get is the arrow from my mouse on top of a blank white screen.  Can anyone tell me what this is?  I've restarted and turned off several times.  I left it on in this state for 8 hours hoping it would reload and work.  No luck.

    Hello KCC4ME,
    You may try booting your Mac in Safe Boot, as it can resolve many issues that may prevent a successful login.
    OS X: What is Safe Boot, Safe Mode?
    http://support.apple.com/kb/HT1564
    If a Safe Boot allows you to successfully log in, you may have issues with one or more login itmes (while the following article is labelled as a Mavericks article, it is viable for earlier versions of the Mac OS, as well).
    OS X Mavericks: If you think you have incompatible login items
    http://support.apple.com/kb/PH14201
    Cheers,
    Allen

  • Can you buy Creative Cloud for a single month? Or do you have to buy the membership which lasts a year? If so can you cancel the membership after a month and only pay for that month.

    Can you buy Creative Cloud for a single month? Or do you have to buy the membership which lasts a year? If so can you cancel the membership after 1 month and only pay for that month?
    Thanks

    Hello Tom,
    You may sign up for a free trial of creative cloud which you can check out here. Download a free trial or buy Adobe products | Adobe downloads
    You may either pay for a month to month membership or annual as listed here. Creative Cloud pricing and membership plans | Adobe Creative Cloud
    Let us know if this helps!
    Thank you,
    Jo-Marie

  • How to clear the data in my page after user enter submit button

    hi......
    how to clear the data's in my page after user enter submit button. Actually while pressing first time itself the data is uploaded in database.

    Hi Nazeer,
    Instead of doing it on the same button better create a separate button for this functionality, As per my understanding you want to clear these fields to create new record so that you can enter a new record so for this you just need to insert a new row in VO.
    Still if you want to do it on the same button then you need to put the check that particular record is not dirty if it is not then create new record else create new record.
    One more thing if you will clear on the second click of a button how will you update your record??
    Regards,
    Reetesh Sharma

  • In adobe reader app on iPad, I have a PDF document that added notes and comments to.  Once I left the document and returned to it, the notes and comments were gone.  Where are they?  I clicked "save" and "done" buttons after I entered text.

    In adobe reader app on iPad, I have a PDF document that added notes and comments to.  Once I left the document and returned to it, the notes and comments were gone.  Where are they?  I clicked "save" and "done" buttons after I entered text.

    The application auto-saves your input when you close the document.  If you left the document, as you state, the notes/comments should have been saved and should have been visible the next time you opened the document with the Mobile Reader (note that if you are opening the document with another app such as Apple's built in PDF Viewer, things like notes/comments may not be visible).  Also note that if you are doing an Open In... from another app (like Dropbox), the version of the document in Dropbox does not update; only the version of the document in the Mobile Reader is updated.
    Would it be possible to send a video of the problem you are encountering to [email protected] so that we can try to help?

  • I just got the 5s, every time in try to update my apps it's asking for a second password to an Apple ID that is not mine-- it asks for mine and then another one pops up after I enter mine .what do I do?

    I just got the 5s, every time in try to update my apps it's asking for a second password to an Apple ID that is not mine-- it asks for mine and then another one pops up after I enter mine .what do I do?

    where did you get this phone from

Maybe you are looking for

  • HT1338 Safari keeps closing. help!

    Safari crashes every few minutes. This is my first mac, help!

  • Problem in creating output device for RICOH Aficio MP 2000 PCL 5e printer

    HI, i have problem in creating a output device for the RICOH Aficio MP 2000 PCL 5e as i am unable make out which device type should be assigned and what should be given in spool server tab. i have pinged the printer in lan and it is connecting. when

  • Can't open the "Access Privileges" in the Sharing preference pane.

    Hi to all: I am having this problem, I have a small network on my office, and I am using VNC to manage all my computers inside my firewall (router), but on my iBook G4 (10.4.11) I press the "Access Privileges" button on the sharing System Preference.

  • Join 2 projects together

    Hi - does anyone know if 2 projects can be joined. I have edited each half a life performance and created two projects one for each half. I would not like to append Act 2 to Act 1 can anyone let me know how this can be done please?

  • Win2000 System Log Error caused by NI-Serial

    I've installed a PCI-485/2 board into my computer along with NI-Serial 1.45. The board passes diagnostics and works properly, but every time I reboot my Win2000 computer I get a System Error log entry ID 18: "No Parameters subkey was found for user d