Essential problem with JTable Selections?

As far as I noticed a JTable actually consists of multiple Lists.
For example; If I want to navigate horizontal and vertical (diagnal) from one cell to another I have to use two ListSelectionListeners.
One ListSelectionListener to determine row-selection changes and the second ListSelectionListener to determine column-selection changes.
table.getSelectionModel().addListSelectionListener(listener);
table.getColumnModel().getSelectionModel().addListSelectionListener(listener);Due to this way the valueChanged(ListSelectionEvent e) method defined by the ListSelectionListener interface is called two times when navigating in two directions and called once when navigating in one dimension.
Can this problem easily be solved or is this an idea for improvement?
P.S. I don't need the solving of this issue to help me progress with my current dev. It's just something that cracks my mind at four o'clock in the night.

You're completly right. I did not formulate the question good enough (ahh well.. my first post). What I meant was the detection of selection events, by a mouse click for example.
The JTable.changeSelection(row, column, toggle, extend) is used to programmatically change the selection itself. In matter of fact, I believe the mouse and/or keyboard actions even use this method to peform their tasks when clicking on a cell.
In my case, the row and column index of the cell being clicked have to be passed when a user clicks it in the Jtable.
I've made a JFrame program that shows an image when a cell is clicked. When the cell that is being clicked is in the same row or in the the same column as the previous selected cell, the picture is loaded once. When the newly clicked cell is in a different row and in a different column, the picture is loaded twice.
I've made an executable. I would like to post it, but I don't know whether that is common in this community.
Code in DistanceFinder which extends JFrame:
MySelectionListener listener = new MySelectionListener(cityTable, imageLabel);
        cityTable.getSelectionModel().addListSelectionListener(listener);
        cityTable.getColumnModel().getSelectionModel()
            .addListSelectionListener(listener);
