Insert rows in the middle

I'm trying to figure out how to insert rows in the middle
row 1
row 2
row 3
I need to insert 2 rows before row 2
I know I have to use the AddRow(1, Position) however after many tries, it doesn't seem to work or at least I don't know how to
insert the second row as if I do +1 it's not realy adequate, also, pVal.Row reports Row 2 and in the documentation it sais 0 based which is not right so I'm a bit confused on how to go about that.
Edited by: Marc Roussel on Aug 10, 2011 8:23 AM
Here's the whole thing, maybe you'll understand where I'm at :
I enter an ItemCode which is a kit.  After the person enter the quantity, I pop a .NET Windows form which asks for questions and then after the questions I get back and add the lines but it seems that when I add the lines, I'm still on the line I was entering the kit and it overrides it instead of Adding the new row at the position I'm asking it to add the row.
Even if I do pVal.Row +1 or +2 or +3, it doesn't matter
Edited by: Marc Roussel on Aug 10, 2011 8:28 AM

The code below adds the 2 lines all right but then, a blank line after and the line that was already there below is destroyed.  Don't ask me why and what is happening to that existing line which seems to have lost the ItemCode or I don't know what happened
CurrentLine = pVal.Row;
CurrentLine++;
oMatrix.AddRow(1, CurrentLine);
SAP.SetCellValue(oMatrix, SAPFramework.Enums.MARKETING_COLS.B1_ITEMCODE, CurrentLine, "01P38");
SAP.SetCellValue(oMatrix, "U_KitSeq", CurrentLine, NewKitSeq);
CurrentLine++;
oMatrix.AddRow(1, CurrentLine);
SAP.SetCellValue(oMatrix, SAPFramework.Enums.MARKETING_COLS.B1_ITEMCODE, CurrentLine, "03P12");
SAP.SetCellValue(oMatrix, "U_KitSeq", CurrentLine, NewKitSeq);
I did not know that doing a simple thing like this would be a hard business...
Edited by: Marc Roussel on Aug 10, 2011 9:15 AM

