Adding new rows in tableview of BSP

Hi all,
   I am facing the very serious problem with using the tableview in bsp .The requirement is to add new rows to the tableview and update this content to internal table.The problem is when i enter some value in column and hit any button or triggered any event ,the value of column in table view gets cleared and i couldn't able to captur the value to internal table ...
can anyone please help me to  sort out this problem.

Hi Senthil,
I think this would provide solution to your problem.
the problem is whenever you edit the value in the tableview view the associated internal table of the table view has to be updated with the new values. for that you need to read the cell value from the table view.
as its a tableview, you should read the value from the exact cell whose value has been modified and update that value in the internal table. here is the psuedocode. hope it helps.
loop thru the selected rows of the table,
'selectedrowindextable'  this info you can get from
table_event TYPE REF TO cl_htmlb_event_tableview.
    LOOP AT selectedrowindextable ASSIGNING <i>.
itab is the table which actually stores that data
which you pass to the table view
      READ TABLE  itab INTO wa_itab INDEX <i>.
      i_rownum = <i>.
      CONDENSE i_rownum.
construct the id of the Cell whose value is to be read
for table view name, if u r showing it as a view in a
tray object prefix the table view name with tray object
id followed by '_'
to read column 'totalcost' in 5th row the cell name
would be 'trayid_tableviewid[5].totalcost
Alternative you can get this format from the
request->get_form_fields method also
   CONCATENATE 'tabviewname[' i_rownum '].colname' INTO req_cell.
   CONDENSE req_cell.
   l_value = request->get_form_field( req_cell ).
   CONDENSE l_value.
   wa_itab-colname = l_value.
   MODIFY itab FROM wa_itab INDEX <i>.
ENDLOOP.
Let me know if you have any questions.
thanks and Regards,
Kumar

