Editing one row at a time in a table control

Good day all
I need your urgent assistance with the problem below:
At first time load, the table control needs to allow input on the first line only, validation will then be done through clicking a “check” button.  After the check has been done, table control needs to open up the second row for input and grey out the first one. This sequence needs to follow every time a check has been performed.
After the check has been done, table control needs to show the previously entered data on the first line but grey it out, and open up only the second row for input.
The table control has been created using a wizard with an internal table and I am working on dialog/screen programming. The table control has been created as an output control but it needs to perform as both and output and input control.
I have made changes to the “MODULE tc_create_ph2_get_lines OUTPUT.” Which is created by the wizard as follows:
The module is in the PBO Section.
IF it_tab is initial.                                                                 "it_tab being the internal table that stores the data from the table control                        
     DESCRIBE TABLE it_tab LINES lv_num.
           LOOP AT SCREEN.
       IF tc_create_ph2-current_line <> 1.
         screen-input = 0.
         MODIFY SCREEN.
       ENDIF.
     ENDLOOP.
   ELSE.
tc_create_ph2-current_line = lv_num + 1.
     LOOP AT SCREEN.
       IF tc_create_ph2-current_line <> lv_num + 1 .
         screen-input = 0.
         MODIFY SCREEN.
       ENDIF.
     ENDLOOP.
   ENDIF.
  Your assistance will be highly appreciated.

Hi Dineo,
This module would make all line non editable except the last line, which will be open for input.
LOOP AT IT_ST INTO WA_ST WITH CONTROL MATERIAL CURSOR
MATERIAL-CURRENT_LINE.
    module mod_screen.
   ENDLOOP.
module MOD_SCREEN output.
   data : tc_lines type n.
   describe table it_st LINES tc_lines.
*  loop at screen.
     if material-current_line le tc_lines.
      loop at screen.
       screen-input = 0.
       modify screen.
       endloop.
      endif.
endmodule.
When checking and saving data, after saving data delete all lines of tc internal table except the last added row, if you want only the last record to appear in the table.