Similar Messages

  • How to insert row in the middle of a table so that the below content will move to another page?

    I'm making a huge form in LiveCycle Designer. I want to be able to add rows in the middle o the table but in a way that the content below will move down automatically in a way it doe's in Word for example.
    Sometimes I am adding a very high new row in the middle of a page and I want the content in the below rows to be moved to another page and if it is necessary I want a new page to be automatically created on the bottom of a document or something.
    Is this possible or do I have to move everything by hand if I add new row to a table?

    If you are adding the rows at the runtime by clicking a button, then you have to use the instance Manager to add rows.. It will add rows at the end and then you need to write code to move the row at the desired location by using the moveInstance method of the instanceManager.
    If you are adding a row at the design time, then you can right clcik the row and choose to add rows below.
    Thanks
    Srini

  • How to insert a new row in the middle of an set of rows

    Hi
    How to insert a new  row in the middle of an set of rows ? and How to Reset the line id after the new row added ?
    Regards,
    Sudhir B.

    Hai,
    just try this,
    Instead of using omatrix.Addrow(1,-1) use like
    omatrix.AddRow( RowCount , Position)
    RowCount
    The number of rows to add (default is 1)
    Position
    The position of the new rows (0-based; default is -1, meaning append row to the end)
    After adding rows in matrix For, sno.
    for i=1 to omatrix.visualrowcount
    otext=omatrix.getcellspecific("columnid",i)  '--where columnid is the unique id of the sno column
    otext.value=i
    next i
    Hope this helps you.
    Thanks & Regards,
    Parvatha Solai.N

  • How to add A single row at the middle of the table in a Webi report

    Hi,
         I created a Webi report using Universe(Created universe using bex query).Now i have a requirement to display a row at the middle of a report. Can you please tell me ,how to add a sigle row at the middle of a Webi report.
                                                    Thanks in advance
    Regards
    Monika

    Hi Monika,
    It is not really possible to add a row (I assume you mean of unrelated data) to the middle of a table in a report. You can add a new table with a single row between two tables. For instance you could add a new one row table, or even single cells which are positioned relatively between two tables. Possibly a block on top of another. But this gets tricky.
    Can you explain in more detail what you are trying to do?
    Thanks

  • How to insert text in the middle of an existing textfile using java

    Hi,
    How to insert text in the middle of an existing textfile using java i/o streams??

    Mickie wrote:
    I shudn't delete the file...Then you will have the old file and the new file - do you want that?
    and I have to insert text not only at a single place ....got to do at many places in the text file!!then extrapolate on the procedure outlined in reply #1 .

  • MAX(ROWID) and inserting rows at the end of the table

    Hi,
    I know this will be another lame question but I simply didn't find the answer anywhere. I create ID (primary key) for rows manually so I have this code:
    String query = "SELECT * FROM CIS_SEG_SKUPINY WHERE ROWID=(SELECT MAX(ROWID) FROM CIS_SEG_SKUPINY)";
    rset = stmt.executeQuery(query);
    if (!rset.next()) {
    <p style="padding-left:10px">newID = new Number(1);
    System.out.println(newID);</p>
    else {
    <p style="padding-left:10px">rset.beforeFirst();
    while (rset.next()) {
    <p style="padding-left:20px">int lastID = rset.getInt("ID");
    System.out.println(lastID);
    newID = new Number(lastID + 1);
    System.out.println(newID);
    }</p>
    }</p>
    css.setId(newID);
    Row globalsRow = getGlobals().first();
    css.setKodSegSkupiny((String)globalsRow.getAttribute("GroupCode"));
    css.setPopis((String)globalsRow.getAttribute("Description"));
    css.setBarva((Number)globalsRow.getAttribute("Colour"));
    getDBTransaction().commit();
    When the table is empty newID is set to 1 and row inserted. Now I have one row in the table (with ID=1) so newID is set to 2 and row inserted BUT it is inserted BEFORE the first row. So when I try to insert third row lastID is 1 not 2. I tried to find some command which would insert new row after the last one but unfortunately I wasn't successfull.
    Edited by: Herald on Mar 28, 2009 11:11 AM

    Herald,
    I am sorry to say that there are so many things wrong with your approach, that I don't know where to begin...
    1). ROWID is a pseudo column in Oracle.. It has no meaning of first, last, middle, or otherwise. SELECT MAX(ROWID) will get you some row.
    2). In a relational database, there is no concept of first or last row in a table. If you expect the rows in some order, use an order by.
    3). Ignoring your implementation and addressing your intent - you should not be creating a primary key by getting the max already in the table and adding one. You will, using your technique, get duplicates in a multi-user scenario. If you fix your implementation to not give duplicates in a multi-user scenario (no, I won't show you how), you will use a table lock, and therefor inhibit scalability in a serious way.
    The proper and commonly accepted way to generate a numeric primary key in Oracle would be to use a sequence and a trigger to populate the sequence. Lots of examples to be found in this forum, but just have a read of the ADF Developers Guide for Forms/4GL Developers (for 10g) or the Fusion Developers Guide (for 11g) to find one. The term to search for would be DBSequence.
    John

  • Unable to insert rows in the Web ADI document

    Hi,
    I am facing issue with Web ADI document while inserting the new rows. I have configured the Web ADI to update the SIT information of employees. I am able to download the data, modify the data and upload it successfully. However, when I try to add new rows in the document, it says 'Context values cannot be changed'.
    Could anyone help me out as to what needs to be done to add new rows to the sheet ?
    Regards
    Jhansi

    There are certain areas of the Web ADI template where information cannot be changed, particularly in the Context area. Trying to change values in this area will result in the error

  • Unable to insert rows into the table

    My insert statement below is not correct, when i try run, its encoutering error "table or view does not exist".
    Basically what i am doing here is collecting the table name in FOR variable which stores the table name in this variable. This variable, i am using as table. I know this is not the proper way, please let me how can insert the complete table rows with the following code.
    DROP TABLE TEMP;
    CREATE TABLE TEMP AS SELECT * FROM Comp WHERE 1=2;
    DECLARE
         I INTEGER DEFAULT 1;
    S VARCHAR2(50);
    begin
    for C in (select TABLE_NAME INTO S from USER_TABLES where TABLE_NAME like 'CABLE%' and TABLE_NAME NOT like '%OLD' and Num_ROWS > 0 order by TABLE_NAME) loop
    INSERT INTO TEMP SELECT * FROM c.TABLE_NAME;
    dbms_output.put_line(c.table_name);
    end loop;
    end;
    The above insert statement is not correct. How can i write proper way.
    Thanks.
    Best Regards
    Arshad

    user13360241 wrote:
    My insert statement below is not correct, when i try run, its encoutering error "table or view does not exist".
    Basically what i am doing here is collecting the table name in FOR variable which stores the table name in this variable. This variable, i am using as table. I know this is not the proper way, please let me how can insert the complete table rows with the following code.
    DROP TABLE TEMP;
    CREATE TABLE TEMP AS SELECT * FROM Comp WHERE 1=2;
    DECLARE
         I INTEGER DEFAULT 1;
    S VARCHAR2(50);
    begin
    for C in (select TABLE_NAME INTO S from USER_TABLES where TABLE_NAME like 'CABLE%' and TABLE_NAME NOT like '%OLD' and Num_ROWS > 0 order by TABLE_NAME) loop
    INSERT INTO TEMP SELECT * FROM c.TABLE_NAME;
    dbms_output.put_line(c.table_name);
    end loop;
    end;
    The above insert statement is not correct. How can i write proper way.
    Thanks.
    Best Regards
    ArshadSTMT := 'INSERT INTO TEMP SELECT * FROM ';
    STMT := STMT || S;
    EXECUTE IMMEDIATE STMT;

  • Insert rows in the ViewObject

    Hi forum,
    I'm implementing an application that imports data into a database.
    I insert 100.000 rows in a ViewObject and then I do a commit to the database after doing some operations in order to select which objects have to be imported.
    Is it possible to insert more then one row at the time,that is, something like a massive insertion?
    I'm asking this, because currently the application takes about 2 hours to perform the task.It's too long.
    Thank you

    Here's how I did it.
    1) Create the commit operation in your data binding. Bind to your AM.
    2) In your backing bean lookup the OperationBinding. (I used the ADFUtil.java from the StoreFrontModule example code for this.)
    OperationBinding commitOperation = ADFUtils.findOperation("Commit");
    3) Then just do:
    commitOperation.execute();
    Rodger...
    Edited by: rodger63 on Jan 5, 2010 1:24 PM
    Edited by: rodger63 on Jan 5, 2010 1:26 PM

  • InsertRow does not show the inserted row on the view

    hello:
    The code below works well and shows the row on the view when added. However, when there are several existing rows and I have to scroll to next pages. an insert button on that page does not show the new Row at all. Is there a way for me to see the row even if I scroll over to the last page and try an insert?
    ViewObject myVO = this.getMyView();
    Row newRow = myVO.createRow();
    newRow.setAttribute("Id", myId);
    myO.insertRow(newRow);
    Thanks

    Hi,
    I also have problems with code above for inserting a new row.
    When I insert a new row in a table and click on column header (to change sorting), that row (and any other new row before committing) disappears from table. And if I commit that table (without missing row), the missing row reappears with next refresh.
    Selection in that table (using SelectOne component with Autosubmit=true) also doesn't work with new rows (with existing rows it works fine). Selection allways sticks on first inserted row!
    Something weird is happening here...
    Please help.

  • ExcuteQuery does not return the newly inserted row in the database

    Jdeveloper Studio Edition Version 11.1.1.4.0
    I have a  use case where i insert a row in the database (without commit) and re-query the iterator to see the data in the jsf page. This was working file till we were using a directly the data control. Now our data control is inside a primary data control and it has stopped working. We don't see the inserted record in the page. Just to add that we are creating both the master and the detail record using the database procedure. Please helps us with a workaround or a solution and i have attached the code for reference.
        public void createSCAgr(ActionEvent actionEvent) {
              BindingContainer bindings = getBindings();
              OperationBinding operationBindingSC = bindings.getOperationBinding("createAgreement"); // this is calling a procedure to create record in the both master and detail table
              Object resultSC = operationBindingSC.execute();
              DCIteratorBinding iterator2 = ADFUtils.findIterator("PadForAgr1Iterator");
            iterator2.executeQuery();        // re-query the master record
              DCIteratorBinding iterator1 = ADFUtils.findIterator("FinForAgr1Iterator");
              iterator1.executeQuery();  // requery thedetail record
    best regards
    Sanjay Chatterji

    Hi Timo,
    Yes, I mean root application as the direct data control.
    This has been working earlier and the difficult part is that it is still working fine for two of the screens. The screen in which it works are those which does not have master detail relationship in them.
    We are using PL/SQL to create the new row as it involves using many database functions / packages  to populate the base data for the freshly created row. which we use to get to the screen for further changes and commit.
    We have been using this way for log time and it worked fine.
    Sanjay Chatterji
    Message was edited by: SChatterji

  • I am creating a template with drop down menus in Numbers. I want to be able to insert options into the middle of my list at a later date if I need to, but I can only insert at the end of the drop down list. Is there a different program I could be using?

    I need to be able to add in more options into my drop down list in Numbers at a later time, not only at the bottom but say in the middle of the list. Should I be using a different program that can allow this to work? Thank you!

    This forum thread appears to point towards the problem.
    Re: Unable to Switch Audio Sync Settings

  • How do I select a row from the middle of a recordset?

    UserID QuestionID Answered
    10 9 N
    10 8 N
    10 7 N
    10 6 N
    10 5 Y
    10 4 Y
    10 1 Y
    From the table sorted by QuestionID DESC, how do I select the first row from the bottom going up with Answered value equal to 'N'?
    Which in the example above would be:
    10 6 N
    I need to select this row and get the QuestionID value equal to 6.
    Right now I have:
    select QuestionID
    from tblMap
    where Answered = 'N'
    and ROWNUM = 1
    order by QuestionID ASC;
    This always the top most row, which would be:
    10 9 N

    Here i used DUAL to generate a list of numbers for me.
    ME_XE?select *
      2  from
      3  (
      4     select row_number() over (order by col1 desc) as rn, count(*) over() as cnt, col1
      5     from
      6     (
      7        select level as col1 from dual connect by level <= 9
      8     )
      9  )
    10  where ceil(cnt/2) = rn
    11  /
                    RN                CNT               COL1
                     5                  9                  5
    1 row selected.
    Elapsed: 00:00:00.07
    ME_XE?Edited by: Tubby on Jul 8, 2009 1:47 PM
    Seems i misread the question :)

  • Inserting row in the result set

    Hi
    need to insert a row in resultset when previous row typ=c and next row typ=p then need to insert one row in between typ c and p with typ =s see the #temp_result table for result expected
    --drop table temp1
    --drop table temp1_result
    --presently data:-
    create table temp1
    (id int,
    ord int,
    typ varchar(2),
    dt date)
    insert into temp1 values (101, 1, 'c', '2001-10-01')
    insert into temp1 values (101, 2, 'p', '2001-11-11')
    insert into temp1 values (102, 1, 'c', '2002-10-01')
    insert into temp1 values (102, 2, 'p', '2002-11-01')
    insert into temp1 values (102, 3, 'p', '2002-12-01')
    insert into temp1 values (103, 1, 'c', '2003-10-01')
    insert into temp1 values (103, 2, 'p', '2003-11-01')
    insert into temp1 values (104, 1, 'c', '2004-10-01')
    insert into temp1 values (104, 2, 'c', '2004-11-01')
    insert into temp1 values (104, 3, 'p', '2004-12-01')
    insert into temp1 values (105, 1, 'c', '2005-10-01')
    insert into temp1 values (105, 2, 'p', '2005-11-01')
    insert into temp1 values (105, 3, 'c', '2005-12-01')
    insert into temp1 values (106, 1, 'c', '2006-08-01')
    insert into temp1 values (106, 2, 'p', '2006-09-01')
    insert into temp1 values (106, 3, 'c', '2006-10-01')
    insert into temp1 values (106, 4, 'p', '2006-11-01')
    insert into temp1 values (106, 5, 'p', '2006-12-01')
    select * from temp1
    order by id, ord
    --result expected:-
    create table temp1_result
    (id int,
    ord int,
    typ varchar(2),
    dt date)
    insert into temp1_result values (101, 1, 'c', '2001-10-01')
    insert into temp1_result values (101, 2, 's', '')
    insert into temp1_result values (101, 3, 'p', '2001-11-11')
    insert into temp1_result values (102, 1, 'c', '2002-10-01')
    insert into temp1_result values (102, 2, 's', '')
    insert into temp1_result values (102, 3, 'p', '2002-11-01')
    insert into temp1_result values (102, 4, 'p', '2002-12-01')
    insert into temp1_result values (103, 1, 'c', '2003-10-01')
    insert into temp1_result values (103, 2, 's', '')
    insert into temp1_result values (103, 3, 'p', '2003-11-01')
    insert into temp1_result values (104, 1, 'c', '2004-10-01')
    insert into temp1_result values (104, 2, 'c', '2004-11-01')
    insert into temp1_result values (104, 3, 's', '')
    insert into temp1_result values (104, 4, 'p', '2004-12-01')
    insert into temp1_result values (105, 1, 'c', '2005-10-01')
    insert into temp1_result values (105, 2, 's', '')
    insert into temp1_result values (105, 3, 'p', '2005-11-01')
    insert into temp1_result values (105, 4, 'c', '2005-12-01')
    insert into temp1_result values (106, 1, 'c', '2006-08-01')
    insert into temp1_result values (106, 2, 's', '')
    insert into temp1_result values (106, 3, 'p', '2006-09-01')
    insert into temp1_result values (106, 4, 'c', '2006-10-01')
    insert into temp1_result values (106, 5, 's', '')
    insert into temp1_result values (106, 6, 'p', '2006-11-01')
    insert into temp1_result values (106, 7, 'p', '2006-12-01')
    select * from temp1_resultregards
    Edited by: @2**** on 31-Jan-2012 06:48

    Well, in an Oracle database, something like this...
    SQL> ed
    Wrote file afiedt.buf
      1  with temp as (select 101 as id, 1 as ord, 'c' as typ, date '2001-10-01' as dt from dual union all
      2                select 101, 2, 'p', date '2001-11-11' from dual union all
      3                select 102, 1, 'c', date '2002-10-01' from dual union all
      4                select 102, 2, 'p', date '2002-11-01' from dual union all
      5                select 102, 3, 'p', date '2002-12-01' from dual union all
      6                select 103, 1, 'c', date '2003-10-01' from dual union all
      7                select 103, 2, 'p', date '2003-11-01' from dual union all
      8                select 104, 1, 'c', date '2004-10-01' from dual union all
      9                select 104, 2, 'c', date '2004-11-01' from dual union all
    10                select 104, 3, 'p', date '2004-12-01' from dual union all
    11                select 105, 1, 'c', date '2005-10-01' from dual union all
    12                select 105, 2, 'p', date '2005-11-01' from dual union all
    13                select 105, 3, 'c', date '2005-12-01' from dual union all
    14                select 106, 1, 'c', date '2006-08-01' from dual union all
    15                select 106, 2, 'p', date '2006-09-01' from dual union all
    16                select 106, 3, 'c', date '2006-10-01' from dual union all
    17                select 106, 4, 'p', date '2006-11-01' from dual union all
    18                select 106, 5, 'p', date '2006-12-01' from dual)
    19  --
    20  -- end of test data
    21  --
    22  select id
    23        ,row_number() over (partition by id order by ord, typ) as ord
    24        ,typ
    25        ,dt
    26  from (
    27        select id
    28              ,ord
    29              ,case when rn = 2 and add_typ = 's' then add_typ else typ end as typ
    30              ,case when rn = 1 then dt else null end as dt
    31        from (
    32              select t.id, t.ord, t.typ, t.dt
    33                    ,case when typ = 'c' and lead(typ) over (partition by id order by ord) = 'p' then 's'
    34                     else null end as add_typ
    35              from   temp t
    36             ) x
    37             cross join (select rownum rn from dual connect by rownum <= 2)
    38        where not (rn = 2 and add_typ is null)
    39       )
    40* order by id, ord
    SQL> /
            ID        ORD T DT
           101          1 c 01-OCT-2001 00:00:00
           101          2 s
           101          3 p 11-NOV-2001 00:00:00
           102          1 c 01-OCT-2002 00:00:00
           102          2 s
           102          3 p 01-NOV-2002 00:00:00
           102          4 p 01-DEC-2002 00:00:00
           103          1 c 01-OCT-2003 00:00:00
           103          2 s
           103          3 p 01-NOV-2003 00:00:00
           104          1 c 01-OCT-2004 00:00:00
           104          2 c 01-NOV-2004 00:00:00
           104          3 s
           104          4 p 01-DEC-2004 00:00:00
           105          1 c 01-OCT-2005 00:00:00
           105          2 s
           105          3 p 01-NOV-2005 00:00:00
           105          4 c 01-DEC-2005 00:00:00
           106          1 c 01-AUG-2006 00:00:00
           106          2 s
           106          3 p 01-SEP-2006 00:00:00
           106          4 c 01-OCT-2006 00:00:00
           106          5 s
           106          6 p 01-NOV-2006 00:00:00
           106          7 p 01-DEC-2006 00:00:00
    25 rows selected.

  • Newly inserted row in the Essbase isnot displaying with page refresh in ADF

    Hi,
    I have a pivot table in my UI page and I have a option to create new Measure in Essbase.
    I am inserting new Measure in Essbase at runtime from Java Bean and refreshing the pivot table.
    The newly added Measure is not displaying after refreshing the pivot table but when I reopen the page the new measure is displaying.
    Could you please let me know how can I display the newly added Measure in ADF Pivot Table with refresh.
    Thanks,
    Swathi G

    Hi Timo,
    Yes, I mean root application as the direct data control.
    This has been working earlier and the difficult part is that it is still working fine for two of the screens. The screen in which it works are those which does not have master detail relationship in them.
    We are using PL/SQL to create the new row as it involves using many database functions / packages  to populate the base data for the freshly created row. which we use to get to the screen for further changes and commit.
    We have been using this way for log time and it worked fine.
    Sanjay Chatterji
    Message was edited by: SChatterji

Maybe you are looking for

  • Extra Channels - constant "You have lost connectio...

    The Extra Channels are now driving me and my Mrs (her more than me) mad. From getting a very rare and occasional "you have lost connection" message and frozen screen, I am now getting this error cropping up almost every 10 minutes. My setup (now) is:

  • How can I get my new mac mini to recognize my sharp vl-nz100 video cam?

    I've got the camera hooked to the firewire port and the camera is set to vcr. But still Imovie won't recognize the camera.

  • Next / Previous Setting

    Hi, I've assigned "Next/Previous Plug In Setting Or EXS Instrument" to the +/- keys of my computer kybd. This works fine for scrolling from patch to patch at first, but the moment I edit a patch (say, change the attack envelope of my ES-1) all of a s

  • Missing Pictures From TODAY on Photo Stream

    I read on posts the Photo Stream does not store pictures from more than 30 days. I took several pictures this morning and from all 600 pictures in my iphone 4 only 68 are shown on my Photo Stream. Does anybody knows why and how solving it? There is 

  • 7320 image question

    Hello Sir, My 7320 can't work normal now. The system image in our 7320 is rescue version. Do I need the real system image to upgrade the rescue one? What can I do now? Thank you very much! Regards, Sha