JTable - Selecting selected columns

Is there a way to select a "selected" number of columns (i.e. not all columns of a row) in JTables?
The default selection criteria is by rows, I want to be able to select by both rows and columns, something like the excel spreadsheets.
Thanks.

Look at some of these
http://www2.gol.com/users/tame/swing/examples/SwingExamples.html
There is one which adds a 'row header'. From there you should be able to select a row with it.

Similar Messages

  • How to programmatically select a column in a JTable

    Hi,
    I'm writing a program which requires me to select a column in the JTable through code. The problem is that I could only find getSelectedColumn() function in JTable and no setSelectedColumn().
    Please let me know if there is any workaround for this.
    Regards,
    Derreck

    Hi,
    table.setColumnselectionInterval(index0,index1);
    The above line will suffice your requirement.
    Cheers,
    Gokul.

  • Select single column but multiple rows in JTable

    Hi
    I have a jTable and want to be able to select multiple rows but only in a single column.
    I've set these properties which makes selection almost the way I would like it.
    table1.setCellSelectionEnabled(true);
    table1.setSelectionMode(ListSelectionModel.SINGLE_INTERVAL_SELECTION);the only problem now is that the user can select multiple columns.
    Is there a simple way to restrict selection to single column?
    regards
    abq

    table.setCellSelectionEnabled(true);
    table.setSelectionMode(ListSelectionModel.SINGLE_INTERVAL_SELECTION);
    DefaultListSelectionModel model =
         (DefaultListSelectionModel)table.getColumnModel().getSelectionModel();
    model.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);

  • Selecting multiple columns in a jtable

    whats up java programmers,
    i have a problem. i have a jtable with 8 columns. i set a mouse listener to the headers so when i click on one that column underneath the header is highlighted. my problem when i click on one header and then click on another both columns do not stay highlighted. can anyone help please
    matt
    [email protected]

    only way I know is to use
    setColumnSelectionInterval
    and
    addColumnSelectionInterval
    to specifiy which columns.

  • How to set special rows in jtable not selectable

    Hello programmers,
    anybody knows how to set special rows(p.E. row 0) in jtable not selectable.
    in advance thanks for your answers

    table = new JTable(...)
         public void changeSelection(int row, int column, boolean toggle, boolean extend)
              if (row == 0)
                   return;
              else
                   super.changeSelection(row, column, toggle, extend);
    };

  • JTable - row selection not working + change the text format

    Hi All,
    I have written a code to display Jtable with 2 columns, 1 column to display image+text and other is multiline.
    I have used 2 different cell renderer for achiveing the same.
    Please advice on the following:
    @ When I click on row, only one column gets selected. How to fix this?
    @ Data to be displayed in rows is fetched from database. And on some STATUS value row should be in bold text or plain text. I have achieved this but withou logic to iterate over it.
    @ When user right clicks on the row allow them to set text in the row as bold or plain.(Just like we do with mails in outlook box)
    Below is the code:
    Hi All,
    I have written a code to display Jtable with 2 columns, 1 column to display image+text and other is multiline.
    I have used 2 different cell renderer for achiveing the same.
    Please advice on the following:
    @ When I click on row, only one column gets selected. How to fix this?
    @ Data to be displayed in rows is fetched from database. And on some STATUS value row should be in bold text or plain text. I have achieved this but withou logic to iterate over it.
    @ When user right clicks on the row allow them to set text in the row as bold or plain.(Just like we do with mails in outlook box)
    Below is the code:package jtab;
    import java.awt.Component;
    import java.awt.Dimension;
    import java.awt.event.ActionEvent;
    import java.awt.event.ActionListener;
    import java.awt.event.MouseEvent;
    import java.awt.event.MouseListener;
    import java.awt.image.BufferedImage;
    import java.io.File;
    import java.util.Vector;
    import javax.swing.ImageIcon;
    import javax.swing.JEditorPane;
    import javax.swing.JFrame;
    import javax.swing.JMenuItem;
    import javax.swing.JOptionPane;
    import javax.swing.JPopupMenu;
    import javax.swing.JScrollPane;
    import javax.swing.JTable;
    import javax.swing.table.DefaultTableCellRenderer;
    import javax.swing.table.DefaultTableModel;
    import javax.swing.table.TableCellRenderer;
    import jtab.TestIcon.iconRenderer;
    public class SampleJtable {
         JFrame frame;
         JTable table;
         JScrollPane panel;
         JPopupMenu popupMenu ;
         public static void main(String[] args) {
              SampleJtable sample = new SampleJtable();
              sample.loadGUI();
         public void loadGUI(){
              frame = new JFrame("Sample Program for Font and ImageIcons");
              frame.setContentPane(panel);
              frame.setSize(550,250);
              frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
              frame.setVisible(true);
         public SampleJtable(){
              BufferedImage images[] = new BufferedImage[1];
              try{
                   images[0] = javax.imageio.ImageIO.read(new File("C:/go.gif"));
              }catch(Exception e){
                   e.printStackTrace();
              final Object data [][] = {{"Auftrag \n test \n 777,Abdherhalden Josef, \n 1957,Grenchen Kaufe \n P",new ImageStore(images[0],"Bourquin Rene")},
                        {"Auftrag \n test \n \n 1957,Grenchen Kaufe \n N",new ImageStore(images[0],"Bourquin Rene")}};
              String colIds [] ={"Beschrebung","Von"};
              DefaultTableModel model = new DefaultTableModel(data, colIds) {  
    public Class getColumnClass(int column) {  
    return data[0][column].getClass();
              /*Vector<Object> rowData1 = new Vector(2);
              rowData1.add("Auftrag \n test \n 777,Abdherhalden Josef, \n 1957,Grenchen Kaufe");
              rowData1.add(new ImageStore(images[0],"Bourquin Rene"));
              Vector<Object> rowData2 = new Vector(2);
              rowData2.add("Auftrag \n test \n 777,Abdherhalden Josef, \n 1957,Grenchen Kaufe");
              rowData2.add(new ImageStore(images[0],"Bourquin Rene"));
              Vector<Vector> rowData = new Vector<Vector>();
         rowData.addElement(rowData1);
         rowData.addElement(rowData2);
              Vector<String> columnNames = new Vector<String>();
         columnNames.addElement("Beschrebung");
         columnNames.addElement("Von");     
              DefaultTableModel model = new DefaultTableModel(rowData, columnNames) {  
              table = new JTable(model);
              table.setDefaultRenderer(ImageStore.class, new ImageRenderer());          
              table.getTableHeader().getColumnModel().getColumn(0).setCellRenderer(new LineCellRenderer());
              table.setRowHeight(84);
              panel = new JScrollPane(table);
              panel.setOpaque(true);
         class ImageRenderer 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);
         ImageStore store = (ImageStore)value;
         setIcon(store.getIcon());
         setText(store.text);
         return this;
         class ImageStore {  
         ImageIcon icons;
         String text;
         int showingIndex;
         public ImageStore(BufferedImage image1,String s) {
         icons = new ImageIcon(image1);
         showingIndex = 0;
         text = s;
         public ImageIcon getIcon() {  
         return icons;
         public void toggleIndex() {  
         showingIndex = (showingIndex == 0) ? 1 : 0;
         class LineCellRenderer extends JEditorPane implements TableCellRenderer {
              public LineCellRenderer() {           
              setOpaque(true);
              setContentType("text/html");          
              public Component getTableCellRendererComponent(JTable table, Object value,
              boolean isSelected, boolean hasFocus, int row, int column) {
              //System.out.println("Whats in value = "+ value.toString());
              String [] strArray = value.toString().split("\n");
              String rtStr = null ;
              System.out.println("TYPE+ "+ strArray[strArray.length-1].toString());
              String val = strArray[strArray.length-1].toString().trim();
              if (val.equalsIgnoreCase("N")){
                   System.out.println("TYPE+ IS NEW");
                   rtStr = "<html><head></head><body><b><div style=\"color:#FF0000;font-weight:bold;\">" + strArray[0] + "</div>" +
                             " <div style=\"color:#0000FF;font-weight:bold;\">" + strArray[1] + "</div>" +
                             "<div style=\"color:#0000FF;font-weight:bold;\">" + strArray[2] + "</div>" +
                             "<div style=\"color:#0000FF;font-weight:bold;\">" + strArray[3] + "</div>" +
                             "</b></body></html>";
              else {
                   System.out.println("TYPE+ IS PENDING");
                   rtStr = "<html><head></head><body><div style=\"color:#FF0000;\">" + strArray[0] + "</div>" +
                   " <div style=\"color:#0000FF;\">" + strArray[1] + "</div>" +
                   "<div style=\"color:#0000FF;\">" + strArray[2] + "</div>" +
                   "<div style=\"color:#0000FF;\">" + strArray[3] + "</div>" +
                   "</body></html>";
              setText(rtStr);
              return this;

    Posting code again........
    package jtab;
    import java.awt.Component;
    import java.awt.Dimension;
    import java.awt.event.ActionEvent;
    import java.awt.event.ActionListener;
    import java.awt.event.MouseEvent;
    import java.awt.event.MouseListener;
    import java.awt.image.BufferedImage;
    import java.io.File;
    import java.util.Vector;
    import javax.swing.ImageIcon;
    import javax.swing.JEditorPane;
    import javax.swing.JFrame;
    import javax.swing.JMenuItem;
    import javax.swing.JOptionPane;
    import javax.swing.JPopupMenu;
    import javax.swing.JScrollPane;
    import javax.swing.JTable;
    import javax.swing.table.DefaultTableCellRenderer;
    import javax.swing.table.DefaultTableModel;
    import javax.swing.table.TableCellRenderer;
    import jtab.TestIcon.iconRenderer;
    public class SampleJtable {
    JFrame frame;
    JTable table;
    JScrollPane panel;
    JPopupMenu popupMenu ;
    public static void main(String[] args) {
    SampleJtable sample = new SampleJtable();
    sample.loadGUI();
    public void loadGUI(){
    frame = new JFrame("Sample Program for Font and ImageIcons");
    frame.setContentPane(panel);
    frame.setSize(550,250);
    frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    frame.setVisible(true);
    public SampleJtable(){
    BufferedImage images[] = new BufferedImage[1];
    try{
    images[0] = javax.imageio.ImageIO.read(new File("C:/go.gif"));
    }catch(Exception e){
    e.printStackTrace();
    final Object data [][] = {{"Auftrag \n test \n 777,Abdherhalden Josef, \n 1957,Grenchen Kaufe \n P",new ImageStore(images[0],"Bourquin Rene")},
    {"Auftrag \n test \n \n 1957,Grenchen Kaufe \n N",new ImageStore(images[0],"Bourquin Rene")}};
    String colIds [] ={"Beschrebung","Von"};
    DefaultTableModel model = new DefaultTableModel(data, colIds) {
    public Class getColumnClass(int column) {
    return data[0][column].getClass();
    /Vector<Object> rowData1 = new Vector(2);
    rowData1.add("Auftrag \n test \n 777,Abdherhalden Josef, \n 1957,Grenchen Kaufe");
    rowData1.add(new ImageStore(images[0],"Bourquin Rene"));
    Vector<Object> rowData2 = new Vector(2);
    rowData2.add("Auftrag \n test \n 777,Abdherhalden Josef, \n 1957,Grenchen Kaufe");
    rowData2.add(new ImageStore(images[0],"Bourquin Rene"));
    Vector<Vector> rowData = new Vector<Vector>();
    rowData.addElement(rowData1);
    rowData.addElement(rowData2);
    Vector<String> columnNames = new Vector<String>();
    columnNames.addElement("Beschrebung");
    columnNames.addElement("Von");
    DefaultTableModel model = new DefaultTableModel(rowData, columnNames) {
    table = new JTable(model);
    table.setDefaultRenderer(ImageStore.class, new ImageRenderer());
    table.getTableHeader().getColumnModel().getColumn(0).setCellRenderer(new LineCellRenderer());
    table.setRowHeight(84);
    panel = new JScrollPane(table);
    panel.setOpaque(true);
    class ImageRenderer 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);
    ImageStore store = (ImageStore)value;
    setIcon(store.getIcon());
    setText(store.text);
    return this;
    class ImageStore {
    ImageIcon icons;
    String text;
    int showingIndex;
    public ImageStore(BufferedImage image1,String s) {
    icons = new ImageIcon(image1);
    showingIndex = 0;
    text = s;
    public ImageIcon getIcon() {
    return icons;
    public void toggleIndex() {
    showingIndex = (showingIndex == 0) ? 1 : 0;
    class LineCellRenderer extends JEditorPane implements TableCellRenderer {
    public LineCellRenderer() {
    setOpaque(true);
    setContentType("text/html");
    public Component getTableCellRendererComponent(JTable table, Object value,
    boolean isSelected, boolean hasFocus, int row, int column) {
    //System.out.println("Whats in value = " value.toString());
    String [] strArray = value.toString().split("\n");
    String rtStr = null ;
    System.out.println("TYPE " strArray[strArray.length-1].toString());
    String val = strArray[strArray.length-1].toString().trim();
    if (val.equalsIgnoreCase("N")){
    System.out.println("TYPE IS NEW");
    rtStr = "<html><head></head><body><b><div style=\"color:#FF0000;font-weight:bold;\">" strArray[0] "</div>"
    " <div style=\"color:#0000FF;font-weight:bold;\">" strArray[1] "</div>"
    "<div style=\"color:#0000FF;font-weight:bold;\">" strArray[2] "</div>"
    "<div style=\"color:#0000FF;font-weight:bold;\">" strArray[3] "</div>"
    "</b></body></html>";
    else {
    System.out.println("TYPE+ IS PENDING");
    rtStr = "<html><head></head><body><div style=\"color:#FF0000;\">" strArray[0] "</div>"
    " <div style=\"color:#0000FF;\">" strArray[1] "</div>"
    "<div style=\"color:#0000FF;\">" strArray[2] "</div>"
    "<div style=\"color:#0000FF;\">" strArray[3] "</div>"
    "</body></html>";
    setText(rtStr);
    return this;
    }

  • Multi JTable line selection

    Hi,
    How can I get the values of selected rows / columns when more than 1 at a time?
    Wha I need is the following:
    cell. What I am looking for is the values of
    multiple cells as follows:
    Col1 Col2 Col3 Col4 Col5
    row1 A B C D E
    row2 F G H I J
    row3 K L M N O
    row4 P Q R S T
    row5 U V W X Y
    when I select (highlight) any number of rows - i
    want the values in
    the left most column of all these rows. In the above
    example I should get:
    var1 = A
    var2 = F
    var3 = K

    I must be doing something wrong as both not working for me...:
    On the change width - no effect at all:
            Table temp = new Table(cust.getData() , vtrColumn );
            TableColumnModel col = temp.getColumnModel();
            TableColumn tcol = col.getColumn(0) ;
            tcol.setPreferredWidth(10); // tried any other number as well...
            rtrvTable.setModel(temp.getModel());
            rtrvTable.repaint();and on the remove column - it removes it completly - not only hiding it, so I cannot get the value at the column (which I need as it is the PK of the tabe)
            JTable temp = new JTable(cust.getData() , vtrColumn );
            rtrvTable.setModel(temp.getModel());
            TableColumn col0a = rtrvTable.getColumnModel().getColumn(0);
            rtrvTable.removeColumn(0);
            System.out.println(temp.getWidth());
            rtrvTable.repaint();Is there a way only to hide it? if I can set the with to very nerrow - that can be good enough I think....

  • How can i extend the filter function to also include an option to select which column to filter on?

    Hi.
    I have built an spry test-page (testing it on my localhost  so i cannot give you direct access to it) here i have an XML file that i show in an dynamic/ repeat table with 5 columns.
    I hvae included an spry filter function to easy filter out records, but the code only allows me to filter on one of the columns.
    I would like to add an extra "select-menu" to define which column the filter should be active for, how can i do that
    Here is the filter code and also the html code for the select-menu and the box to type in what to filter.
    The bold parts is the important parts, i would like the options values from the select menu to be inserted in the filterData function to be able to define which column to do the filtering on.
    var ds1 = new Spry.Data.XMLDataSet("report3.xml", "orders/order", {sortOnLoad: "@id", sortOrderOnLoad: "descending"});
    ds1.setColumnType("date", "date");
    ds1.setColumnType("BUTIKNR", "number");
    ds1.setColumnType("EXTRAFRAKT", "number");
    ds1.setColumnType("job/@idx", "number");
    var jobs = new Spry.Data.NestedXMLDataSet(ds1, "job");
    function FilterData()
        var tf = document.getElementById("filterTF");
        var menu = document.getElementById("searchIdent");
        if (!tf.value)
            // If the text field is empty, remove any filter
            // that is set on the data set.
            ds1.filter(null);
            return;
        // Set a filter on the data set that matches any row
        // that begins with the string in the text field.
        var regExpStr = tf.value;
        if (!document.getElementById("containsCB").checked)
            regExpStr = "^" + regExpStr;
        var regExp = new RegExp(regExpStr, "i");
        var filterFunc = function(ds, row, rowNumber)
            var str = row["@id"];
            if (str && str.search(regExp) != -1)
                return row;
            return null;
        ds1.filter(filterFunc);
    function StartFilterTimer()
        if (StartFilterTimer.timerID)
            clearTimeout(StartFilterTimer.timerID);
        StartFilterTimer.timerID = setTimeout(function() { StartFilterTimer.timerID = null; FilterData(); }, 100);
    html:
                <select name="searchIdent" size="1" id="searchIdent">
                    <option value="@id" selected="selected">ID</option>
                    <option value="date">DATUM</option>
                    <option value="time">TID</option>
                    <option value="BUTIKNR">BUTIK</option>
                    <option value="REF">REFERENS</option>
                  </select>
              <input type="text" id="filterTF" onkeyup="StartFilterTimer();" />
    Contains:
      <input type="checkbox" id="containsCB" /></td>
    Thanks in advance.
    //Rickard H

    Now it works, i had to do it like this:
        var filterFunc = function(ds, row, rowNumber)
            var str = row["@id"];
            if (str && str.search(regExp) != -1)
                return row;
            var str1 = row["date"];
            if (str1 && str1.search(regExp) != -1)
                return row;
            var str2 = row["time"];
            if (str2 && str2.search(regExp) != -1)
                return row;
            var str3 = row["BUTIKNR"];
            if (str3 && str3.search(regExp) != -1)
                return row;
            var str4 = row["REF"];
            if (str4 && str4.search(regExp) != -1)
                return row;
            return null;
    I also had to remove the line "ds1.setColumnType("BUTIKNR", "number");" from the code, otherwise it would not search at all (only searches string types?).

  • How to select all columns in a trigger?

    I add a "before delete" trigger on a table, in order to insert the records to a backup table before they are deleted.
    but I cannot write like this : insert into t_backup select * from :old;
    The table has more than 30 columns so I don't want to select them one by one, how can I select all columns?

    Yes, it is possible by writing something like this :
    where col1 = :old.col1; But it is not directly supported. First, we need a package to remember all the OLD records:.... and please see below link for complete code in action :
    http://www.dbforums.com/oracle/925729-trigger-back-up-data.html
    What I am doing here, just copying the code and replacing "emp" with "test" (The table name on which I am going to apply this using notepad find and replace):
    SQL> select * from test_backup;
    no rows selected
    SQL> select * from test;
             A
             1
             2
             4
             5
    SQL> select * from test_backup;
    no rows selected
    SQL>
    create or replace package test_trg_pkg as
      type test_type is table of test%ROWTYPE index by binary_integer;
      test_tab test_type;
    end;
    create or replace trigger test_bds before delete on test
    begin
      test_trg_pkg.test_tab.delete;
    end;
    create or replace trigger test_adr after delete on test
    for each row
    declare
      -- To allow us to select the old values
      pragma autonomous_transaction;
    begin
      select *
      into   test_trg_pkg.test_tab(test_trg_pkg.test_tab.COUNT+1)
      from   test
      where  a = :old.a;  <----- Here you have to give your column name.
    end;
    create or replace trigger test_ads after delete on test
    begin
      for i in 1..test_trg_pkg.test_tab.COUNT loop
        insert into test_backup values test_trg_pkg.test_tab(i);
      end loop;
    end;
    SQL> delete from test where a=1;
    1 row deleted.
    SQL> select * from test_backup;
             A
             1
    SQL> delete from test where a=2;
    1 row deleted.
    SQL> select * from test_backup;
             A
             1
             2
    SQL>Regards
    Girish Sharma

  • How to get Select All or select Multiple columns  in OOALV

    HI Experts
    i'm assignig internal table to dynamic internal table(FS_IST_TABLE) for to display the output.
    but i'm not geting the Select ALL Option. and i can't select multiple columns at a time.
    where i can select only one column.
    how can i select multiple columns.
    please any one help me.
    regrads,
    rathan.

    Hi,
      If we want to select the multiple columns in the alv by using ooabap
    so in the class CL_GUI_ALV_GRID  it is having one method SET_TABLE_FOR_FIRST_DISPLAY
    it is having one importing parameter IS_LAYOUT of type lvc_s_layo type
    and this structure contains one field SEL_MODE and set that field value as 'A'.
    then we can select the multiple rows in alv grid

  • How do I select multiple columns in a recordset

    I am very new to Dreamweaver/PHP/MYSQL
    I have created my recordset but I cant work out how I select multiple columns.
    How do I select multiple columns, I want to search for data that is spread over different columns.
    My recordset looks like this just now.
    SELECT *
    FROM names
    WHERE nameone = john
    I have 11 columns where the name john my or may not appear so how would I select all the columns. What would the recordset look like.
    As I have said I,m very new to this  and forgive me if what i have just said makes no sense.
    Thanks

    >I have 11 columns where the name john my
    >or may not appear so how would I select all
    >the columns. What would the recordset look like.
    You could try a Full-Text search (if mysql supports it) but on the surface, this sounds like a badly designed data structure. What does your database and table design look like?

  • What is the difference betwwen SELECT ALL Column and Select Speceific Colum

    Hi All,
    If the block size of the database is 8K and average row length is 2K and if we select all column of the table the I/O show that it had read more blocks then compare to
    specific column of the same table. Why is this?
    Secondly if Oracle brings a complete block is the db buffer cache, while reading block from disk, they why there is a difference of block count in two queries.
    This difference reveals to me when I check the EXPLAIN PLAN for two different queries against the same table but one select all columns and the other one select specific column.
    Kindly help me in clearing this confusion.
    Regards,
    Kamran

    user1514587 wrote:
    >
    Usually, indexes are smaller (contain fewer blocks) than the table - ergo, select empno from emp could be satisfied by reading fewer blocks.
    what if there is a composite Index on a table containing 3 to 4 columns and the size of table is in 100 of GB and Index size itself is vey large then I think Oracle will go for FTS and small Index scan will be expensive. Kindly Share your thoughts.
    Regards,
    KamranHandle:     user1514587
    Status Level:     Newbie (5)
    Registered:     May 9, 2011
    Total Posts:     21
    Total Questions:     13 (12 unresolved)
    I think you wastes everyone's time here since you rarely get answer to any posted question

  • Preview's PDF text select ignores columns and misses word spaces

    I have a number of scanned pdf newspaper articles that I was attempting to copy the text from. Preview appears to register the existence of columns, as there is a pale blue background between the columns.
    However when I use the text select tool, it completely ignores the column - and just selects across all columns. And when I paste the text into my text editor, it's missing all the spaces between the words, and the font size is always huge.
    Conversely, Adobe reader in XP has no problem selecting by column, and the pasted text is also an exact replication of the original content. I don't know why Preview performs so badly in this regard? Anyone else experience any issues with pdf text select?

    Anyone else experience any issues with pdf text select?
    Yes, and not just recently.
    There is a reason Preview is named, well, preview. It is not an authoring environment and PDFs are not meant to serve in that context either...unless maybe you understand all of inherent the font traps, tricks & tips and how to tune your scanning/OCR software to keep rework to a minimum.
    Scanning PDFs is always tricky, and without the occasional heavy metal to bring to the task, it just seems to be that more problematic.
    Keep trying, but I'd really suggest to look to other tools at this time.

  • SAPGUI JAVA 7.10 (OSX 10.5.1): cannot select multiple columns in ALV

    Hi,
    in sapgui java 7.10 (on mac osx 10.5.1) I cannot select multiple columns in ALV reports.
    I can do it only in some transactions (like SE16). But on all our custom reports (REUSE_ALV_GRID_DISPLAY) in does not work.
    Any hint?
    Many thanks,
    Lorenzo

    Hi Lorenzo,
    did you double check if selecting multiple columns works with SAP GUI for Windows in the same report?
    If yes, I suggest to file a bug report so we can do a remote logon to run your custom report.
    If not it might be because of REUSE_ALV_GRID_DISPLAY itself or your parameters calling REUSE_ALV_GRID_DISPLAY.
    Best regards
    Rolf-Martin

  • How to create a Type Object with Dynamic select query columns in a Function

    Hi Every One,
    I'm trying to figure out how to write a piplined function that executes a dynamic select query and construct a Type Object in order to assigned it to the pipe row.
    I have tried by
    SELECT a.DB_QUERY INTO actual_query FROM mytable a WHERE a.country_code = 'US';
    c :=DBMS_SQL.OPEN_CURSOR;
    DBMS_SQL.PARSE(c,actual_query,DBMS_SQL.NATIVE);
    l_status := DBMS_SQL.EXECUTE(c);
    DBMS_SQL.DESCRIBE_COLUMNS(c, col_cnt, rec_tab);
    FOR j in 1..col_cnt LOOP
    DBMS_SQL.DEFINE_COLUMN(c,j,v_val,2000);
    END LOOP;
    FOR j in 1..col_cnt LOOP
    DBMS_SQL.COLUMN_VALUE(c,j,v_val);
    END LOOP;
    But got stuck, how to iterate the values and assign to a Type Object from the cursor. Can any one guide me how to do the process.
    Thanks,
    mallikj2

    Hi Justin,
    First of thanks for your reply, and coming to my requirement, I need to report the list of items which are there in the dynamic select statement what am getting from the DB. The select statement number of columns may vary in my example for different countries the select item columns count is different. For US its '15', for UK it may be 10 ...like so, and some of the column value might be a combination or calculation part of other table columns (The select query contains more than one table in the from clause).
    In order to execute the dynamic select statement and return the result i choose to write a function which will parse the cursor for dynamic query and then iterate the values and construct a Type Object and append it to the pipe row.
    Am relatively very new for these sort of things, welcome in case of any suggestions to make it simple (Instead of the function what i thought to work with) also a sample narrating the new procedure will be appreciated.
    Thanks in Advance,
    mallikj2.

  • Selecting all columns from table in a model query

    I have written a model query which joins 4 tables, applies some rules and returns updated rows by selecting 4 columns out of this. Currently it works fine because all 4 columns are from MODEL aliases. Now I need to select 16 more columns in the same query but none of these columns is added in MODEL aliases. When I tried selecting these columns I got oracle error ORA - 32614. Can someone please guide me to include these columns in the same model query?
    I tried couple of options but no luck. Here are those options for ready reference:
    1. I cannot nest existing model query into another select because there are no columns avaiable to join in output of current query to map with other records.
    2. I cannot include all 16 columns in MODEL aliases because some of these columns are actually output of user defined functions.
    I am using Oracle database version 11g Release 11.2.0.1.0.
    Edited by: Anirudha Dhopate on Jan 23, 2011 5:43 PM

    Thank you Avijit for your reply. There is a syntax error on the ON in this part of the statement which I don't know how to fix - I tried messing around with another INNER JOIN but am not confident that I'm doing the right thing:
    SENAlertType.SENAlertTypeIDONClassMember.ClassMemberStudentID
    Thanks for your help! I will need to do some more bedtime reading on joins.
    Daniel

Maybe you are looking for

  • New iMac can't see Laserwriter Select connected to a PC on same LAN-- why?

    I've just returned to the Mac universe after a five year hiatus. When I discovered how well Macs play with PCs and Unix these days, I decided to come back. There's just one issue: I can't print to my Laserwriter Select 360, connected by parallel port

  • Identify partition name from input data

    Hi gurus, Pleae help for the below based on the input data i have to delete the partition from the table. suppose if a table PART  is partitioned based on the column id  number.  if my input data is 10 if it is present in the partition then i want to

  • Scroll bar pushing content

    I'm building a site for my girlfriends illustration and some pages have more content than others and on these pages a scroll bar appears which pushes the content to the left which then makes going back to a page without a scroll give the site an inco

  • Download pictures not working

    I am having trouble getting pictures to go from my iPhone5 to my PC with iCloud.  I can get pictures to go from my PC to my iPhone but not the other way around.  Any ideas how to fix this?

  • Audio tracks no longer play, Help

    I have been working with a  dozen or so movies.  The video is set.  Audio clips come from several sessions using voiceover and narrative tracks imported from itunes.  Everything had been working well until today when I opened imovie11 to continue edi