Similar Messages

  • How to send data one row at a time from xml to flex

    I want to setTimerEvent while sending data from xml to flex, one row at a time.
    I have attached the xml.
    Thanks in advance.

    Hi Greg,
    Thanks for the reply. You must have seen the xml which i have attached.Here is the .mxml code which i have written:
    <?xml version="1.0" encoding="utf-8"?>
    <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" creationComplete="accountData.send()">
    <mx:Script>
    <![CDATA[
    import mx.controls.*;
    import mx.rpc.events.FaultEvent;
    import mx.rpc.events.ResultEvent;
    import mx.collections.ArrayCollection;
    [Bindable]
    private var AccountInformation:ArrayCollection;
    private function AccountHandler(evt:ResultEvent):void
        AccountInformation = evt.result.xml.AccInfo;
    private function faultHandler(evt:FaultEvent):void
        var faultMessage:String = "Could not connect with XML file";
        Alert.show(faultMessage, "Error opening file");
    ]]>
    </mx:Script>
    <mx:HTTPService id="accountData" url="pgm1.xml" result="AccountHandler(event)" fault="faultHandler(event)"  />
    <mx:DataGrid x="20" y="24" width="950" dataProvider="{AccountInformation}" />
    </mx:Application>
    This reads and displays all the rows. But I want to display single row at a time with sometime time gap between the display of two consecutive rows.I am new to flex and this is my first code, so need your help on this.
    I hope i have made myself clear. If there is anything else please let me know.
    Looking forward to some solution.
    Thanks in advance.
    Regards,
    praj58

  • Adding Just One Row at a Time

    Multiple users can add Comments to a table, once added, the comments should be read only. How would I go about creating a region that will add just one row at a time, clear the region and then allow the adding of another row and not allow access to existing data rows?
    Jeff

    This example is doing exactly that:
    http://apex.oracle.com/pls/otn/f?p=31517:170
    Once added, the row can not be changed any more.
    Denes Kubicek
    http://deneskubicek.blogspot.com/
    http://www.opal-consulting.de/training
    http://apex.oracle.com/pls/otn/f?p=31517:1
    -------------------------------------------------------------------

  • Selecting only one row at a time

    Hi experts,
    i have following doubt regarding selecting rows from a db:
    Is there any way of selecting only one row AT A TIME from a dabase just to collect the data in rows instead of in a unique document containing all the rows?
    I would like you to ellaborate on this as i need to send only one row to the IE, and then other row, and so on... without throwing any error!
    I have seen that there are SELECT SINGLE and SELECT UP TO 1 ROW, but these two methods are only useful when retrieving only one row, and that does not match my requirements. I need to process all the rows but one by one..
    I know that we can use the receiver jdbc adapter as if it was a sender by means of its specific datatype, but how to do it row by row??
    Hope i had explained well..
    Thanks in advance and best regards,
    David

    Hi kiran,
    Yes, my table has 5 not null fields but i am selecting and updating fixes values so i think that I will definetely go for the next solution:
    SELECT * FROM t1 WHERE status='0' and ROWNUM<2;
    UPDATE t1 SET status='1' WHERE status='0' and ROWNUM<2;
    My only concern is if the update will take the same row that the select.... BTW, I think it will
    ..What do you guys think?
    I ve been trying to operate with your proposed queries but i received some errors. Your queries are very interesting but i think that with the above ones i meet my requirements as the status field will be 0 for not processed rows and 1 for precessed ones (and the update will look for the row that meets the same 'where' clause than the select, and then, and only then, it will set status='1').
    The only thing i have to care about is what i questioned before.
    Thanks a lot and best regards,
    David

  • Repaint One Row at a Time

    Hi,
    I have a graphical program that repaints every 2000 ms. I want to call another program that queries the Oracle dbase and returns one row at a time, so that in the graphical program, I see the value of the next row every 2000 ms. Any ideas on how I'd do this?
    I have the basics on resultsets and statements and using while(rs.next()), etc.. Thanks. Chris.

    Insert "Thread.sleep(2000);" at places where you want your program to wait for 2000 milliseconds.

  • Processing of Rows in the Non-visible area - Table Controls

    Hi,
         I have a table control. At any given point on the screen the table control displays 17 rows. now there is a functionality thru which the user will be able to paste some values into a particular column of the table control from the clipboard. Then the user will press save to save all the data on the table control into a DB table. the problem is the rows that are not visible on the screen i.e. the rows that has to be seen by scrolling the table control. while looping the table control these rows are not getting looped i.e. the looping ends with first 17 visible rows. how do i make the table control loop at the remaining records also?

    suppose, your table control name is 'table0'
    and you declare it as :
    'controls  table0 type tableview using screen 100.'
    so to process all rows of this table control you should assign for it
    'table0-lines = n.'
    where n is row count that you know.
    then you can use following statement
    'LOOP AT <internal table> CURSOR <scroll-var>
    [WITH CONTROL <table-control> ]
    [FROM <line1> ] [TO <line2> ].
    ...<actions>...
    ENDLOOP.'
    result: all n rows will be processed. in your case n is greater than 17.

  • Edit Appraisals:  Notes only shows one row at a time

    Under the Employee Review tab of MSS-->Edit Appraisals, when I click to create an appraisal, the appraisal form in our system has areas to add notes.  However, in the portal, the area to add notes is only 1 row.  It is scrollable, but you can only see one row of text at a time.  How can I expand the notes area/editor to show multiple lines of text?

    Turns out the configuration is on the R/3 side when setting up the Appraisal.  There is an option for number of lines for notes.

  • Update one row at a time, Data Grid

    Is it possible to update one row of a mx:DataGrid at a time.  I want to be able to have a user push a button and info populates one row of the data grid, user changes some properties and pushes the button again and another row of values populate the DataGrid.  Everything I see does a mass population from an XML or what have you.
    Thanks

    I did this this to work, so for those of you who may find this info helpfull here is how I solved the issue.
    I instantiated an ArrayCollection object like so:
    private var _rowValues:ArrayCollection = new ArrayCollection();
    I simply referenced the .addItem() property of my ArrayCollection.
    I then added values to the ArrayCollection as follows
    _rowValues.addItem({Ingredient:ingredient, Amount:amount, Category:category}); //dataField:value
    and referenced the dataField proerpty of the DataGrid... so in my case my 3 dataField properties (in my mxml compontent) were as fillows:
    dataField="Ingredient"
    dataField="Amount"
    dataField="Category"
    all done, and it works.

  • Changing background color in JTable, only changes one row at a time...

    I'm trying to change the color of rows when the 5th column meets certain criteria. I think I'm very close, but I've hit a wall.
    What's happening is the row will change color as intended when the text in the 5th column is "KEY WORD", but when I type "KEY WORD" in a different column it will set the first row back to the regular colors. I can easily see why it's doing this, everytime something is changed it rerenders every cell, and the listener only checks the cell that was just changed if it met the "KEY WORD" condition, so it sets every cell (including the previous row that still meets the condition) to the normal colors. I can't come up with a good approach to changing the color for ALL rows that meet the condition. Any help would be appreciated.
    In this part of the CellRenderer:
            if (isSelected)
                color = Color.red;
            else
                color = Color.blue;
            if (hasFocus)
                color = Color.yellow;
            //row that meets special conditions
            if(row == specRow && col == specCol)
                color = color.white; I was thinking an approach would be to set them to their current color except for the one that meets special conditions, but the two problems with that are I can't figure out how to getColor() from the table, and I'm not sure how I would initially set the colors.
    Here's the rest of the relevant code:
        public void tableChanged(TableModelEvent e)
            int firstRow = e.getFirstRow();
            int lastRow  = e.getLastRow();
            int colIndex = e.getColumn();
            if(colIndex == 4)
                String value = (String)centerTable.getValueAt(firstRow, colIndex);
                // check for our special selection criteria
                if(value.equals("KEY WORD"))
                    for(int j = 0; j < centerTable.getColumnCount(); j++)
                        CellRenderer renderer =
                            (CellRenderer)centerTable.getCellRenderer(firstRow, j);
                        renderer.setSpecialSelection(firstRow, j);
    import javax.swing.table.*;
    import javax.swing.*;
    import java.awt.Component;
    import java.awt.Color;
    public class CellRenderer extends DefaultTableCellRenderer
        int specRow, specCol;
        public CellRenderer()
            specRow = -1;
            specCol = -1;
        public Component getTableCellRendererComponent(JTable table,
                                                       Object value,
                                                       boolean isSelected,
                                                       boolean hasFocus,
                                                       int row, int col)
            setHorizontalAlignment(JLabel.CENTER);
            Color color = Color.green;
            if (isSelected)
                color = Color.red;
            else
                color = Color.blue;
            if (hasFocus)
                color = Color.yellow;
            if(row == specRow && col == specCol)
                color = color.white;
            //setForeground(color);
            setBackground(color);
            setText((String)value);
            return this;
        public void setSpecialSelection(int row, int col)
            specRow = row;
            specCol = col;
    }If I'm still stuck and more of my code is needed, I'll put together a smaller program that will isolate the problem tomorrow.

    That worked perfectly for what I was trying to do, but I've run into another problem. I'd like to change the row height when the conditions are met. What I discovered is that this creates an infinite loop since the resizing triggers the renderer, which resizes the row again, etc,. What would be the proper way to do this?
    Here's the modified code from the program given in the link. All I did was declare the table for the class, and modify the if so I could add the "table.setRowHeight(row, 30);" line.
    import java.awt.*;
    import javax.swing.*;
    import javax.swing.table.*;
    import javax.swing.border.*;
    public class TableRowRenderingTip extends JPanel
        JTable table;
        public TableRowRenderingTip()
            Object[] columnNames = {"Type", "Company", "Shares", "Price", "Boolean"};
            Object[][] data =
                {"Buy", "IBM", new Integer(1000), new Double(80.5), Boolean.TRUE},
                {"Sell", "Dell", new Integer(2000), new Double(6.25), Boolean.FALSE},
                {"Short Sell", "Apple", new Integer(3000), new Double(7.35), Boolean.TRUE},
                {"Buy", "MicroSoft", new Integer(4000), new Double(27.50), Boolean.FALSE},
                {"Short Sell", "Cisco", new Integer(5000), new Double(20), Boolean.TRUE}
            DefaultTableModel model = new DefaultTableModel(data, columnNames)
                public Class getColumnClass(int column)
                    return getValueAt(0, column).getClass();
            JTabbedPane tabbedPane = new JTabbedPane();
            tabbedPane.addTab("Alternating", createAlternating(model));
            tabbedPane.addTab("Border", createBorder(model));
            tabbedPane.addTab("Data", createData(model));
            add( tabbedPane );
        private JComponent createAlternating(DefaultTableModel model)
            JTable table = new JTable( model )
                public Component prepareRenderer(TableCellRenderer renderer, int row, int column)
                    Component c = super.prepareRenderer(renderer, row, column);
                    //  Alternate row color
                    if (!isRowSelected(row))
                        c.setBackground(row % 2 == 0 ? getBackground() : Color.LIGHT_GRAY);
                    return c;
            table.setPreferredScrollableViewportSize(table.getPreferredSize());
            table.changeSelection(0, 0, false, false);
            return new JScrollPane( table );
        private JComponent createBorder(DefaultTableModel model)
            JTable table = new JTable( model )
                private Border outside = new MatteBorder(1, 0, 1, 0, Color.RED);
                private Border inside = new EmptyBorder(0, 1, 0, 1);
                private Border highlight = new CompoundBorder(outside, inside);
                public Component prepareRenderer(TableCellRenderer renderer, int row, int column)
                    Component c = super.prepareRenderer(renderer, row, column);
                    JComponent jc = (JComponent)c;
                    // Add a border to the selected row
                    if (isRowSelected(row))
                        jc.setBorder( highlight );
                    return c;
            table.setPreferredScrollableViewportSize(table.getPreferredSize());
            table.changeSelection(0, 0, false, false);
            return new JScrollPane( table );
        public JComponent createData(DefaultTableModel model)
            table = new JTable( model )
                public Component prepareRenderer(TableCellRenderer renderer, int row, int column)
                    Component c = super.prepareRenderer(renderer, row, column);
                    //  Color row based on a cell value
                    if (!isRowSelected(row))
                        c.setBackground(getBackground());
                        String type = (String)getModel().getValueAt(row, 0);
                        if ("Buy".equals(type)) {
                            table.setRowHeight(row, 30);
                            c.setBackground(Color.GREEN);
                        if ("Sell".equals(type)) c.setBackground(Color.YELLOW);
                    return c;
            table.setPreferredScrollableViewportSize(table.getPreferredSize());
            table.changeSelection(0, 0, false, false);
            return new JScrollPane( table );
        public static void main(String[] args)
            SwingUtilities.invokeLater(new Runnable() {
                public void run() {
                    createAndShowGUI();
        public static void createAndShowGUI()
            JFrame.setDefaultLookAndFeelDecorated(true);
            JFrame frame = new JFrame("Table Row Rendering");
            frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
            frame.add( new TableRowRenderingTip() );
            frame.pack();
            frame.setLocationRelativeTo(null);
            frame.setVisible(true);
    }Edited by: scavok on Apr 26, 2010 6:43 PM

  • My table lists only up one row at a time. dynamic don't work

    Hi!
    I have a table that consists of: ID, NAME, LINK and
    CONTENTID.
    It's 5 records in it at the moment.
    I create a recordset.
    I choose all (ID, NAME, LINK and CONTENTID).
    It only shows up ONE row. I mark the table and choose
    repeating behavior. I still only get up one row.
    I follow this tutorial:
    http://www.adobe.com/support/dreamweaver/building/users_delete_rcrds_php/users_delete_rcrd s_php03.html
    I use Dreamweaver CS3.
    Any good advice, cause I haven't got a clue.
    I've tried everything: the embassy, the German government,
    the consulate. I even talked to the U.N. ambassador. It's no use, I
    just can't bring my wife to orgasm.
    Marw

    Can't get it to work. But I start off with this:
    1.
    http://img521.imageshack.us/my.php?image=01tablexk1.png
    After I follow your instructions, and mark
    name I get this:
    http://img514.imageshack.us/my.php?image=02trselectedzg6.png
    But still I only get one post and have to use a Recordset
    navigation bar instead.
    Marw

  • Deleting more than one row at a time

    Hey all,
    Im trying to be able to delete rows from my arraylist and UI table but im getting Index out of bounds exep.
    I think its because of the numbering, like counting through the i in the for loop is making it look at something different.
    Can anyone help?
    Thanks!
    selectedObjects = table.getSelectedRows();
                if (selectedObjects.length != 0)
                   for (int i = 0; i < selectedObjects.length; i++)
                        table.deleteRow(selectedObjects);
    rows.remove(selectedObjects[i]);

    I think its because of the numbering, like counting
    through the i in the for loop is making it look at
    something different.This is exactly correct.
    Personally I would look to see if those objects have a method named "clear" or "removeAll" or something like that, so you don't have to write that loop at all.
    But if you do have to write the loop, write a loop that continuously deletes the last entry until there aren't any more. This logic doesn't have the numbering problems that your code does.

  • How to insert a set of rows at a time from another table

    Hello!
    I have a table1 and table 2 - i want to insert a set of rows at a time from table1 to table 2. Then do a COMMIT. Then continue inserting another set of rows and so on.... say i want to insert into table 2 i million records at a time and then do a commit. then continue with the next 1 million and do a commit and so on..until there are no more records in table 1
    Any ideas please!!!!!!!!!!

    may be this will help
    declare
    cursor c1
    select * from table1
    i_counter binary_integer := 1;
    begin
    for c1_rec in c1
    insert into table2
    values(c1_rec.,..);
    if i_counter = 1000? then
    commit;
    i_counter = 1;
    end if;
    i_counter := i_counter+1;
    end loop
    end;

  • How to make Single row of an entire collumn of table control- Changeable

    Hi ,
        In Module Pool , in table control , I've all the rows in a specific column as "read only". However, with a specific "if statement" I want one row of that column as editable.
    For example ,
                       if  itab-name1 = 'PRITHVI'.
                    Make that row, editable.
                    Keep the rest of the column unaffected.
    I used the following code in my program in PBO:
    module STATUS_0005 output.
    Loop AT SCREEN .
      if screen-name = '%#AUTOTEXT009'
       AND I_MARKLIST-STUDENT_NAME1 = 'SUNIL SHARMA'.
        SCREEN-INPUT = '1'.
        MODIFY SCREEN.
        ENDIF.
        ENDLOOP.
    endmodule.
    I've tried this, but in vain .. ! Please give me suitable solutions ASAP.

    Hi,
    try like this..
    in the PBO of screen flow logic..
    loop at I_MARKLIST with control tc.
      MODULE CHANGE.
    endloop.
    IN THAT CHANGE MODULE WRITE...
    IF I_MARKLIST-STUDENT_NAME1 = 'SUNIL SHARMA'.
    LOOP AT SCREEN.
      IF SCREEN-NAME = '%#AUTOTEXT009'.
       SCREEN-INPUT = 1.
      ELSE.
       SCREEN-INPUT = 0.
       MODIFY SCREEN.
      ENDIF.
    ENDLOOP.
    ELSE.
    LOOP AT SCREEN.
      SCREE-INPUT = 0.
      MODIFY SCREEN.
    ENDLOOP.
    ENDIF.

  • Add more than one row at a time

    How do I add multiple rows in one step? I periodically d/l a small sheet of data and paste it into a master sheet. I have to add enough rows between the data and the summary row one at a time. Is there a quicker way?
    Geoff

    Geoff,
    Let's say that you want to add 5 rows. Select the 5 rows just above where you want to add 5 more and select Table > Add Rows Below. A number of rows equal to the number you have selected will be added.
    Jerry

  • Has anyone successfully implemented fetching more than one row at a time?

    I ask, since I'm having problems even with the simplest of scenarios. I went all the way back to the sample code given in the documentation (listed below) and it doesn't even work! I throws a data truncated exception on the employee number (even though the field is only 4 digits!) Help?
    int empno[5];
    char ename[5][11];
    ub2 enameLen[5];
    ResultSet *resultSet = stmt->executeQuery("select empno, ename from emp");
    resultSet->setDataBuffer(1, &empno, OCCIINT);
    resultSet->setDataBuffer(2, ename, OCCI_SQLT_STR, sizeof(ename[0]), enameLen);
    rs->next(5); // throws ORA-01406!

    pass the size of the number field too.
    resultSet->setDataBuffer(1, empno, OCCIINT, sizeof(empno[0]));
    ...

Maybe you are looking for

  • Apple loop not responding to tempo changes

    apple loops that have been created from an audio file in the arrange window do not respond to tempo changes. when i had logic 7 there would be a change in the audio file from an audio to an apple loop icon. this is not happening w/ logic 8 although i

  • Restrict deletion of sales order line items

    Hi, I need to restrict deleting of sales order line item, I think we can use the user exit, MV45AFZB, USEREXIT_CHECK_XVBAP_FOR_DELE. But when i set the flag to 'X', even though it does not delete at tht instance when the sales order save is clicked a

  • Running win 7 64 bit and itunes continues to stop working even after uninstalling repeatedly

    I have windows 7 64 bit on my PC.  Itunes continuously stops responding and closes whenever I open itunes.  Whether it is to play music, plug in my iphone or ipod shuffle.  I have uninstalled itunes too many times to count and reinstalled it.  Every

  • Data load fron flat file through data synchronization

    Hi, Can anyone please help me out with a problem. I am doing a data load in my planning application through a flat file and using data synhronization for it. How can i specify during my data synchronization mapping to add values from the load file th

  • How to unblock Sales orders(More than 1000 sales orders)

    Hi Gurus, We are facing the problem that because of weight issue-1000 sales orders are blocked.One authorised perso is ther to unblock it.But has all 1000 orders in his mail inbox. To un block all orders it will take much time. Is it there any T.Code