MySelectionListener:
package gui;
import gui.MyLabel;
import java.awt.Toolkit;
import javax.swing.ImageIcon;
import javax.swing.JLabel;
import javax.swing.JOptionPane;
import javax.swing.JTable;
import javax.swing.ListSelectionModel;
import javax.swing.event.ListSelectionEvent;
import javax.swing.event.ListSelectionListener;
* @author Iwan
public class MySelectionListener implements ListSelectionListener {
     private JTable jtable;
     private MyLabel imageLabel;
     public MySelectionListener(JTable jtable, MyLabel imageLabel) {
          // TODO Auto-generated constructor stub
          this.jtable = jtable;
          this.imageLabel = imageLabel;
     /* (non-Javadoc)
      * @see javax.swing.event.ListSelectionListener#valueChanged(javax.swing.event.ListSelectionEvent)
     @Override
     public void valueChanged(ListSelectionEvent e) {
          // If cell selection is enabled, both row and column change events are fired
        if ((e.getSource() == jtable.getSelectionModel() || e.getSource() == jtable.getColumnModel().getSelectionModel())
                  && !e.getValueIsAdjusting()
                  && jtable.getSelectedColumn() != jtable.getSelectedRow()
                  && jtable.getSelectedColumn() != 0
                  && jtable.getSelectedRow() != 0 ){
             imageLabel.setImage(getSelectedCell(jtable));
     private int[] getSelectedCell(JTable jtable){
          int[] selectedCell = {jtable.getSelectedColumn(), jtable.getSelectedRow()};
          return selectedCell;
     private void showInfoBox(JTable jtable, ListSelectionEvent e){
          JOptionPane.showMessageDialog(null, "Row changed to: " + jtable.getSelectedRow()
                    + "\n Column changed to: " + jtable.getSelectedColumn()
                    + "\nFirst: " + e.getFirstIndex()
                    + "\nLast: " + e.getLastIndex());
}So the question remains:
The valueChanged(ListSelectionEvent e) method defined by the ListSelectionListener interface is called two times when navigating in two directions and called once when navigating in one dimension.
Can this problem easily be solved or is this an idea for improvement?

Similar Messages

  • Selection Problem with JTable

    Hello,
    i have a selection problem with JTable. I want to allow only single cell selection and additionally limit the selection to the first column.
    I preffered the style from MS Outlook Express where you can select the email accounts to edit.
    It is a table like this:
    Account name  |   Type  |   ...
    --------------|---------|---------------------
    Hotmail       |   POP3  |
    GMX           |   IMAP  |The selection should be only avaibable at 'Hotmail' or 'GMX' - not at 'POP3', 'IMAP' or as complete row selection.
    Please help me!
    Thanks.
    Warlock

    Maybe this will helpimport java.awt.*;
    import javax.swing.*;
    public class Test3 extends JFrame {
      public Test3() {
        setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        Container content = getContentPane();
        String[] head = {"One", "Two"};
        String[][] data = {{"R1-C1", "R1-C2"}, {"R2-C1", "R2-C2"}};
        JTable jt = new JTable(data, head);
        jt.getColumnModel().setSelectionModel(new MyTableSelectionModel());
        content.add(new JScrollPane(jt), BorderLayout.CENTER);
        jt.setCellSelectionEnabled(true);
        jt.setRowSelectionAllowed(false);
        jt.setColumnSelectionAllowed(false);
        setSize(300, 300);
        setVisible(true);
      public static void main(String[] arghs) { new Test3(); }
    class MyTableSelectionModel extends DefaultListSelectionModel {
      public void setSelectionInterval(int index0, int index1) {
        super.setSelectionInterval(0, 0);
    }

  • A problem with JTable

    Hi !
    I have a problem with JTable - would like to use this component as a simple list of rows taken from a database : don't want to be able select or set a focus to a column - want only to be able select and set focus to a row ( just like in the menus). How to disable "focusability" for a cell with JTable ? Could You help me ?
    thnx in advance

    The Border is changed by the renderer, depending on whether the cell has focus or not. So you will need to create custom renderers without a Border. Something like:
    class NoBorderRenderer extends DefaultTableCellRenderer
         public Component getTableCellRendererComponent(
              JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column)
              super.getTableCellRendererComponent(table, value, isSelected, hasFocus, row, column);
              setBorder(null);
              return this;
    }

  • Another problem with JTable

    Hi,
    I have encountered a problem with JTable, i am trying to display some 15 columns and their values , one of the columns value is null, then the JTable is not displaying its value from this column(which is with null value) onwards.
    Can anybody assiss me in this matter.
    Regards
    khiz_eng

    I don't know If I can fix your problem, but
    I know just that it works on my PC.... It's very very
    slow... I don't know how to insert PageSetUp option... I have to study the problem.....
    However I don't think it's a hard problem....
    I want ask to you if you have found some problems when you are in Editing mode in a cell.....
    in the jdk1.2 version I could save while was in editing mode using the editingStopped method.
    It permit to update all data .... also the data in the cell I was editing.
    in the jdk 1.3 if I use this method It doesn't work properly... It maybe destroy the content object in the Cell..... because I'm able to print all the table except the editing cell (it throw an exception...)
    What's changed????
    I don't know...
    Can u help me?

  • Scrollbar problem with JTable.

    Hi,
    I have 45 columns in a JTable. Please remember this is customize, we can change the number of columns dynamically, at max they can be 2 columns.
    i was having a problem with display the columns names in my Frame. I posted at http://forum.java.sun.com/thread.jspa?threadID=5167358&messageID=9641265#9641265
    I got the solution. Thanks for that.
    But as i said these columns are customized.
    when i am having 2 columns in my JTable, table.setAutoResizeMode( JTable.AUTO_RESIZE_OFF ); is behaving differently, it's not occupying the complete JFrame. Lots of space is left out beside these 2 columns.
    When i comment this line, then those 2 columns are occupying my complete Frame.
    these two colmns should occupy my complete Frame and if i select 45 columns i should get scroll bar at botton with complete column NAMES.
    Hope i am clear.
    My Snippet
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    import javax.swing.event.*;
    import javax.swing.table.*;
    import java.util.*;
    public class SimpleTable extends JPanel {
        private boolean DEBUG = false;
        public SimpleTable() {
            super(new BorderLayout());
                        String[][] values = new String[10][];
            String[] columnNames = {
                                                                                    "First Name","Last Name","Sport","# of Years","Vegetarian","First Name","Last Name","Sport","# of Years","Vegetarian","First Name","Last Name","Sport","# of Years","Vegetarian","First Name","Last Name","Sport","# of Years","Vegetarian","First Name","Last Name","Sport","# of Years","Vegetarian","First Name","Last Name","Sport","# of Years","Vegetarian","First Name","Last Name","Sport","# of Years","Vegetarian","First Name","Last Name","Sport","# of Years","Vegetarian","First Name","Last Name","Sport","# of Years","Vegetarian"
            Object[][] data = {
                {"Mary", "Campione",
                 "Snowboarding", new Integer(5), new Boolean(false)},
                {"Alison", "Huml",
                 "Rowing", new Integer(3), new Boolean(true)},
                {"Kathy", "Walrath",
                 "Knitting", new Integer(2), new Boolean(false)},
                {"Sharon", "Zakhour",
                 "Speed reading", new Integer(20), new Boolean(true)},
                {"Philip", "Milne",
                 "Pool", new Integer(10), new Boolean(false)},
                {"Mary", "Campione",
                 "Snowboarding", new Integer(5), new Boolean(false)},
                {"Alison", "Huml",
                 "Rowing", new Integer(3), new Boolean(true)},
                {"Kathy", "Walrath",
                 "Knitting", new Integer(2), new Boolean(false)},
                {"Sharon", "Zakhour",
                 "Speed reading", new Integer(20), new Boolean(true)},
                {"Philip", "Milne",
                 "Pool", new Integer(10), new Boolean(false)},
                {"Mary", "Campione",
                 "Snowboarding", new Integer(5), new Boolean(false)},
                {"Alison", "Huml",
                 "Rowing", new Integer(3), new Boolean(true)},
                {"Kathy", "Walrath",
                 "Knitting", new Integer(2), new Boolean(false)},
                {"Sharon", "Zakhour",
                 "Speed reading", new Integer(20), new Boolean(true)},
                {"Philip", "Milne",
                 "Pool", new Integer(10), new Boolean(false)},
                {"Mary", "Campione",
                 "Snowboarding", new Integer(5), new Boolean(false)},
                {"Alison", "Huml",
                 "Rowing", new Integer(3), new Boolean(true)},
                {"Kathy", "Walrath",
                 "Knitting", new Integer(2), new Boolean(false)},
                {"Sharon", "Zakhour",
                 "Speed reading", new Integer(20), new Boolean(true)},
                {"Philip", "Milne",
                 "Pool", new Integer(10), new Boolean(false)},
                {"Mary", "Campione",
                 "Snowboarding", new Integer(5), new Boolean(false)},
                {"Alison", "Huml",
                 "Rowing", new Integer(3), new Boolean(true)},
                {"Kathy", "Walrath",
                 "Knitting", new Integer(2), new Boolean(false)},
                {"Sharon", "Zakhour",
                 "Speed reading", new Integer(20), new Boolean(true)},
                {"Philip", "Milne",
                 "Pool", new Integer(10), new Boolean(false)},
                {"Mary", "Campione",
                 "Snowboarding", new Integer(5), new Boolean(false)},
                {"Alison", "Huml",
                 "Rowing", new Integer(3), new Boolean(true)},
                {"Kathy", "Walrath",
                 "Knitting", new Integer(2), new Boolean(false)},
                {"Sharon", "Zakhour",
                 "Speed reading", new Integer(20), new Boolean(true)},
                {"Philip", "Milne",
                 "Pool", new Integer(10), new Boolean(false)},
                {"Mary", "Campione",
                 "Snowboarding", new Integer(5), new Boolean(false)},
                {"Alison", "Huml",
                 "Rowing", new Integer(3), new Boolean(true)},
                {"Kathy", "Walrath",
                 "Knitting", new Integer(2), new Boolean(false)},
                {"Sharon", "Zakhour",
                 "Speed reading", new Integer(20), new Boolean(true)},
                {"Philip", "Milne",
                 "Pool", new Integer(10), new Boolean(false)},
                {"Mary", "Campione",
                 "Snowboarding", new Integer(5), new Boolean(false)},
                {"Alison", "Huml",
                 "Rowing", new Integer(3), new Boolean(true)},
                {"Kathy", "Walrath",
                 "Knitting", new Integer(2), new Boolean(false)},
                {"Sharon", "Zakhour",
                 "Speed reading", new Integer(20), new Boolean(true)},
                {"Philip", "Milne",
                 "Pool", new Integer(10), new Boolean(false)},
                {"Mary", "Campione",
                 "Snowboarding", new Integer(5), new Boolean(false)},
                {"Alison", "Huml",
                 "Rowing", new Integer(3), new Boolean(true)},
                {"Kathy", "Walrath",
                 "Knitting", new Integer(2), new Boolean(false)},
                {"Sharon", "Zakhour",
                 "Speed reading", new Integer(20), new Boolean(true)},
                {"Philip", "Milne",
                 "Pool", new Integer(10), new Boolean(false)}
                        DefaultTableModel defaulttablemodel = new DefaultTableModel(data,columnNames);
            final JTable table = new JTable(defaulttablemodel)
                 public boolean isCellEditable(int row,int column)
                                  return false;
                        table.setPreferredScrollableViewportSize(new Dimension(500, 70));
                        //table.setAutoResizeMode( JTable.AUTO_RESIZE_OFF );
                        JScrollPane scrollPane = new JScrollPane(table);
                        add(scrollPane);
        private static void createAndShowGUI() {
            JFrame frame = new JFrame("SimpleTable");
            frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
            SimpleTable newContentPane = new SimpleTable();
            newContentPane.setOpaque(true); //content panes must be opaque
            frame.setContentPane(newContentPane);
            frame.pack();
            frame.setVisible(true);
        public static void main(String[] args) {
            javax.swing.SwingUtilities.invokeLater(new Runnable() {
                public void run() {
                    createAndShowGUI();
    }

    Thank You camickr, it's serving my purpose.
    Just for a clarrification :
    table.setAutoResizeMode( JTable.AUTO_RESIZE_OFF );
    table.setAutoscrolls(false);without using these lines also my purpose is serving.....then y do we need above two lines of code. r they necessary
    i mean, this snippet is sufficient.
    public boolean getScrollableTracksViewportWidth()
         return getPreferredSize().width < getParent().getWidth();
    }

  • Problems with JTable

    Hi All,
    I am facing some problems in JTable :
    1) How to remove all lines between cells, neither i should have column nor row lines....there should not be any lines between any cell at all.
    2) If i select a perticular cell, complete row is getting selected with a blue background, that should not happen at all.....row should not get select....
    3) How to make a cell non editable.
    Regards,
    Ravi

    1) Read the API. Check out the set??? methods until you fine what you want
    2) Read the API. Check out the methods that deal with row and column selection
    3) Override isCellEditable(...) method of JTable or DefaultTableModel

  • Problems with the selection of text or objects

    dear fireworks community!
    unfortunately i have problems with my running version fireworks (CS6) and i can't find any solution or even get help via the customer support.
    i can't switch between objects with a click, when i've choosen one already. i also can't cancel the entire selection. the only way (to select a new item) is to click on an empty space, hold it and pull the selection over a new item.
    another thing is that i cant select a textfield with a doubleclick or switch beteween choosen tools within the usage of a shortcut …
    what i already tried:
    updating, deinstalling, re-storing preferences, "cleaning" the libraries, installing (this entire scenario for at least three times)
    i hope someone of you can help me!
    thanks in advance!

    incredible!
    thank you so much!

  • Problem with JTable and JPanel

    Hi,
    I'm having problems with a JTable in a JPanel. The code is basicly as follows:
    public class mainFrame extends JFrame
            public mainFrame()
                    //A menu is implemeted giving rise to the following actions:
                    public void actionPerformed(ActionEvent evt)
                            String arg = evt.getActionCommand();
                            if(arg.equals("Sit1"))
                            //cells, columnNames are initiated correctly
                            JTable table = new JTable(cells,columnNames);
                            JPanel holdingPanel = new JPanel();
                            holdingPanel.setLayout( new BorderLayout() );
                            JScrollPane scrollPane = new JScrollPane(holdingPanel);
                            holdingPanel.setBackground(Color.white);
                            holdingPanel.add(table,BorderLayout.CENTER);
                            add(scrollPane, "Center");
                            if(arg.equals("Sit2"))
                                    if(scrollPane !=null)
                                            remove(scrollPane);validate();System.out.println("ScrollPane");
                                    if(holdingPanel !=null)
                                            remove(holdingPanel);
                                    if(table !=null)
                                            remove(table);table.setVisible(false);System.out.println("table");
                            //Put other things on the holdingPanel....
            private JScrollPane scrollPane;
            private JPanel holdingPanel;
            private JTable table;
    }The problem is that the table isn't removed. When you choose another situation ( say Sit2), at first the table apparently is gone, but when you press with the mouse in the area it appeared earlier, it appears again. How do I succesfully remove the table from the panel? Removing the panel doesn't seem to be enough. Help is much appreciated...
    Best regards
    Schwartz

    If you reuse the panel and scroll pane throughout the application,
    instantiate them in the constructor, not in an often-called event
    handler. In the event handler, you only do add/remove of the table
    on to the panel. You can't remove the table from the container
    which does not directly contain it.
    if (arg.equals("Sit2")){
      holdingPanel.remove(table);
      holdingPanel.revalidate();
      holdingPanel.repaint(); //sometimes necessary
    }

  • Problem with column selection in GUI_DOWLOAD

    Hi everyone !
    I want to save data from an internal table to a DAT file using GUI_DOWLOAD. In this internal table, there are 2 colums that won't be downloaded so I call the FM this way :
        CALL FUNCTION 'GUI_DOWNLOAD'
             EXPORTING
                  FILENAME                = L_FILE
                  FILETYPE                = 'DAT'
                  COL_SELECT              = 'X'
                  COL_SELECT_MASK          = V_COLSELECT
             TABLES
                  DATA_TAB                = TAB_OUT
                  FIELDNAMES              = TAB_FIELDNAMES.
    V_COLSELECT contains an 'X' for each column I need to be downloaded and a space for the 2 other columns.
    In the result file, the columns that I didn't select don't appear BUT there are 2 columns with no header and filled with zeros at the right edge of the file. I don't know where these 2 columns come from. Maybe a problem with fieldnames but I'm not sure (in TAB_OUT, all columns are present but in TAB_FIELDNAMES there are only headers for the selected columns).
    If anybody have an idea, please just tell me.
    Points will be rewarded for helpful answers.
    Thanks.
    Nicolas.

    Hi,
    Try to keep fields same in TAB_FIELDNAMES and TAB_OUT. because anyway you are using COL_SELECT_MASK.
    I think you are using COL_SELECT_MASK properly ie
    if you have 6 field in the TAB_OUT out of that you need to donwload 1,3,6 then your
    COL_SELECT_MASK will be X X  X
    aRs

  • Problem with variable selections

    Hi All
        I am executing the report with period 46.2007-50.2007 . I am getting the result for this period.But if i run the report with same selections from 42.2007-50.2007, I am not getting the data.It says no applicable data found.
    I am using interval as the option for variable .Could some one help on this?
    Thanks
    Raghu N

    Hello
    According to your selection you should get the data.
    check the both selection (46 - 50) and (42 - 50) in the LISTCUBE transaction.
    if data available in both cases then problem may be with other restrictions.
    If no user exits are in that variable try create one more variable as it is and then try by restricting with new variable.

  • Problems with customizing select lists and popup LOVs

    Hi
    I have 2 problems about select lists and popup LOVs.
    The first one is about a select list in a tabular form.
    It should be created with APEX_ITEM.SELECT_LIST_FROM_LOV or similar and take its values from a named LOV.
    This worked fine but now it should also have the possibility to enter a free value.
    I tried to accomplish that by creating a APEX_ITEM.POPUP_FROM_LOV, but there is a problem with the function that is called by the arrow icon right to the input field (for eg. genList_f11_5()).
    If the row is added by addRow, then it works fine, but if the row is is not empty
    then the function call is like genList_f11_$_row() and the input field gets no value, when a LOV option is selected.
    The other problem is about a select list which should have the possibility to enter a custom value and
    also there should be the possibility to select several values. I tried to implement this by a text area containing the selected values and a multiple select list, with an event handler in each option. The user could click options and they would be copied to the text area. The problem is that I couldn't make the event handler work in IE.
    I would appreciate any ideas about either of these problems.
    Tiina

    Hi,
    If you download application you can see source.
    I have not write any instructions, sorry.
    If you are on Apex 4 you can just load jQuery UI autocomplete library and take ideas from my app.
    If you download my sample in zip there is uncompressed htmldbQuery library.
    You can see that and take only function htmldbAutocomplete.
    Then check jQuery UI document
    http://jqueryui.com/demos/autocomplete/#method-search
    There is method search that you can use open list just by click of input.
    I hope this helps at start.
    Regards,
    Jari

  • Function module based generic extractor - Problem with the selection

    Hi all
    The following is my code in the function module. I am able to get the entire data if i dont give any selections and the number of records is also correct. But when i select a MATNR value, it returns 0 records where as it needs to return 3 records. If i give selection based on bukrs, werks, lgort its working fine. But if i give selection based on MATNR, then it is not working.... I think there is a problem in the bold part of my code. If i debug, LS_MATNR is having the correct value which indicates that there is no problem with the value being passed to LS_MATNR from my selection screen of my datasource in RSA3. Even GT_WERKS is also having data. Please help.
    OPEN CURSOR WITH HOLD S_CURSOR FOR
    SELECT  MARA~MANDT
            MARA~MATNR
            MARC~WERKS
            MARD~LGORT
            MARA~MEINS
            MARD~LABST
            MARD~EINME
            MARD~SPEME
            MARD~RETME
            MARD~INSME
            MARD~UMLME
            MARD~VMLAB
            MARD~VMEIN
            MARD~VMSPE
            MARD~VMRET
            MARD~VMINS
            MARD~VMUML
            MARC~XCHPF
            MARD~KLABS
            MARD~KEINM
            MARD~KSPEM
            MARD~KINSM
    from MARA inner join MARC on
    MARAMANDT = MARCMANDT AND
    MARAMATNR = MARCMATNR
    inner join MARD on
    MARAMANDT = MARDMANDT AND
    MARAMATNR = MARDMATNR
    AND MARCWERKS = MARDWERKS
    for all entries in gt_werks
    where MARC~werks EQ gt_werks-werks
    AND MARA~MATNR in LS_MATNR.
        ENDIF.                             "First data package ?
    Fetch records into interface table.
      named E_T_'Name of extract structure'.
        FETCH NEXT CURSOR S_CURSOR
                   APPENDING CORRESPONDING FIELDS
                   OF TABLE E_T_DATA
                   PACKAGE SIZE S_S_IF-MAXSIZE.

    try this
    select marc~matnr MARC~WERKS into t_marc for all entries in gt_werks
    where werks EQ gt_werks-werks and lvorm = space.
    if t_marc is not initial.
    select MARD~LGORT MARD~WERKS MARA~MEINS MARD~LABST MARD~EINME
    MARD~SPEME MARD~RETME MARD~INSME MARD~UMLME
    MARD~VMLAB MARD~VMEIN MARD~VMSPE MARD~VMRET
    MARD~VMINS MARD~VMUML MARC~XCHPF MARD~KLABS
    MARD~KEINM MARD~KSPEM MARD~KINSM  MARA~MEINS  from
    mard inner join MARA on mard~matnr = mara~matnr
    for all entries in t_marc where  mard~matnr = t_marc-matnr and mard-werks = t_marc-matnr
    and mard~lvorm = space.

  • Report Painter problem with empty selection variant

    Hello,
    I use the cost center selection variant for the column definition in Report Painter as characteristic value. This selection variant get only the cost centers which are valid from 1.1.2003 to 31.12.2004. The column of the report created by Report Painter which uses this selection variant display value without taking into account limitations follow from this selection variant. I expect value zero for year fiscal year 2007 in this column, because the cost centers are invalid in 2007 year but the report displays different value. The problem appeared after upgrade from 4.6C to ECC 6.0.
    Best Regards
    ZD

    My problem with Report Painter occurred when I was creating my own report based on 1VK library.
    In my example I used in the column definition characteristic Cost
    Center, which is determined by selection variant, and Basic Key Figure
    equal SWKG-Costs. For system date (18.07.2007) there are no valid
    master data for the characteristic Cost Center but when I execute
    report for fiscal year 2007 the column display no-zero value without
    taking into account value of Characteristic Cost Center. I expected
    zero value in this column because there are no postings for Cost
    Centers (no valid cost centers were selected) in financial year 2007.
    Could you help me with this problem ?

  • Problem with the selection screen in submit program

    Hi Friends,
    i am facing the problem wih the selection screen in submit program. in my Module pool program i am using the submit program statement, When i execute the program , The module program display the submit program selections creen.
    I have implemented the code same as below.
    submit ztest with tknum =p_tknum and  return.
    Can you pleaes help me how to avoid the submit program selection screen.
    Thanks,
    Charan

    Hi Charan,
    You have to give the selection screen values when you submit a job.
    Press F1 on submit and you will see more details.
    Here is an example from ABAP Documentation.
    Program accessed
    REPORT report1.
    DATA text(10) TYPE c.
    SELECTION-SCREEN BEGIN OF SCREEN 1100.
      SELECT-OPTIONS: selcrit1 FOR text,
                      selcrit2 FOR text.
    SELECTION-SCREEN END OF SCREEN 1100.
    Calling program
    REPORT report2.
         DATA: text(10)   TYPE c,
          rspar_tab  TYPE TABLE OF rsparams,
          rspar_line LIKE LINE OF rspar_tab,
          range_tab  LIKE RANGE OF text,
          range_line LIKE LINE OF range_tab.
    rspar_line-selname = 'SELCRIT1'.
    rspar_line-kind    = 'S'.
    rspar_line-sign    = 'I'.
    rspar_line-option  = 'EQ'.
    rspar_line-low     = 'ABAP'.
    APPEND rspar_line TO rspar_tab.
    range_line-sign   = 'E'.
    range_line-option = 'EQ'.
    range_line-low    = 'H'.
    APPEND range_line TO range_tab.
    range_line-sign   = 'E'.
    range_line-option = 'EQ'.
    range_line-low    = 'K'.
    APPEND range_line TO range_tab.
    SUBMIT report1 USING SELECTION-SCREEN '1100'
                   WITH SELECTION-TABLE rspar_tab
                   WITH selcrit2 BETWEEN 'H' AND 'K'
                   WITH selcrit2 IN range_tab
                   AND RETURN.
    Regards,
    Jovito.

  • Problems with JTable Renderer

    I have a problem with applying a custom renderer. I know the renderer works so thats not the problem. If I do like this:
    DefaultTableModel aDefaultTableModel = new DefaultTableModel(data, columnNames);
    it works. But if I do like this:
    DefaultTableModel aDefaultTableModel;
    aDefaultTableModel.setDataVector(data, columNames);
    is doesn't, why?

    I think maybe it's not the renderer at all. It may be my custom TableModel thats causing problems. Now this doesn't work:
    private JTable aTable;
    private CustomTableModel aTableModel;
    public MyProgram() {
    aTableModel = new CustomTableModel();
    aTable = new JTable(aTableModel);
    aTableModel.setData(data, columnNames);
    private class CustomTableModel {
    private String[] columnNames = null;
    private Object[][] data = null;
    public CustomTableModel() {
    columnNames = new String[0];
    data = new Object[0][0];
    ... snip
    public void setData(Object[][] data, String[] columnNames) {
    this.data = data;
    this.columnNames = columnNames;
    fireTableDataChanged();
    ... snip
    Now, why doesn't that setData method work??

Maybe you are looking for

  • Please tell basic difference between "" and null  for String  variable.

    1.What is difference between String strRemitInfo = "" and String strRemitInfo = null? 2. Which one is good practice while coding ?

  • JRE 1.4.2 opens multiple prots

    I have installed JRE 1.4.2_04 on Windows 2000 Server, and it arbitrarily binds onto lower ports 25, 110, 119, and 443. Does anyone why this is so, and how to make the JRE release those ports? Cheers

  • Master data related fields for DP, SNP and PPDS needed in Material Master

    Hi Gurus,               Can any one please suggest or guide me what are the fields need to be done in Material master in ECC for SAP APO DP, SNP (heuristic with capacity leveling)& PPDS(Heuritic with optimizer). Please it will be really great help. T

  • Entourage doesn't seem to encode attachments

    I am trying to share a html calender made with entourage with my pc using friends. They're unable to open the file. I thought I managed with entourage's helpfile but unfortunately that wasn't the case. I encoded the html file like this: 1 I attached

  • Photoshop Photography Program Download

    I ordered the Photoshop program, value special of 10$ a month. Whenever I'm at the download page that gives me the option to download, it starts downloading and then proceeds to tell me there is an error and stops downloading completely.  What do I d