Table.putClientProperty("JTable.autoStartsEdit",Boolena.FALSE) and jdk1.3

Hi.
I want to disable automatic cell editing in a JTable with following:
JTable myTable = new JTable(3,3);
myTable.putClientProperty("JTable.autoStartsEdit",Boolena.FALSE);It works only with JDK1.4 but not with JDK1.3.
Does anyone knows how to do this with JDK1.3?

table.setSurrendersFocusOnKeystroke(true);

Similar Messages

  • JTable SelectionModel - first Index and Las Index giving incorrect values

    Hi Guys,
    When i added a ListSelectionListener to the JTable's selectionModel, and tried to get the first index and last index values. The goofy thing i noticed is when you select different rows, the indexes are correct,but when you switch between the same rows, then indexes provided by the ListSelectionListener are always the same. Example : if you switch between 3 and 4 rows first index is 2 and last index is 3 which is correct, but if you go back 3rd row from 4th row, the first index is still 2 and last index is 3... which is kind of weird.
    Any ideas about this, and why this is happenning.
    I am pasting my sample code here any explanation is very helpfull to understand this behavior
    Thanks
    Nicedude
    import javax.swing.JFrame;
    import javax.swing.JPanel;
    import javax.swing.JScrollPane;
    import javax.swing.JTable;
    import javax.swing.JComponent;
    import javax.swing.ListSelectionModel;
    import javax.swing.event.ListSelectionEvent;
    import javax.swing.event.ListSelectionListener;
    import java.awt.Dimension;
    import java.awt.GridLayout;
    import java.awt.event.MouseAdapter;
    import java.awt.event.MouseEvent;
    * SimpleTableSelectionDemo is just like SimpleTableDemo,
    * except that it detects selections, printing information
    * about the current selection to standard output.
    public class SimpleTableSelectionDemo extends JPanel {
         private boolean DEBUG = false;
         private boolean ALLOW_COLUMN_SELECTION = false;
         private boolean ALLOW_ROW_SELECTION = true;
         public SimpleTableSelectionDemo() {
              super(new GridLayout(1,0));
              final String[] columnNames = {"First Name",
                        "Last Name",
                        "Sport",
                        "# of Years",
              "Vegetarian"};
              final 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)}
              final JTable table = new JTable(data, columnNames);
              table.setPreferredScrollableViewportSize(new Dimension(500, 70));
              table.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
              if (ALLOW_ROW_SELECTION) { // true by default
                   ListSelectionModel rowSM = table.getSelectionModel();
                   rowSM.addListSelectionListener(new ListSelectionListener() {
                        public void valueChanged(ListSelectionEvent e) {
                             //Ignore extra messages.
                             if (e.getValueIsAdjusting()) return;
                             ListSelectionModel lsm = (ListSelectionModel)e.getSource();
                             if (lsm.isSelectionEmpty()) {
                                  System.out.println("No rows are selected.");
                             } else {
                                  int selectedRow = lsm.getMinSelectionIndex();
                             System.out.println("Row " + selectedRow + " is now selected.");
                                  int first = e.getFirstIndex();
                                                            int last = e.getLastIndex();
                              System.out.println(" First Index is : " + first);
                              System.out.println(" Last Index is : " + last );
              } else {
                   table.setRowSelectionAllowed(false);
              if (ALLOW_COLUMN_SELECTION) { // false by default
                   if (ALLOW_ROW_SELECTION) {
                        //We allow both row and column selection, which
                        //implies that we *really* want to allow individual
                        //cell selection.
                        table.setCellSelectionEnabled(true);
                   table.setColumnSelectionAllowed(true);
                   ListSelectionModel colSM =
                        table.getColumnModel().getSelectionModel();
                   colSM.addListSelectionListener(new ListSelectionListener() {
                        public void valueChanged(ListSelectionEvent e) {
                             //Ignore extra messages.
                             if (e.getValueIsAdjusting()) return;
                             ListSelectionModel lsm = (ListSelectionModel)e.getSource();
                             if (lsm.isSelectionEmpty()) {
                                  System.out.println("No columns are selected.");
                             } else {
                                  int selectedCol = lsm.getMinSelectionIndex();
                                  System.out.println("Column " + selectedCol
                                            + " is now selected.");
              if (DEBUG) {
                   table.addMouseListener(new MouseAdapter() {
                        public void mouseClicked(MouseEvent e) {
                             printDebugData(table);
              //Create the scroll pane and add the table to it.
              JScrollPane scrollPane = new JScrollPane(table);
              //Add the scroll pane to this panel.
              add(scrollPane);
         private void printDebugData(JTable table) {
              int numRows = table.getRowCount();
              int numCols = table.getColumnCount();
              javax.swing.table.TableModel model = table.getModel();
              System.out.println("Value of data: ");
              for (int i=0; i < numRows; i++) {
                   System.out.print("    row " + i + ":");
                   for (int j=0; j < numCols; j++) {
                        System.out.print("  " + model.getValueAt(i, j));
                   System.out.println();
              System.out.println("--------------------------");
          * Create the GUI and show it.  For thread safety,
          * this method should be invoked from the
          * event-dispatching thread.
         private static void createAndShowGUI() {
              //Make sure we have nice window decorations.
              JFrame.setDefaultLookAndFeelDecorated(true);
              //Create and set up the window.
              JFrame frame = new JFrame("SimpleTableSelectionDemo");
              frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
              //Create and set up the content pane.
              SimpleTableSelectionDemo newContentPane = new SimpleTableSelectionDemo();
              newContentPane.setOpaque(true); //content panes must be opaque
              frame.setContentPane(newContentPane);
              //Display the window.
              frame.pack();
              frame.setVisible(true);
         public static void main(String[] args) {
              //Schedule a job for the event-dispatching thread:
              //creating and showing this application's GUI.
              javax.swing.SwingUtilities.invokeLater(new Runnable() {
                   public void run() {
                        createAndShowGUI();
    }

    >
    I was (maybe wrongly) under the impression that, last index will give the last selected value and first index will give me the currect selected value. Not maybe - your impression sure is wrong. Honestly can't understand how it's possible to mis-interpret the api doc of ListSelectionEvent (except not reading it ;-)
    "Represents a change in selection status between firstIndex and
    lastIndex, inclusive. firstIndex is less than or equal to
    lastIndex. The selection of at least one index within the range will
    have changed."
    Jeanette

  • JDeveloper 3.1 and JDK1.2.2: are they REALLY compliant?

    Hi,
    I've already been developing in JDev 3.0 using Java 1.1.8 for a few months and have a number of EJB's deployed in an Oracle8i 8.1.5 database. These are accessed by a servlet which is called from a C++ application in order to populate the db tables. I'm using Java Webserver 2.0 and everything works fine.
    I've been upgrading to Java 2 with JDev 3.1, Oracle 8i R2, and JDK1.2.2. Everything again works fine when I am testing and debugging in the JDev 3.1 IDE but when I deploy to the Web server, my context lookup for the EJB published name freezes, returns an error status to the C++ app but does not display any error/exception msgs in the server console/log files.
    On investigating I found that the java.exe bundled with JDev 3.1 as the JDK1.2.2 version is actually NOT the java.exe that has been dispatched with the release version of JDK1.2.2! There are however two files in the bin directory of the JDK1.2.2 called oldjava.exe and oldjavaw.exe which correspond to the ones bundled with JDev 3.1?
    Could someone please explain what is going on? As it stands at the moment the version of java.exe with JDK1.2.2 does not work for my EJB's but if I replace it with the oldjava.exe, it works fine. Does this mean that JDev 3.1 is NOT actually JDK1.2.2 compliant or have I done something wrong?
    This is potentially a major problem for our projects so if anyone at Oracle has any info it would be greatly appreciated.
    Cheers
    Dave

    David,
    I changed Sun Java 1.2.2 VM to JDeveloper 3.0 1.1.8 VM and now I get this:
    [Root exception is java.lang.ClassNotFoundException: EJBBibles.BibleSearchHomeHelper]javax.naming.Na
    mingException: Unknown reasons
    at oracle.aurora.jndi.sess_iiop.SessionCtx._activate(SessionCtx.java:82)
    at oracle.aurora.jndi.sess_iiop.SessionCtx.activate(SessionCtx.java:276)
    at oracle.aurora.jndi.sess_iiop.ServiceCtx.lookup(ServiceCtx.java:320)
    at oracle.aurora.jndi.sess_iiop.sess_iiopURLContext.lookup(sess_iiopURLContext.java:215)
    at oracle.aurora.jndi.sess_iiop.sess_iiopURLContext.lookup(sess_iiopURLContext.java:201)
    at javax.naming.InitialContext.lookup(InitialContext.java:288)
    at EJBBiblesServlet.Servlet1.init(Servlet1.java:36)
    at org.apache.tomcat.core.ServletWrapper.initServlet(ServletWrapper.java:315)
    at org.apache.tomcat.core.ServletWrapper.handleRequest(ServletWrapper.java:445)
    at org.apache.tomcat.core.ServletWrapper.handleRequest(ServletWrapper.java:597)
    at org.apache.tomcat.servlets.InvokerServlet.service(InvokerServlet.java:257)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
    at org.apache.tomcat.core.ServletWrapper.handleRequest(ServletWrapper.java:503)
    at org.apache.tomcat.core.ContextManager.service(ContextManager.java:559)
    at org.apache.tomcat.service.http.HttpConnectionHandler.processConnection(HttpConnectionHand
    ler.java:160)
    at org.apache.tomcat.service.TcpConnectionThread.run(SimpleTcpEndpoint.java:338)
    at java.lang.Thread.run(Thread.java:466)
    If I use JDev 1.2 VM, I get this:
    javax.naming.NotContextException: fumaca:2481:eatg/test/BibleSearchRemote
    java.lang.Object oracle.aurora.jndi.sess_iiop.sess_iiopURLContext.lookup(javax.naming.Name)
    java.lang.Object oracle.aurora.jndi.sess_iiop.sess_iiopURLContext.lookup(java.lang.String)
    java.lang.Object javax.naming.InitialContext.lookup(java.lang.String)
    void EJBBiblesServlet.Servlet1.init(javax.servlet.ServletConfig)
    void org.apache.tomcat.core.ServletWrapper.initServlet()
    void org.apache.tomcat.core.ServletWrapper.handleRequest(org.apache.tomcat.core.Request, org
    .apache.tomcat.core.Response)
    void org.apache.tomcat.core.ServletWrapper.handleRequest(org.apache.tomcat.core.HttpServletR
    equestFacade, org.apache.tomcat.core.HttpServletResponseFacade)
    void org.apache.tomcat.servlets.InvokerServlet.service(javax.servlet.http.HttpServletRequest
    , javax.servlet.http.HttpServletResponse)
    void javax.servlet.http.HttpServlet.service(javax.servlet.ServletRequest, javax.servlet.Serv
    letResponse)
    void org.apache.tomcat.core.ServletWrapper.handleRequest(org.apache.tomcat.core.Request, org
    .apache.tomcat.core.Response)
    void org.apache.tomcat.core.ContextManager.service(org.apache.tomcat.core.Request, org.apach
    e.tomcat.core.Response)
    void org.apache.tomcat.service.http.HttpConnectionHandler.processConnection(org.apache.tomca
    t.service.TcpConnection, java.lang.Object[])
    void org.apache.tomcat.service.TcpConnectionThread.run()
    void java.lang.Thread.run()
    Which means that there is a difference relative to the VM version.
    All the names are correct on 8i deployment. And all necessary files are on classpath, (including the EJB source and generated jars, that are also in the /lib on the context dochome).
    Any thoughts?
    Thanks,
    Eduardo
    null

  • Print a JTable with several Header and Footers

    Hi everybody,
    my name is Lothar and I come from Germany. My english is not very well, but I hope you understand me an my problem.
    I want to print a JTable, but I want to print a header with several headers and footers.
    For example:
    h3. Header
    h5. 1. Subtitle
    h5. 2. Subtitle
    Table
    h5. 3. Subtitle
    h5. Footer
    But, I do not know how I can do that. Can anybody tell me, how I can solve my problem. Please, explain for a newbie because I have learned Java since two months ;)
    Here the code:
    import java.awt.*;
    import java.awt.event.*;
    import java.text.*;
    import java.util.Date;
    import javax.swing.*;
    public class Beispiel extends JFrame implements ActionListener {
        private JTable table;
        public static void main(String[] args) {
            Beispiel tl = new Beispiel();
            tl.setVisible(true);
            tl.pack();
        public Beispiel() {
            setLayout(new BorderLayout());
            // DruckButton
            JButton print = new JButton("Print");
            add(print, BorderLayout.SOUTH);
            print.addActionListener(this);
            // Tabelle
            add(new JScrollPane(createTable()), BorderLayout.CENTER);
            // schlie&szlig;t das Frame
            setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        public JTable createTable() {
            // titel
            String[] title = new String[] { "Datum", "Von", "Bis",
                    "Dauerinsgesamt", "Bemerkung" };
            // daten
            String[][] data = new String[][] { { "", "", "", "", "" },
            table = new JTable(data, title);
            table.setAutoResizeMode(JTable.AUTO_RESIZE_OFF);
            return table;
        public void actionPerformed(ActionEvent e1) {
            MessageFormat header = new MessageFormat("Header");
            MessageFormat footer = new MessageFormat("Footer");
            try {
                table.print(JTable.PrintMode.FIT_WIDTH, header, footer);
            } catch (Exception e2) {
                System.err.format("Cannot print %s%n", e2.getMessage());
    }

    Nobody?
    Can nobody solve my problem?

  • How to make a cell in a JTable to be uneditable and handle events

    I tried many things but failed,How do you make a cell in a JTable to be uneditable and also be able to handle events>Anyone who knows this please help.Thanx

    Hello Klaas2001
    You can add KeyListener ,MouseListener
    Suppose you have set the value of cell using setValueAt()
    table.addKeyListener(this);
    public void keyTyped(KeyEvent src)
    String val="";
    int r= table.getEditingRow();
    int c= table.getEditingColumn();
    val=table.getValueAt(r,c).toString();
    if (r!=-1 && c!=-1)
    TableCellEditor tableCellEditor = table.getCellEditor(r, c);
    tableCellEditor.stopCellEditing();
    table.clearSelection();
    table.setValueAt(val,r,c);
    public void keyReleased(KeyEvent src)
    public void keyPressed(KeyEvent src)
    table.addMouseListener(this);
    public void mouseClicked(MouseEvent e)
    public void mouseEntered(MouseEvent e)
    public void mouseExited(MouseEvent e)
    public void mousePressed(MouseEvent e)
    public void mouseReleased(MouseEvent e)
    if(e.getClickCount()>=2)//Double Click
    table.clearSelection();
    int r= table.getEditingRow();
    int c= table.getEditingColumn();
    if (r!=-1 && c!=-1)
    TableCellEditor tableCellEditor = table.getCellEditor (
    r,c);
    tableCellEditor.stopCellEditing();
    table.clearSelection();
    table.setValueAt("",r,c);
    }//Mouse Released
    You can remove keyListener and Mouse Listener whenever You want to edit
    then add it later.
    Regarding handling events implement javax.swing.event.TableModelListener
    table.getModel().addTableModelListener(this);
    public void tableChanged(javax.swing.event.TableModelEvent source)
    TableModel tabMod = (TableModel)source.getSource();
         switch (source.getType())
    case TableModelEvent.UPDATE:
         break;
         }//Table Changed Method
    //This method gets fired after table cell value is changed.

  • How to print jTable with custom header and footer....

    Hello all,
    I'm trying to print a jTable with custom header and footer.But
    jTable1.print(PrintMode,headerFormat,footerFormat,showPrintDialog,attr,interactive)
    does not allow multi line header and footer. I read in a chat that we can make custom header and footer and wrap the printable with that of the jTable. How can we do that..
    Here's the instruction on the chat...
    Shannon Hickey: While the default Header and Footer support in the JTable printing won't do exactly what you're looking for, there is a straight-forward approach. You can turn off the default header/footer and then wrap JTable's printable inside another Printable. This wrapper printable would then render your custom data, and then adjust the size given to the wrapped printable
    But how can i wrap the jTable's Printable with the custom header and footer.
    Thanks in advance,

    I also once hoped for an easy way to modify a table's header and footer, but found no way.
    Yet it is possible.

  • Tranforming 0 to False and 1 to true

    Gurus,
    I am using sql query template and getting data  as 0/1 for one column from table.
    I want to show 0 as FALSE and 1 as TRUE in the iGrid.
    I didn't ever use the tranform tab . Do i have to write any xslt for my query??
    Or
    do i have to just change the query to get that simple transformation?
    Any ideas??
    Please help.
    Thanks
    Vansi

    Your best bet is to look at the help documentation for 11.5, there are several predefined xsl examples detailed there, and the wwwroot/Illuminator/Stylesheets directory has several examples for a point of reference.
    The InlineTransform tab is where you would apply this xsl file to your raw query data and it would need to take the Rowsets/Rowset/Row and produce the new desired Rowsets/Rowset/Row results.  This functionality pre-dates BLS, and it will probably be easier for you to use the action blocks to do your transformations.
    Regards,
    Jeremy

  • Creating a JTable with resizeable columns and Horizontal Scrollbar

    Hi,
    I would like to create a JTable with about 24 columns in it. The problem is, my ViewPort in my JScrollPane is about 3-400pixels wide, and the JTable tries to cram itself into the ViewPort. This makes the columns too tiny to read. I'd like it to do something a little more sensible, like use the PreferredSize of the columns. Can anyone point me in the right direction to keep JTable from creating scrunched up little columns, so that it creates columns that are at least partially readable? Thanks.
    BTW, I suppose I could set NO_AUTO_RESIZE but I would rather not do that. I like being able to resize columns. Basically what I want to do is control the JTable's width and not worry about the ViewPort's width.

    This made it impossible to resize columns. Works fine for me:
    import java.awt.*;
    import javax.swing.*;
    import javax.swing.table.*;
    public class TableHorizontal extends JFrame
        public TableHorizontal()
            JTable table = new JTable(5, 10);
            table.setAutoResizeMode( JTable.AUTO_RESIZE_OFF );
            JScrollPane scrollPane = new JScrollPane( table );
            getContentPane().add( scrollPane );
            table.getColumnModel().getColumn(0).setPreferredWidth(10);
            table.getColumnModel().getColumn(1).setPreferredWidth(20);
            table.getColumnModel().getColumn(2).setPreferredWidth(30);
            table.getColumnModel().getColumn(3).setPreferredWidth(40);
            table.getColumnModel().getColumn(4).setPreferredWidth(50);
        public static void main(String[] args)
            TableHorizontal frame = new TableHorizontal();
            frame.setDefaultCloseOperation( EXIT_ON_CLOSE );
            frame.pack();
            frame.setVisible(true);
    }

  • JTable - Swapping the Rows and Columns

    This issue was raised in the Java Programming forum. Received initially as a weird requirement, it now seems that it is more common than you might think. Under it's original title it was "JTable - Limitation or Not?"
    I introduced the topic here so that the thread perspective can include more experienced Swing developers.
    The JTable in it's default layout is intended to hold database tables with records in rows. But what if you want records in columns?
    Some have said why? Just accept the row layout. Others have said use a customised form. Both reasonable views. Despite this, others report that the inherrited power of the JTable is worth leveraging and they have been doing it for years. Albeit with messy code in certain cases.
    This is a clear candidate for a popular derived component. If the existing JTable were renamed as a JTableRecordPerRow I am describing a JTableRecordPerColumn. The corresponding Table Model must naturally have a getRowClass method and no getColumnClass method.
    Java is good at seperating data from display issues so essentially this is only a display issue. The data representation is unaffected.
    While this may be so, the TableModel for a JTable makes the link from the display to the data so it must have knowledge about cell type to trigger the correct cell editor for example.
    I think it is fair to say that the standard JTable has not be designed with alternative row/column or column/row displays in mind. Hence a single getColumnClass method. However implementing a Table model which exchanges columns for rows is a good start. This leaves a few loose ends where editting is concerned.
    While this may not be an ideal topic for anyone just learning Swing I have been encouraged to consider the general case within the limitations of the cell types normally supported by the default Table model.
    I would have a guess that this is an established component in many private Java libraries already.
    Views and experience on this topic extremely welcome.

    It appears to me that while interchanging the rows and columns of a JTable is not trivial it is still worthwhile as a workhorse component.
    Perhaps the original design could have allowed for an aternative layout manager of somekind but this could easily have made description of records/rows and fields/columns confusing.
    I will probably get this summary wrong but I aill attempt to collate the neatest approach as I see it. Criticisms or shorter steps welcome. My thanks to the original contributors traceable from this thread.
    In the descriptions below a distinction is made between the normal internal data model representation of a row, called "mrow", and the displayed form "row".
    Only the TableModel need be changed.
    1 Use row 0 to show the headers by a)disabling the normal TableHeader renderer b)setting the cell renderer for column 0 to the default renderer used by the TableHeader and c)using the getValueAt method to return mcol header values for the row entries.
    2 For other row, col values to getValueAt return the value at mcol, mrow where mcol==row-1 & mrow==col.
    3 Create a new getCellClass(col,row) method to return the class where mrow==0 and mcol==row-1. Note that I am only trying to immitate the common use of of a database record per mrow here.
    4 Override a)getCellRenderer and b)getCellEditor to use getCellClass
    Four steps with seven parts seems worth it to me.
    The power of Swing!
    Many thanks to all.

  • ADF Table filter issue with OR or AND input value

    Hi all,
    adf:table filterable fields for OR or AND input value not works. Actually One of column is for State and it has "OR" value for -> OREGON State.
    and I tried using filterModel and queryListener for table attribute. But I am not getting exact clue where I need to fix for this issue. Any suggestion and help is appreciated greatly.
    jdev version 11.1.1.3
    Thank you.
    - Robin

    Something like this might work for the one case:
    public void handleQuery(QueryEvent queryEvent){
        // Replace the OR with an equivalent condition
        Map m =
          ((FilterableQueryDescriptor) (queryEvent.getDescriptor())).getFilterCriteria();
        for (Map.Entry entry: (Collection<Map.Entry>) m.entrySet())
          if (entry.getValue() != null &&
              StringUtils.equalsIgnoreCase(entry.getValue().toString(), "OR"))
            entry.setValue("O AND _R");
        // Process The Query
        ELUtils.invokeMethod("#{bindings.VOQuery.processQuery}",
                             QueryEvent.class, queryEvent);
        // Put the OR back
        for (Map.Entry entry: (Collection<Map.Entry>) m.entrySet())
          if (entry.getValue() != null &&
              StringUtils.equalsIgnoreCase(entry.getValue().toString(),
                                           "O AND _R"))
            entry.setValue("OR");
    }

  • Any table keep track of Sales order and relevant IDOC

    hi all,
    Do we have any table to keep track Sales order and its relevant IDOC in the system?
    A list of sales order# given by user, from the list, we would like to find a faster way to get the corresponding IDOC.
    thanks.

    Hi Reetha,
    EDIDS table would have the IDOC Number & sales order number. Parameter 2 is the field in EDIDS which would have the sales order number.
    I understand that this table would have many records but i dont think any other table would have the above combination. If you get any other table, then pls. do update @ it on this thread.
    Thanks,
    Best regards,
    Prashant

  • In which table can I find the name and surname  for a username ?

    Hello,
    I search the table with the master data of users. Specially I search the table where I can find the
    name, surname for a user.
    In which table can I find the name and surname  for a username ?
    Thanx in Advance

    Hello  everybody,
    thank you for the helpful informations.
    thank you very much
    with kind regards
    cetoman

  • From which tables i would find the delivery and billing document field..??

    I need to create an ALV report which displays the following details in the output.
    Order No  Item No     Material     Order Qty     Item Category     Plant     Delivery     Billing Document     Sales Org     Dist Channel     Division     Created By     Created On      Changed On
    For(Order No  Item No     Material     Order Qty     Item Category     Plant) i took the fields from vbap and
    for(Sales Org     Dist Channel     Division     Created By     Created On      Changed On)i took the fields from vbak..
    From which tables i would find the delivery and billing document field related to sales document.??
    need help...
    Moderator message : Requirements dumping not allowed, thread locked.
    Edited by: Vinod Kumar on Mar 6, 2012 2:53 PM

    i am new to abap...so i dont have idea about sd table relationship.
    so please reply how to add delivery and billing doc in my coding below..
    *& Report  ZINAA_SD
    REPORT  zinaa_sd.
    TABLES: vbap, vbak, vbfa.
    TYPE-POOLS: slis.
    CONSTANTS: c_x TYPE char1 VALUE 'X'.
    TYPES:
            BEGIN OF st_vbap,
             vbeln TYPE vbap-vbeln,
             posnr TYPE vbap-posnr,
             matnr TYPE vbap-matnr,
             pstyv TYPE vbap-pstyv,
             kwmeng TYPE vbap-kwmeng,
             werks TYPE vbap-werks,
            END OF st_vbap,
            BEGIN OF st_vbak,
              vbeln TYPE vbak-vbeln,
              erdat TYPE vbak-erdat,
              ernam TYPE vbak-ernam,
              vkorg TYPE vbak-vkorg,
              vtweg TYPE vbak-vtweg,
              spart TYPE vbak-spart,
              aedat TYPE vbak-aedat,
            END OF st_vbak, 
           BEGIN OF st_final,
             vbeln TYPE vbap-vbeln,
             posnr TYPE vbap-posnr,
             matnr TYPE vbap-matnr,
             pstyv TYPE vbap-pstyv,
             kwmeng TYPE vbap-kwmeng,
             werks TYPE vbap-werks,
             erdat TYPE vbak-erdat,
             ernam TYPE vbak-ernam,
             vkorg TYPE vbak-vkorg,
             vtweg TYPE vbak-vtweg,
             spart TYPE vbak-spart,
             aedat TYPE vbak-aedat,
           END OF st_final.
    DATA:
          lt_vbap TYPE TABLE OF st_vbap,
          ls_vbap TYPE st_vbap,
          lt_vbak TYPE TABLE OF st_vbak,
          ls_vbak TYPE st_vbak,
          lt_final TYPE TABLE OF st_final,
          ls_final TYPE st_final,
          lt_fieldcat TYPE slis_t_fieldcat_alv,
          ls_fieldcat TYPE slis_fieldcat_alv,
          layout TYPE slis_layout_alv,
          lt_sort TYPE slis_t_sortinfo_alv,
          ls_sort TYPE slis_sortinfo_alv.
    SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-001.
    SELECT-OPTIONS: s_vbeln FOR vbap-vbeln,
                    s_erdat FOR vbap-erdat.
    SELECTION-SCREEN END OF BLOCK b1.
    PERFORM select_data.
    PERFORM loop_final.
    PERFORM sort.
    PERFORM a USING:
          'VBELN' TEXT-002,
          'POSNR' TEXT-003,
          'MATNR' TEXT-004,
          'KWMENG' TEXT-005,
          'PSTYV' TEXT-006,
          'WERKS' TEXT-007,
          'VKORG' TEXT-008,
          'VTWEG' TEXT-009,
          'SPART' TEXT-010,
          'ERNAM' TEXT-011,
          'ERDAT' TEXT-012,
          'AEDAT' TEXT-013.
    PERFORM display.
    *&      Form  SELECT_DATA
          text
    FORM select_data.
      SELECT
       vbeln
       vkorg
       vtweg
       spart
       ernam
       erdat
       aedat
       INTO CORRESPONDING FIELDS OF TABLE lt_vbak
       FROM vbak
       WHERE vbeln IN s_vbeln AND erdat IN s_erdat.
      IF sy-subrc = 0.
        SORT lt_vbak by vbeln.
      ENDIF.
      SELECT
       vbeln
       posnr
       matnr
       kwmeng
       pstyv
       werks
       INTO CORRESPONDING FIELDS OF TABLE lt_vbap
       FROM vbap
       FOR ALL ENTRIES IN lt_vbak
       WHERE vbeln = lt_vbak-vbeln.
      IF sy-subrc = 0.
        SORT lt_vbap by vbeln.
      ENDIF.
    ENDFORM.                    "SELECT_DATA
    *&      Form  LOOP_FINAL
          text
    FORM loop_final.
      LOOP AT lt_vbap INTO ls_vbap.
        ls_final-vbeln = ls_vbap-vbeln.
        ls_final-posnr = ls_vbap-posnr.
        ls_final-matnr = ls_vbap-matnr.
        ls_final-kwmeng = ls_vbap-kwmeng.
        ls_final-pstyv = ls_vbap-pstyv.
        ls_final-werks = ls_vbap-werks.
        READ TABLE lt_vbak INTO ls_vbak WITH KEY vbeln = ls_vbap-vbeln BINARY SEARCH.
        ls_final-vkorg = ls_vbak-vkorg.
        ls_final-vtweg = ls_vbak-vtweg.
        ls_final-spart = ls_vbak-spart.
        ls_final-ernam = ls_vbak-ernam.
        ls_final-erdat = ls_vbak-erdat.
        ls_final-aedat = ls_vbak-aedat.
        APPEND ls_final TO lt_final.
        CLEAR ls_final.
      ENDLOOP.
      ENDFORM.                    "LOOP_FINAL
    *&      Form  SORT
          text
    FORM sort.
      ls_sort-spos = '01' .
      ls_sort-fieldname = 'VBELN'.
      ls_sort-tabname = 'LT_FINAL'.
      ls_sort-up = c_x.
      ls_sort-subtot = c_x.
      APPEND ls_sort TO lt_sort .
    ENDFORM.                    "SORT
    *&      Form  A
          text
         -->FNAME      text
         -->SELTEXT    text
         -->EMPHA      text
    FORM a USING fname TYPE string seltext TYPE string.
      IF fname = 'KWMENG'.
        ls_fieldcat-do_sum =  c_x.
      ENDIF.
      ls_fieldcat-fieldname = fname.
      ls_fieldcat-seltext_m = seltext.
      APPEND ls_fieldcat TO lt_fieldcat.
      CLEAR ls_fieldcat.
    ENDFORM.                    "A
    *&      Form  ALV
          text
    FORM display.
      layout-zebra = c_x.
      layout-colwidth_optimize = c_x.
      CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
       EXPORTING
      I_INTERFACE_CHECK                 = ' '
      I_BYPASSING_BUFFER                = ' '
      I_BUFFER_ACTIVE                   = ' '
       i_callback_program                = sy-repid
      I_CALLBACK_PF_STATUS_SET          = ' '
      I_CALLBACK_USER_COMMAND           = ' '
      I_CALLBACK_TOP_OF_PAGE            = ' '
      I_CALLBACK_HTML_TOP_OF_PAGE       = ' '
      I_CALLBACK_HTML_END_OF_LIST       = ' '
      I_STRUCTURE_NAME                  =
      I_BACKGROUND_ID                   = ' '
      I_GRID_TITLE                      =
      I_GRID_SETTINGS                   =
        is_layout                         = layout
        it_fieldcat                       = lt_fieldcat
      IT_EXCLUDING                      =
      IT_SPECIAL_GROUPS                 =
        it_sort                           = lt_sort
      IT_FILTER                         =
      IS_SEL_HIDE                       =
      I_DEFAULT                         = C_X
      I_SAVE                            = ' '
      IS_VARIANT                        =
      IT_EVENTS                         =
      IT_EVENT_EXIT                     =
      IS_PRINT                          =
      IS_REPREP_ID                      =
      I_SCREEN_START_COLUMN             = 0
      I_SCREEN_START_LINE               = 0
      I_SCREEN_END_COLUMN               = 0
      I_SCREEN_END_LINE                 = 0
      I_HTML_HEIGHT_TOP                 = 0
      I_HTML_HEIGHT_END                 = 0
      IT_ALV_GRAPHICS                   =
      IT_HYPERLINK                      =
      IT_ADD_FIELDCAT                   =
      IT_EXCEPT_QINFO                   =
      IR_SALV_FULLSCREEN_ADAPTER        =
    IMPORTING
      E_EXIT_CAUSED_BY_CALLER           =
      ES_EXIT_CAUSED_BY_USER            =
        TABLES
        t_outtab                          = lt_final
    EXCEPTIONS
      PROGRAM_ERROR                     = 1
      OTHERS                            = 2
      IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
    ENDFORM.                    "ALV

  • Inside border of table changes to white in opera and ie8?

    Does anyone know why Opera and internet explorer change the inside borders of the table to white?
    In Safari and Firefox it stays black.
    Here is a link to the website
    EDIT:
    I now attached a screen shot of the table of what it looks like in opera.

    I no longer worry about Netscape or IE5.5 as these browsers are officially obsolete.  But IE6 is still used by a enough people worldwide who are on older operating systems & for whom upgrading to IE7 or IE8 may not be an option. What are they supposed to do?
    Personally I don't want to upgrade out of IE6 because I still need it to test web pages.  If I want to look at your site in IE7 I will jump to my laptop.  And if I want to look at it in IE8, I will jump to my Vista OS.  Put on the IE Png fix and you won't have any unhappy site visitors.   If you force people to upgrade to a browser they cannot possibly support, you will drive clients away - guaranteed.  IE6 sucks, we all know this.  But it's still here so we need to deal with it.
    Nancy O.
    Alt-Web Design & Publishing
    Web | Graphics | Print | Media  Specialists
    www.alt-web.com/
    www.twitter.com/altweb
    www.alt-web.com/blogspot.com

  • Set item property to false and true

    when i set item to false and then set item property to true. The item is displayed but its gray out and not enabled. Am i missing something
    Set_Item_Property('PUSH_BUTTON_SAVE',VISIBLE,PROPERTY_FALSE);
    and then
              Set_Item_Property('PUSH_BUTTON_SAVE',VISIBLE,PROPERTY_TRUE);

    Check the Forms online help on Set_Item_Property, near the bottom in the usage notes. Lots of things happen when you set visible to False:
    Setting DISPLAYED to False:
      sets the Enabled and Navigable item properties to False
      sets the Updateable item property to False
      sets the Update_Null item property to False
      sets the Required item property to False
      sets the Queryable item property to False
    So you may need to set more of them back to true in your code when you want to make it re-display.

Maybe you are looking for

  • How can I get an RTF file to open properly in MS Word?

    I'm using Coldfusion 8 and trying get it to export to Microsoft Word an RTF file  that was also created in Word, and is stored on the server. The problem is that when Word opens from the browser, it displays the RTF code for the document as if I'd op

  • Macro not getting executed fully

    Hello All, I have written a macro for checking whether incoming data formats are correct for all the fields ( 6 importing structure in method, 1header and 5 items ). Now my code will be common for all the tables, so I wrote a macro. The problem is af

  • Custom icon seems locked ... can't change it

    Powermac G5/10.4.6 A while back I put custom icons on two partitions of a LaCie FW drive. I'd like to change the icons, but I can't select them in the "Get Info" window. I can change icons of other drives, just not these two partitions. When I click

  • Are keywords added through Lightroom embedded into the file itself?

    I'm new to Lightroom. I'm looking for a way to organize my pictures and videos. But I'm also hestitant because I have no idea whether Lightroom will be around 10, 15 or 20 years from now. When I apply a keyword to a file, is that keyword permanently

  • Event at portal login

    Hi everyone, I'd like to popup a window when the user login  into the portal. Is there a way to do that ? Thanks you Regards