Similar Messages

  • EDIT method doesn't work after adding new row

    I would like to start editing after adding new row into TableView.
    I copied example from Oracle website: [Using JavaFX UI Controls - 13 Table View|http://docs.oracle.com/javafx/2/ui_controls/table-view.htm#CJAGDAHE]. Then I put additional button for adding new row and define action for the button.
        final Button addButton = new Button("Add");
        addButton.setOnAction(new EventHandler<ActionEvent>() {
            @Override
            public void handle(ActionEvent arg0) {
                Person p = new Person("", "", "");
                table.getItems().add(p);               
                table.getSelectionModel().select(p);
                table.edit(table.getSelectionModel().getSelectedIndex(), table.getColumns().get(2));
        });In result I can see selected new row but the table doesn't start edditing in the third column.
    I have similar method for editing existing rows and it works properly.
        final Button editButton = new Button("Edit");
        editButton.setOnAction(new EventHandler<ActionEvent>() {
            @Override
            public void handle(ActionEvent arg0) {
                table.edit(table.getSelectionModel().getSelectedIndex(), table.getColumns().get(2));
        });Could you help me what I do wrong?

    Try wrapping the setCaretPosition(...) method in a SwingUtilities.invokeLater(...)
    caret=outputArea.getDocument().getText(0,outputArea.getDocument().getLength()).length();Should be:
    caret = outputArea.getDocument().getLength();

  • Can iOS Numbers copy formulas when adding new rows?

    iOS Numbers table add row is not copying previous cell formulas. Is this supported or not?
    I have a table with lots of columns and all of them have formulas. When I click at the lower left of the table to add a row, none of the new cells have the formulas. I have to manually go through every column and copy the formulas to the new row.
    This is not very practical if you're planning to use Numbers on the go with an iPad. In my case, I have to quickly get a new row ready as needed. I was hoping there is a preference setting somewhere like "copy formulas when adding new row".

    I had the same issue with the added twist that I wanted to reference the created cells in formulas in other sheets. This is what works for me:
    I use a form to enter data. The referenced sheet is set up like this:
    1     Name     Date     ServPayment    SalesPayment     Total
    2     Week1                                                                 =sum (ServPayment,SalesPayment)
    3                                                                                =sum (ServPayment,SalesPayment)
    4     TotWeek1                                                            =sum (Total2,Total3)
    "Total" sums the 2 Payments, TotWeek1 sums the totals.
    In the entry form I never add data to the empty line. In this example, I would start at "Week1" and tap the "+" to add a new form. This creates the line in the referenced sheet with my formulas. As I continue, I always start at the last entry I have made and tap "+".
    When I create a line that does not have the formula on either side, I do not get the formula.
    Hope this helps.

  • Null Pointer Exception When Adding New Row on Table

    Hello JheadStart Team
    I have used detail group with table layout , when I am clicking on AddRow button on detail table , I encounter NulllPointer Exception . I have traced the code and fount that in JhsCollectionModel when adding new row following
    condition occurs :
    DCIteratorBinding ib = getRangeBinding().getIteratorBinding();
    int rangeSize = ib.getRangeSize();
    int rowsInRange = ib.getAllRowsInRange().length;
    because getAllRowsInRange is Null then the error raise.
    My JheadStart ver is 10.1.3.3.85 .
    Detail Group with table layout setting is :
    Use Table range=true
    Show New Row at top=true
    New Rows:empty
    Show Add New Row Button :true
    Regards

    Given the build you are using, I assume you are an Oracle employee.
    Is this correct? if so, please post your question to the [email protected] mailing list.
    Steven Davelaar,
    JHeadstart team.

  • How to refresh the grid so that default  values come on adding new row.

    Hi Experts,
    In alv grid while adding new row, i want some 2-3 column values to come by default from already existing row in grid.
    i am getting new row in internal table with 2-3 default values and rest columns blank on adding new row in alv grid
    but the entire row is coming blank, not able to get the default values in new row
    how can i refresh the grid so that default  values come on adding new row.
    thanks

    Hi Surabhi,
    Use this in Interactive section even if you are doing simple ALV.
    DATA:
    lv_ref_grid TYPE REF TO cl_gui_alv_grid.
    CLEAR : gv_tcode.
    *-- to ensure that only new processed data is displayed
    IF lv_ref_grid IS INITIAL.
    CALL FUNCTION 'GET_GLOBALS_FROM_SLVC_FULLSCR'
    IMPORTING
    e_grid = lv_ref_grid.
    ENDIF.
    IF NOT lv_ref_grid IS INITIAL.
    CALL METHOD lv_ref_grid->check_changed_data.
    ENDIF.
    THis will solve your problem.
    Regards,
    Vijay

  • Adding new row to the reports list page

    How can I add a new report row in the reports list of the reports tab.
    Ex: a new row to the report "users by Date of Join report" is to be added
    How can we add Please help me out in this

    I am facing the same problem!
    camickr wrote:
    Try adding an empty row containing a null value for the String instead of the empty String.camickr, it will not help, the DefaultRowSorter in the "*+compare(int model1, int model2)+*" method return -1 if the first value is null and 1 if the sacond value is null. and incase of DESCENDING it mult by -1.
                    // Treat nulls as < then non-null
                    if (v1 == null) {
                        if (v2 == null) {
                            result = 0;
                        } else {
                            result = -1;
                    } else if (v2 == null) {
                        result = 1;
                    } else {
                        result = sortComparators[counter].compare(v1, v2);
                    if (sortOrder == SortOrder.DESCENDING) {
                        result *= -1;
                    }And this is the real problem!
    The empty line is sorted as the smallest value and incase of DESCENDING it will be the first line (because of the mult by -1).
    We could have overide it and incase of the empty row(usualy the last row) do not mult by -1 in DESCENDING mode.
    But the problem is that the "+*compare*+" method and it's caller "*+Row+*" inner class are private :-(
    It is not wise to do it but we can do like kmp83 wrote:
    kmp83  wrote:
    copy/duplicate "private" code from DefaultRowSorter into my extended class.Anyone have another suggestion?

  • Adding new row in matrix

    Dear all,
    I press right-click on Journal Entry and select "Cancel" function.
    SAP B1 creates a new journal entry with inverted rows registration.
    Now, I added a new button in this form.
    When I press the button, I need to add a new empty row in the matrix.
    I use this command:
    oJEMatrix.AddRow()
    I also used this command:
    oJEMatrix.AddRow(1, 1)
    but what I obtain is a new row with the same values of the first row (it seems a duplication of the first row).
    The new row-index (first left column) in the matrix has the value "1" as the first original row.
    How can I add a new empty row in this matrix and refresh the matrix to update the index of each row?
    Best regards
         Emanuele

    I found the error:
    I was trying to set Credit > 0 and Debit > 0 on the same row.
    But now I have a nother issue with matrix.
    See image below...
    After populating the matrix, the rows index are incorrect. How can refresh the matrix to recalculate the correct row number in the first column?
    Best regards
        Emanuele

  • Tabular form - adding new row

    Hi,
    I have a very simple table (5 rows, 1 of which is the primary key), and want to update the table using a tabular form. On initial display, the primary key column is protected (cannot be changed) which is ok for DELETE and UPDATE options, but when I come to ADD A NEW ROW, the new row has NULL defaulted as the primary key value, and will not let me update it !!
    Does anyone know how I can leave the primary key column protected when UPDATING or DELETING, but allow a value to be entered when ADDING A NEW ROW ?
    thanks
    Tim

    Andy,
    Just made the following changes (to remove NARR1_CODE_DISPLAY and show and edit NARR1_CODE):
    select
    "NARR1_CODE",
    --"NARR1_CODE" NARR1_CODE_DISPLAY,
    "NARR1_LOWER_LIMIT",
    "NARR1_UPPER_LIMIT",
    "NARR1_RMP_MIDPOINT_1",
    "NARR1_RMP_MIDPOINT_2"
    from "#OWNER#"."DQ_PD_TRANS_DIST_BAND_NARR1"
    where the column NARR1_CODE is my primary id, and in the report attributes, NARR1_CODE is now editable and shown as a "text field" . NARR1_CODE_DISPLAY has been removed.
    However, when I go into my form screen, although the NARR1_CODE field is now editable, when I click ADD NEW ROW, enter the details for a new row, check the box alongside the new row and click SUBMIT, I get the following error message :
    Error in mru internal routine: ORA-20001: Error in MRU: row= 1, ORA-20001: ORA-20001: Current version of data in database has changed since user initiated update process. current checksum = "A884FA378C851786DDFE3A33709CB23C", item checksum = "F6395FDACE39D98E784F85C19D960620"., update "GRD_DD10_OWNER"."DQ_PD_TRANS_DIST_BAND_NARR1" set "NARR1_CODE" = :b1, "NARR1_LOWER_LIMIT" = :b2, "NARR1_UPPER_LIMIT" = :b3, "NARR1_RMP_MIDPOINT_1" = :b4, "NARR1_RMP_MIDPOINT_2" = :b5
    sorry about this !
    thanks

  • Adding/removing rows in TABLEVIEW

    Hi. I've got a TABLEVIEW in one of my subscreens. But when load itab into that tableview with 'LOOP AT...'  tableview appears but I can't add rows to it. I can't delete existing rows too. What should I add to my programm to have possibility of adding/removing rows from my tablewiev? Greetings. P.

    Hi Friend,
    To add/delete rows in your table view.
    You have to add/delete rows from internal table fro where you are displaying values.
    You have to write code in PAI..
    In LOOP ... ENDLOOP check the OK_CODE if it is ADD (for eg.) you have to add a blank row to internal table by just passing a blank work area.
    And if it is DELETE (for eg.) delete the row of that index (TABLEVIEW-CURRENT_LINE)...
    for these two excersies you have to readjust lines of tableview...after taking number of lines from internal table (DESCRIBE TABLE INT_EX LINES WS_LINES
    TABLEVIEW-LINES = WS_LINES) write this piece of code in Intialization.
    Hope it will solve the problem.
    Regards
    Krishnendu

  • Adding new row at top of tabular form In APEX 4.0

    I havea tabular form and when addrow() it is adding at bottom of the existing rows. Is there a way I can add new row at the top of the rows?
    Thanks.
    Edited by: Badari on Oct 19, 2011 12:07 PM

    Hi Raj,
    I'm trying to implement your solution to add the empty row of a tabular report to the top of the page but I can't get it to work. I've identified two errors in your code, namely
    1) semi-colon after mytable.moveRow(mytable.rows.length-2,1) is missing
    2) You say to use "ABC_REPORT" as the region id but you use "report_ABC_REPORT" in the code.
    I've fixed these but still I cannot get it to work.
    Could you check the code again and see if there are any other errors that we may have missed.
    thanks in advance
    PaulP
    <script language="JavaScript" type="text/javascript">
    function addTop()
      addRow();
      var mytable=document.getElementById("report_ABC_REPORT");
      mytable.moveRow(mytable.rows.length-2,1) // depending on the report template selected use either length-2 or length-1
    </script>

  • Adding new rows at run time in alv oops

    HI ALL,
    I have a created an editable alv report in oops. Now i have to add a new row having similar values as the previous row at run time when a custom button is clicked in the output and after entering some values in the new row and pressing the database must be updated and also the internal table at run time itself.
    for example let us suppose i have the following row in the alv output.
    MATNR                          DESCRIPTION                             NAME                             DATE
    001                                 TEST                                        MATRIKS                      10092001
    NOW if we click the custom button added on the alv toolbar, it should a new row at the run time similar to previous row as shown below
    MATNR                          DESCRIPTION                             NAME                             DATE
    001                                 TEST                                        MATRIKS                      10092001
    001                                 TEST                                        MATRIKS                      10092001 -> NEW ROW.
    can we do it in alv oops? pls let me know the soln or any helpful links
    thanks
    john

    Hi John,
       I dont think, you can find any method for that,
    one way what I can suggest is
    Get the selected row index.
    Insert the blank row in your internal table at this index
    Refresh the container.
    Hope  this will help.
    Thanks,
    Anmol.

  • Adding new rows to table - using TableRowSorter & RowFilter

    Hi all,
    I have a table where the user can add new rows by selecting a JButton. I have added a text box which allows the user to search for a String value and this filters the table contents and this is all working fine...But when I go to add a new row I get the following exception:
    java.lang.IndexOutOfBoundsException: Invalid range which seems to originate from DefaultRowSorter.rowsInsertedCould someone please give me any ideas to why this is happening, maybe the number of rows that are in the table orginally is set to x and when I add a new row the TableRowSorter is expecting that number not x + 1 which is added due to the button being pressed?
    Seems like I need to update the TableRowSorter to inform it that a new row has been added or something similar to that,
    Thanks,

    If you need further help then you need to create a [Short, Self Contained, Compilable and Executable, Example Program (SSCCE)|http://homepage1.nifty.com/algafield/sscce.html], that demonstrates the incorrect behaviour.
    Don't forget to use the Code Formatting Tags so the posted code retains its original formatting. That is done by selecting the code and then clicking on the "Code" button above the question input area.

  • Adding new row in a table

    hi experts ,
    i am working on a table and on an action of button i need to add a row. The table has a lots of elements like input fields, dropdown by key, textviews etc. i have created a new row by incresing visible row count on action but the above mentioned elements are not editable . The cardinality of the node bound to table is 1..n and selection is 1....n.
    Please suggest me a proper solution.
    Thank you.

    Hi,
    Try this code,
    IPrivatePopUpMenuView.IProductsElement ele=wdContext.createProductsElement();
                   ele.setProductId(str1);
              ele.setQuantity(str2);
              ele.setPrice(str3);
              ele.setName(str4);     
              ele.setDetails("Detailed discription for  "+str4);
              wdContext.nodeProducts().addElement(ele);
    Here str1 str2 are all the value which unwant to add to table.
    Regards,
    H.V.Swathi

  • JTable - adding new row

    Hi
    Can someone help me. I have a JTable with a ADD button. When I select the ADD button, I want to be able to bring up a dialog to enter the data for the new row and then click OK on this dialog.
    Does anyone have simple code that does this?
    Regards

    Sorry. Don't know anything about databases.
    But if you know how to do it normally (in the Frame's code) then you just do the same thing in the dialog. You just need to pass the appropriate objects to the dialog so that it can manipulate them.
    Optionally, you could get an Object[ ] from the dialog and have the Frame's code add the row (probably better design).

  • Dynamically adding new rows and columns

    i want to have a button on my jsp page which shud add new rows dynamically. and same one for columns.
    how do i calculate the values across the rows on the forms
    I'm new to JSP. Please point me in the right direction...any tutorials or code will be helpful.
    thanks

    Well its a good question actually and the most needed one.
    Say 4 example u need a screen which should accepts the employee details in one screen
    and the user should be able to enter all the employee details in one screen and he should
    have a flexibility to change the previous details too.
    So 4 that u need to know 2 things:
    1) Using of JspBeans
    2) Using Vector
    I will give u a brief idea:
    So the bean is just a container been which has the methods say
    setEmployeeName(.....)
    getEmployeeName()
    So the basic logic is, the naming of html form elements and displaying multiple rows of elements.
    Say 4 eg, empname -> <input type=text name=empname<%= count%> value=<%= ....%>>
    So u should run the loop the size of ur vector times and every time u add a vector u should save all
    the data using same logic in ur vector and thatz it once u commit get all the values from the vector.
    Try this u will definitely get it,
    all da best,
    kiran
    kiran

Maybe you are looking for

  • Can I save .pages speech as an audio file?

    I have a .pages document and when I select all words and select speech, the document is read out to me. I find this a useful revision technique, is there anyway I can save the speech as an audio file so I can listen to my revision notes 'on the go'?

  • What is an iso image and how do i get it

    I just completed downloading the windows support software but still dont know where do i get the windows 8 iso image

  • Sol 10 x86 not recognizing hard disk

    Hi, I am trying to install Sol 10 x86 V 6/06 on a HP DL585. I am installing from a CD. When it is time to install the software , I get an error, found no disks . These are 72Gb disks. The hardware is supported under hcl. Are there any extra drivers I

  • Wireless connection to IPad 1

    I am unable to connect to the internet.  Was working fine but now keeps cutting out even though internet signal is strong.  I have tried rebooting, turning wifi off and on, forgeting network and resetting it.  All work for about 2 minutes and then it

  • How to download movies if Itunes is not available in Malaysia

    i have a problem downloading movies in my IPOD touch...