Inserting Rows in an Editable Table

Application Focus: JSF with ADF/BC.
watching Steve Muench´s Screencast on "Creating an Editable Table with a Dropdown List in Each Row" i was inspired to add a functionality to add rows.
Lets say i have an Employee and Departments table. If i want to add three new employees in the employee editable table - that wont work - it seems that adding rows aint that simple, cause it seems not possible to commit more than one row at a time
what i did according to forum posts and how-to´s:
1. dropped "insert" from data control palette
2. altered binding to from create to "CreateInsert"
works ok, but if i press the button twice (3x, 4x) the new rows are shown, but if i commit them, only one is in the database?
Any tips on that would be appreciated.

I'm trying to a similar thing, create an input screen that allows you to add muliple rows at the same time some rows having a drop down list. I've read the following How to which lets me edit multiple rows but if I add a create button or a CreateInsert button it doesnt seem to give me rows to create.
How To Create Multi Row Edit Forms in a JSP Page with Oracle JDeveloper 10g
http://www.oracle.com/technology/products/jdev/tips/mills/JSP_Multi_Row_Edits.html

Similar Messages

  • Programming insert row VO,but inner-table no data show?

    We have Master-Detail-Detail ViewObject,when programming insert row three ViewObject,why inner-table UI no data show?
    [Source Code ZIP files|http://docs.google.com/leaf?id=0B1l5uiKPTIr_ZTQwYTQ1MTMtZWFlMS00YWQ1LWFiZWQtYzNmODIwNDRlZWJk&hl=zh_TW]
    1.SmpTest0PG.xml click button.
    2.SmpTest0CO.java call MyTestAMImpl.java create Method insert row three ViewObject.
    public void processFormRequest(OAPageContext pageContext, OAWebBean webBean)
    super.processFormRequest(pageContext, webBean);
    OAApplicationModule am = pageContext.getApplicationModule(webBean);
    if (pageContext.getParameter("Test") != null)
    String key = "1";
    Serializable aserializable1[] = { key };
    String quote_id = (String)am.invokeMethod("create", aserializable1);
    if (!quote_id.equals(null))
    pageContext.setForwardURL("OA.jsp?page=/smp/oracle/apps/pos/test/webui/SmpTestPG&Key="+key,
    null,
    OAWebBeanConstants.KEEP_MENU_CONTEXT,
    null,
    null,
    true, // Retain AM
    OAWebBeanConstants.ADD_BREAD_CRUMB_YES,
    OAWebBeanConstants.IGNORE_MESSAGES);
    3.SmpTest0CO.java Forward SmpTestPG.xml.
    4.SmpTestPG.xml Show Data.
    MyTestAMImpl.java
    public String create(String key)
    int vendor_id = 0;
    String vendor_name = null;
    int contact_id = 0;
    int site_id = 0;
    String quote_id = null;
    OADBTransaction trx = (OADBTransaction)((OAApplicationModuleImpl)this).getDBTransaction();
    SmpPoHdVOImpl hdvo = getSmpPoHdVO();
    SmpPoDlVOImpl dlvo = getSmpPoDlVO();
    SmpPoDkVOImpl shvo = getSmpPoDkVO();
    if (!hdvo.isPreparedForExecution())
    hdvo.setWhereClause("1 = 0");
    hdvo.setMaxFetchSize(0);
    hdvo.executeQuery();
    if (!dlvo.isPreparedForExecution())
    dlvo.setWhereClause("1 = 0");
    dlvo.setMaxFetchSize(0);
    dlvo.executeQuery();
    if (!shvo.isPreparedForExecution())
    shvo.setWhereClause("1 = 0");
    shvo.setMaxFetchSize(0);
    shvo.executeQuery();
    String s = key;
    Serializable aserializable[] = { s };
    SmpViewPoHdVOImpl quhdvo = getSmpViewPoHdVO();
    if(quhdvo != null)
    quhdvo.invokeMethod("initQuery", aserializable);
    SmpViewPoDlVOImpl qudlvo = getSmpViewPoDlVO();
    // insert hd
    quhdvo.setRangeSize(-1);
    Row quhdrow[] = quhdvo.getAllRowsInRange();
    for(int i = 0; quhdrow != null && i < quhdrow.length; i++)
    Row hdrow = hdvo.createRow();
    hdrow.setAttribute("DocNum","200");
    hdvo.insertRow(hdrow);
    hdrow.setNewRowState(Row.STATUS_NEW);
    quote_id = hdrow.getAttribute("HEADER_ID").toString();
    // insert dl
    RowIterator dlIter = (RowIterator)quhdrow.getAttribute("SmpViewPoDlVO");
    dlIter.setRangeSize(-1);
    Row qudlrow[] = dlIter.getAllRowsInRange();
    int line_seq = 0;
    for(int j = 0; qudlrow != null && j < qudlrow.length; j++)
    Row dlrow = dlvo.createRow();
    line_seq ++;
    dlrow.setAttribute("LineNum",String.valueOf(line_seq));
    dlrow.setAttribute("ItemNo",qudlrow[j].getAttribute("ItemNo"));
    dlrow.setAttribute("Qty",qudlrow[j].getAttribute("Qty"));
    dlvo.insertRow(dlrow);
    dlrow.setNewRowState(Row.STATUS_NEW);
    // insert shipment
    RowIterator shipIter = (RowIterator)qudlrow[j].getAttribute("SmpViewPoDkVO");
    shipIter.setRangeSize(-1);
    Row shipRow[] = shipIter.getAllRowsInRange();
    int ship_seq = 0;
    for(int k = 0; shipRow != null && k < shipRow.length; k++)
    ship_seq ++;
    Row shrow = shvo.createRow();
    shrow.setAttribute("ShipmentNum",String.valueOf(ship_seq));
    shrow.setAttribute("Qty",shipRow[k].getAttribute("Qty"));
    shvo.insertRow(shrow);
    shrow.setNewRowState(Row.STATUS_NEW);
    return quote_id;
    Edited by: Tony_Huang on Apr 10, 2010 3:59 PM

    public class SmpTestCO extends OAControllerImpl
    public void processRequest(OAPageContext pageContext, OAWebBean webBean)
    super.processRequest(pageContext, webBean);
    OATableBean oatablebean = (OATableBean)webBean.findChildRecursive("SmpPoDlVORN");
    OATableBean oatablebean1 = (OATableBean)webBean.findChildRecursive("SmpPoDkVORN");
    if (oatablebean != null)
    oatablebean.setAttributeValue(UIConstants.ALL_DETAILS_ENABLED_ATTR, ((Object) (Boolean.TRUE)));
    oatablebean.setAttributeValue(OAWebBeanConstants.VIEW_LINK_NAME, "SmpPoDlDkVL1");
    if (oatablebean1 != null)
    oatablebean1.setAttributeValue(OAWebBeanConstants.VIEW_LINK_NAME, "SmpPoDlDkVL1");
    oatablebean1.setInsertable(true);
    oatablebean1.setAutoInsertion(true);
    }

  • Compare 2 tables and insert rows missing in each table.

    I have a tough situation. I have two exact tables- one online and one offline database. I know that there are missing rows of data from each table, so I need to make a comparison of one table and insert rows that do not exist. I was thinking to try this, but it took over 3 hours to run and did not return anything:
    insert into t
    select * from t a
    where not exists (select * from [email protected] b
    where a.col1 != b.col1
    and a.col2 != b.col2
    and a.col3 != b.col3);
    and it goes on for another 7columns.
    The trouble I have is to include a date clause so that the query can be broken down into running only a few months of data comparisions at a time- the records go back 4 years to compare. Also is there a way to write this so that it will query both tables at the same time in order to speed things up- or is one table at a time the best advice? Each table has over 100 million records to compare, that's why I was hoping to use a date criteria since one column is date.
    Let me know what you advise to make this work, I hope I was on the right track.

    Not sure if the MINUS operator will perform better with your data set but;
    SQL> create table t1 (some_id number, some_date date)
    Table created.
    SQL> create table t2 (some_id number, some_date date)
    Table created.
    SQL> insert into t1 values (1, trunc(sysdate))
    1 row created.
    SQL> insert into t1 values (2, trunc(sysdate-5))
    1 row created.
    SQL> insert into t1 values (4, trunc(sysdate-90))
    1 row created.
    SQL> insert into t2 values (1, trunc(sysdate))
    1 row created.
    SQL> insert into t2 values (3, trunc(sysdate-10))
    1 row created.
    SQL> insert into t2 values (5, trunc(sysdate-100))
    1 row created.
    SQL> select * from t1
       SOME_ID SOME_DAT
             1 07-07-30
             2 07-07-25
             4 07-05-01
    3 rows selected.
    SQL> select * from t2
       SOME_ID SOME_DAT
             1 07-07-30
             3 07-07-20
             5 07-04-21
    3 rows selected.
    SQL> insert into t1 (
       select some_id, some_date from t2 where some_date between sysdate-50 and sysdate
       minus
       select some_id, some_date from t1 where some_date between sysdate-50 and sysdate)
    1 row created.
    SQL> insert into t2 (
       select some_id, some_date from t1 where some_date between sysdate-50 and sysdate
       minus
       select some_id, some_date from t2 where some_date between sysdate-50 and sysdate)
    1 row created.
    SQL> select * from t1
       SOME_ID SOME_DAT
             1 07-07-30
             2 07-07-25
             4 07-05-01
             3 07-07-20
    4 rows selected.
    SQL> select * from t2
       SOME_ID SOME_DAT
             1 07-07-30
             3 07-07-20
             5 07-04-21
             2 07-07-25
    4 rows selected.

  • Inserting rows in a database table using JDBC

    Hi,
    I am trying to insert a row in a table using the follwing code:
    String Query_String = "Insert into Table_Name (Field_1, Field_2, Field_3)" +
    "Values (Value_1, Value_2, Value_3)";
    stmt.executeUpdate (Query_String);
    Field_1 is a Date field, Field_2 is a String, and Field_3 is an integer.
    Any of the fields could be null. If the user does not enter a value for any
    one of these fields what would be the values for
    Value_1, Value_2, or Value3 in the Query_String?
    Thanks.

    Hi,
    I am trying to insert a row in a table using the
    follwing code:
    String Query_String = "Insert into Table_Name
    (Field_1, Field_2, Field_3)" +
    "Values (Value_1,
    "Values (Value_1, Value_2, Value_3)";
    stmt.executeUpdate (Query_String);
    Field_1 is a Date field, Field_2 is a String, and
    Field_3 is an integer.
    Any of the fields could be null. If the user does not
    enter a value for any
    one of these fields what would be the values for
    Value_1, Value_2, or Value3 in the Query_String?
    Thanks.Keep in mind that each database server probably has their own way of storing date values. For now, I'm going to assume that you're going to be using MySQL.
    // Initialize variables to null
    String Value_1 = "";
    String Value_2 = "";
    String Value_3 = "";
    try
    // Get Date
    Date date = new Date();
    SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd");
    Value_1 = dateFormat.format(date);
    // Get String value
    Value_2 = "some string";
    // Get Integer value
    Value_3 = String.valueOf("2");
    String query = INSERT INTO T_NAME VALUES('" + Value_1 +"', '" + Value_2 + "', '" + Value_3 + "');
    int iUpdated = stmt.executeUpdate(query);
    catch(Exception e)
    // Catch Code
    System.out.println("Number of records updated: " + iUpdated);
    This will just enter empty string values if the strings are empty.
    Is this what you wanted to know?
    If not, provide a bit more information and I'll try to help as best as I can

  • Inserting rows in PL/SQl table

    Hi,
    I have a PL/SQl table which i populated through bulk collect and now i am trying to loop through the table (actually quite a few nested loops) ... Now inside one of my loops i might need to insert a new row by splitting field in the existing row in the table. Can I insert the row in the pl/sql table within the loop without affecting the 'FOR i IN tab.first..tab.last' loop ??
    Also what would be the index of such a row inserted in the table. Can I access it with tab.last+1 (doesnt look like it can be done if i insert in the various levels of loops).
    OR
    If I insert the rows insde the nested loops , then I can access the new rows once I close all the loops and open a fresh loop ??. Will the new rows be at the last of the table.
    Any help will be appreciated ...

    user2309906 wrote:
    Hi,
    I have a PL/SQl table which i populated through bulk collect and now i am trying to loop through the table (actually quite a few nested loops) ... Now inside one of my loops i might need to insert a new row by splitting field in the existing row in the table. Can I insert the row in the pl/sql table within the loop without affecting the 'FOR i IN tab.first..tab.last' loop ??
    Also what would be the index of such a row inserted in the table. Can I access it with tab.last+1 (doesnt look like it can be done if i insert in the various levels of loops).
    OR
    If I insert the rows insde the nested loops , then I can access the new rows once I close all the loops and open a fresh loop ??. Will the new rows be at the last of the table.
    Any help will be appreciated ...With an associative array:
    SQL> ed
    Wrote file afiedt.buf
      1  declare
      2    type t_arr is table of varchar2(10) index by pls_integer;
      3    v_arr t_arr;
      4    v_cnt number := 0;
      5  begin
      6    -- populate the associative array
      7    for i in (select ename from emp)
      8    loop
      9      v_cnt := v_cnt + 1;
    10      dbms_output.put_line('Populating: '||i.ename);
    11      v_arr(v_cnt) := i.ename;
    12    end loop;
    13    -- now process the associative array
    14    for i in v_arr.first .. v_arr.last
    15    loop
    16      dbms_output.put_line('Processing: '||i||':'||v_arr(i));
    17      if v_arr(i) IN ('KING','TURNER','JAMES') then
    18        v_arr(v_arr.last+1) := v_arr(i)||to_char(i);
    19        dbms_output.put_line('Added: '||v_arr.last||':'||v_arr(i));
    20      end if;
    21    end loop;
    22    -- now what's in the associative array?
    23    for i in v_arr.first .. v_arr.last
    24    loop
    25      dbms_output.put_line('Result: '||i||':'||v_arr(i));
    26    end loop;
    27* end;
    SQL> /
    Populating: SMITH
    Populating: ALLEN
    Populating: WARD
    Populating: JONES
    Populating: MARTIN
    Populating: BLAKE
    Populating: CLARK
    Populating: SCOTT
    Populating: KING
    Populating: TURNER
    Populating: ADAMS
    Populating: JAMES
    Populating: FORD
    Populating: MILLER
    Processing: 1:SMITH
    Processing: 2:ALLEN
    Processing: 3:WARD
    Processing: 4:JONES
    Processing: 5:MARTIN
    Processing: 6:BLAKE
    Processing: 7:CLARK
    Processing: 8:SCOTT
    Processing: 9:KING
    Added: 15:KING
    Processing: 10:TURNER
    Added: 16:TURNER
    Processing: 11:ADAMS
    Processing: 12:JAMES
    Added: 17:JAMES
    Processing: 13:FORD
    Processing: 14:MILLER
    Processing: 15:KING9
    Processing: 16:TURNER10
    Processing: 17:JAMES12
    Result: 1:SMITH
    Result: 2:ALLEN
    Result: 3:WARD
    Result: 4:JONES
    Result: 5:MARTIN
    Result: 6:BLAKE
    Result: 7:CLARK
    Result: 8:SCOTT
    Result: 9:KING
    Result: 10:TURNER
    Result: 11:ADAMS
    Result: 12:JAMES
    Result: 13:FORD
    Result: 14:MILLER
    Result: 15:KING9
    Result: 16:TURNER10
    Result: 17:JAMES12
    PL/SQL procedure successfully completed.With standard array (PL/SQL table):
    SQL> ed
    Wrote file afiedt.buf
      1  declare
      2    type t_arr is table of varchar2(10);
      3    v_arr t_arr;
      4    v_cnt number := 0;
      5  begin
      6    -- populate the pl/sql table
      7    select ename bulk collect into v_arr from emp;
      8    -- now process the pl/sql table
      9    for i in v_arr.first .. v_arr.last
    10    loop
    11      dbms_output.put_line('Processing: '||i||':'||v_arr(i));
    12      if v_arr(i) = 'KING' then
    13        v_arr.extend;
    14        v_arr(v_arr.last) := 'PRESIDENT';
    15      end if;
    16    end loop;
    17    -- now what's in the pl/sql table?
    18    for i in v_arr.first .. v_arr.last
    19    loop
    20      dbms_output.put_line('Result: '||i||':'||v_arr(i));
    21    end loop;
    22* end;
    SQL> /
    Processing: 1:SMITH
    Processing: 2:ALLEN
    Processing: 3:WARD
    Processing: 4:JONES
    Processing: 5:MARTIN
    Processing: 6:BLAKE
    Processing: 7:CLARK
    Processing: 8:SCOTT
    Processing: 9:KING
    Processing: 10:TURNER
    Processing: 11:ADAMS
    Processing: 12:JAMES
    Processing: 13:FORD
    Processing: 14:MILLER
    Processing: 15:PRESIDENT
    Result: 1:SMITH
    Result: 2:ALLEN
    Result: 3:WARD
    Result: 4:JONES
    Result: 5:MARTIN
    Result: 6:BLAKE
    Result: 7:CLARK
    Result: 8:SCOTT
    Result: 9:KING
    Result: 10:TURNER
    Result: 11:ADAMS
    Result: 12:JAMES
    Result: 13:FORD
    Result: 14:MILLER
    Result: 15:PRESIDENT
    PL/SQL procedure successfully completed.
    SQL>So, in answer to your questions...
    Inserting additional rows in the array during the loop will effect the "last" value and alter the array. If you need to avoid this effect, store the "last" value in a variable and loop up to that value of the variable.
    New rows will generally be additional rows on the end of the array unless you are using associative arrays which will then depend on how you reference the rows in the array.

  • Loop Cursor Fetch Insert Rows Into Global Temporay Table

    Hi friends,
    I want to know there where is the problem in my this query
    cursor c1 is select empno
    from scott.emp;
    b number;
    begin
    open c1;
         loop
         fetch c1 into b;
         exit when c1%notfound;
    insert into scheema.a1
    (a)
    values
    (b);
    commit;
         end loop;
         close c1;
    end;
    There is no any error displaying while proceeding this query but the table a1 which is (Global temporary table with ON COMMIT PRESERVE ROWS option enabled) does not gets any records. Kindly let me know the problem.
    Regards.

    Are you sure that the query returns date? Are you checking the table via the same session?
    SQL> create global temporary table a1 (
      a  number)
      on commit preserve rows
    Table created.
    SQL> declare
       cursor c1 is select empno
          from scott.emp;
       b number;
    begin
       open c1;
       loop
          fetch c1 into b;
          exit when c1%notfound;
          insert into a1
          (a)
          values
          (b);
          commit;
       end loop;
       close c1;
    end;
    PL/SQL procedure successfully completed.
    SQL> select * from a1
             A
          7369
          7499
          7521
          7566
          7654
          7698
          7782
          7788
          7839
          7844
          7876
          7900
          7902
          7934
    14 rows selected.

  • Insert row wherever within a table?

    Can it be done? Looking to add and delete rows wherever needed within a table. Currently, it only allows me to add or remove either the very first row or the very last; not those in-between. My users constantly request the ability to insert where needed (like word and excel) and I'm stumped on how to work it out.

    1. Cell options
    2. Cell options!
    You probably have too much space inside the top and bottom edges of each cell. Select the entire table and select Cell Options (from the Table menu or from your friendly right click pop-up menu). A relatively safe value for Top and Bottom distance is 1 mm.
    You can see the grid lines either because you have Show Frame Edges on (they should be thin and blue), or, more likely, because the ID import doesn't honor the Excel settings and puts the lines there by itself. If your lines are blue and thin, don't worry; they're just there to help you. Select Preview mode and they will disappear (just as text frame edges, guidelines, etc.). If the lines are black and thick, select the entire table and use the Cell options to switch them off. Just select either 0 pt thickness or a [None] line color.

  • Timeout when inserting row in a locked table

    How can I set the timeout before an INSERT statement fails with error ORA-02049 (timeout: distributed transaction waiting for lock) when the entire table has been lock with LOCK TABLE .
    Documentation says to modify DISTRIBUTED_LOCK_TIMEOUT parameter, but it is obsolete in Oracle 8i.
    Any idea ???

    You could set an alarm() in a signal. Then on return (for whatever reason) you clear the alarm, inspect the return code of the sql execute call and determine what happened (i.e. did the transaction completed or did the alarm get you).
    Hope it helps.
    -Lou
    [email protected]
    How can I set the timeout before an INSERT statement fails with error ORA-02049 (timeout: distributed transaction waiting for lock) when the entire table has been lock with LOCK TABLE .
    Documentation says to modify DISTRIBUTED_LOCK_TIMEOUT parameter, but it is obsolete in Oracle 8i.
    Any idea ???

  • ADF Editable Table : CANNOT Insert Multi Rows , Please hellppppssss

    Hi All,
    Our customer requirement is being able to insert Multi Rows in an Editable Table and submit ALL of them with just one Click ?
    Is it Really Possible ?
    I have tried, even I can insert three Empty Rows and Fill them all with values, when I press Submit ONLY one row will be submitted, the other TWO will become BLANK again, is this my code is wrong ?
    Or this is limitation of ADF Editable Table ?
    Here is my codes, I have tried two ways, all same problem :
    (1) public String create_action() {
    BindingContainer bindings = getBindings();
    OperationBinding operationBinding =
    bindings.getOperationBinding("Create");
    Object result = operationBinding.execute();
    if (!operationBinding.getErrors().isEmpty()) {
    return null;
    return null;
    public String myCreate_action() {
    create_action();
    create_action();
    create_action();
    return null;
    (2) public String createMultiRows() {
    DCBindingContainer dcbc = (DCBindingContainer)getBindings();
    //get iterator binding
    DCIteratorBinding ib = (DCIteratorBinding)dcbc.get("DeptView1Iterator");
    // get viewobject
    ViewObject vo = ib.getViewObject();
    System.out.println(vo.getCurrentRowIndex());
    vo.clearCache();
    int currentRowIndex = vo.getRowCount() -1;
    Row row1 = vo.createRow();
    row1.setNewRowState(Row.STATUS_NEW);
    vo.insertRowAtRangeIndex(++currentRowIndex, row1);
    Row row2 = vo.createRow();
    row2.setNewRowState(Row.STATUS_NEW);
    vo.insertRow(row2);
    Row row3 = vo.createRow();
    row3.setNewRowState(Row.STATUS_NEW);
    vo.insertRow(row3);
    return null;
    Please help... I am stuck ...
    Thank you very much,
    xtanto

    Xtanto,
    Could you try changing
    bindings.getOperationBinding("Create");to
    bindings.getOperationBinding("CreateInsert");in your first example to see if it fixes your problem?
    Regards,
    John

  • On a web page with an editable table, the delete row function no longer works (the little circle with X button)

    When you try to delete a row in an editable table using the built-in functions, it no longer works. We use this function regularly and just noticed this problem today. The "create row above" and "create row below" functions work, just not the delete. The delete column button does work however, so it's a bit baffling why this one function does not work. (The pages are located on our internal server so are not publicly accessible but the functionality is built into firefox.)

    Same problem here. I found out that when you have a table with only 1 row, it works fine, but when you have multiple rows, it doesn't work on any row.
    Micmark, do you have that too?
    P.S. I also tried this outside our CMS, by using Firebug to add a contenteditable="true" on a DIV in a normal font-end template, and that has the same problem.

  • Insert row enhancement

    Idea
    A useful feature I would like to suggest would be to allow the creation of multiple blank rows from the 'insert row' button in a table tab.
    Possible Solution
    A good solution would be to add a prompt next to the button in order to specify the number of blank rows you wish to create. It should default to one to keep the current behavior intact but would allow the user to specify how many rows to insert.
    Issues with Current Behavior
    Currently you need to click 'insert new row' 50 times to paste 50 rows (from excel for example). If you click it 30 times and paste 50 rows, it will insert the first 30, then overwrite the first 20 existing values. Plus clicking the insert button for each row you want to insert isn't that productive.
    Other Comments
    I'm sure that many have experienced this delemma and has issues with the consistency of the current excel import tool. This solution would prove to be an easy alternative to importing with a tool and will prove to be a simple way to really improve the usability and much more importantly the ease of this product.
    Feedback
    If you have had a situation where this would have been nifty feel free to reply with thoughts.
    Oracle
    Do you believe this would be possible from a development standpoint and what sort of feedback can you provide on the probability of an enhancement like this.

    Just in case you haven't tried the following :
    When in last cell of the last row, you can hit Tab key and that would create a new row and the focus would be in the first cell of the newly created row.
    So you don't need to hit the insert row button. Btw, you can also set an accelerator for "Insert Row" using Preferences->Accelerators.
    So, probably your feature request could be to - automatically create appropriate # of rows and insert data into those when you paste the data copied from excel into the grid. That should save you a few clicks and eliminate the need of having a textfield to set the # of rows.
    -Raghu

  • How to Display a message after inserting row in table............

    Hi
    I want to display a message after inserting rows in table like *'you have inserted a new row successfully*'.
    i am using the createinsert ADF Button to insert the rows in table.after that i am comitting it.
    after commiting i want to display message for the user.for this what i need to do.
    Please help me.
    Sailaja.

    user10860137
    Can you please explain me the each line in the code briefly.
    +public String saveButton_action(){+
    BindingContainer bindings = getBindings();
    OperationBinding operationBinding = bindings.getOperationBinding("Commit");
    Object result = operationBinding.execute();
    +// note "!" operator has been removed from the default code.+
    +if(operationBinding.getErrors().isEmpty()){+
    FacesContext ctx = FacesContext.getCurrentInstance();
    FacesMessage saveMsg = new FacesMessage("Record Saved Successfully");
    ctx.addMessage(null,saveMsg);
    +}+
    return null;
    +}+
    And i have requirement to show the message on favcet "status bar".not in a popup window.(from the above code the message is showing in popup window. )the Layout i am using is PanelCollection.
    can you tell me what i need to do.
    Thanks
    Sailaja.
    Edited by: sj0609 on Mar 19, 2009 8:03 AM

  • Error while inserting rows in a table

    Hi,
    We have recently migrated from 9i to 10g. We have a scheduled job out our DB which first deletes all the rows from a table and then inserts them back by selecting rows from 5 tables. This table has a composite primary key based on 6 columns in it. In 9i, when i try to insert rows into the table after deleting all the rows from it, I am able to insert the data successfully . However, in 10g, when i try doing the same operation, it fails with the ORA error:
    ORA-00001: unique constraint violated
    The same query which works perfectly in 9i fails in 10g
    If anybody has some ideas on how to resolve the same, kindly let me know.
    Thanks in advance.

    Hi,
    I was finally able to resolve the reason behind that error message and found it even more weird. The error was because I was using the substr function for extracting the characters 1-4 from a column which is 5 characters long. When i specify the query as:
    select substr(column1, 1, 4)) from table1;
    only the characters 1-3 are retrieved. Now if i change the query to select substr(column1, 1, 5)) from table1, in that case also only 3 characters are retrieved although i have specified the substr to start from 1 and read till 5 characters. Also, when i run the query:
    select length(substr(column1, 1, 4)) from table1 or select length(substr(column1, 1, 5)) from table1
    I get the answer as 3.
    However, the most amazing part is that the query is working perfectly in 9i and is retrieving the data correctly i.e. from substr 1-4.
    Can anyone suggest what the problem could be?
    Thanks
    Edited by: CrazyAnie on May 13, 2009 1:34 AM

  • How to insert a row in the detail table of a treeTable (master/detail)?

    Is there any small, working example with JDev 11.1.2.1 on how to programmatically insert a row in the detail table represented by the treeTable component?
    Please don't send links to this example http://jobinesh.blogspot.com/2010/05/crud-operations-on-tree-table.html , which does not work.
    Thanks.

    Erp, why do you keep giving the links to that example or the zip including the project of that example? I explicitly asked to not send any links to that example, which does not work with jdev 11.1.2.1.
    This is the exception from that one when trying to create a new record on the details:
    <UIXEditableValue> <_isBeanValidationAvailable> A Bean Validation provider is not present, therefore bean validation is disabled
    :bndVarFirstName =null
    :bndVarFirstName =null
    :bndVarFirstName =null
    :bndVarFirstName =null
    :bndVarFirstName =null
    :bndVarFirstName =null
    :bndVarFirstName =null
    :bndVarFirstName =null
    :bndVarFirstName =null
    :bndVarFirstName =null
    :bndVarFirstName =null
    :bndVarFirstName =null
    :bndVarFirstName =null
    :bndVarFirstName =null
    :bndVarFirstName =null
    :bndVarFirstName =null
    :bndVarFirstName =null
    :bndVarFirstName =null
    :bndVarFirstName =null
    :bndVarFirstName =null
    :bndVarFirstName =null
    :bndVarFirstName =null
    :bndVarFirstName =null
    :bndVarFirstName =null
    :bndVarFirstName =null
    <FormRenderer> <_warnUnpoppedContextChanges> ADF_FACES-60095:Durante l'elaborazione del renderer del form, la modifica di contesto trovata non corrisponde al componente previsto.
    <UIXCollection> <processSaveState> è possibile che la chiave di riga non venga reimpostata correttamente alla fine della richiesta. ID componente: :pc1:tt1, ViewId: /treeSample.jspx
    <UIXComponentBase> <processSaveState> Salvataggio dello stato per gli elementi figlio del componente RichPanelCollection[UIXFacesBeanImpl, id=pc1] non riuscito.
    <UIXComponentBase> <processSaveState> Salvataggio dello stato per gli elementi figlio del componente RichPanelGroupLayout[UIXFacesBeanImpl, id=pgl1] non riuscito.
    <UIXComponentBase> <processSaveState> Salvataggio dello stato per gli elementi figlio del componente RichForm[UIXFacesBeanImpl, id=f1] non riuscito.
    <UIXComponentBase> <processSaveState> Salvataggio dello stato per gli elementi figlio del componente RichDocument[UIXFacesBeanImpl, id=d1] non riuscito.
    <LifecycleImpl> <_handleException> ADF_FACES-60098:Il ciclo di vita Faces ha ricevuto eccezioni non gestite nella fase RENDER_RESPONSE 6
    java.lang.NullPointerException
         at oracle.jbo.uicli.binding.JUCtrlHierNodeBinding.findChildNode(JUCtrlHierNodeBinding.java:867)
         at oracle.jbo.uicli.binding.JUCtrlHierBinding.bringNodeToRangeKeyPath(JUCtrlHierBinding.java:788)
         at oracle.adfinternal.view.faces.model.binding.FacesCtrlHierBinding.bringNodeToRangeKeyPath(FacesCtrlHierBinding.java:111)
         at oracle.adfinternal.view.faces.model.binding.RowDataManager.setRowKey(RowDataManager.java:130)
         at oracle.adfinternal.view.faces.model.binding.FacesCtrlHierBinding$FacesModel.setRowKey(FacesCtrlHierBinding.java:830)
         at org.apache.myfaces.trinidad.component.UIXCollection.setRowKey(UIXCollection.java:513)
         at org.apache.myfaces.trinidad.component.UIXCollection.processSaveState(UIXCollection.java:270)
         at org.apache.myfaces.trinidad.component.TreeState.saveState(TreeState.java:175)
         at org.apache.myfaces.trinidad.component.UIXComponentBase.processSaveState(UIXComponentBase.java:1043)
         at org.apache.myfaces.trinidad.component.TreeState.saveState(TreeState.java:175)
         at org.apache.myfaces.trinidad.component.UIXComponentBase.processSaveState(UIXComponentBase.java:1043)
         at org.apache.myfaces.trinidad.component.TreeState.saveState(TreeState.java:175)
         at org.apache.myfaces.trinidad.component.UIXComponentBase.processSaveState(UIXComponentBase.java:1043)
         at org.apache.myfaces.trinidad.component.TreeState.saveState(TreeState.java:175)
         at org.apache.myfaces.trinidad.component.UIXComponentBase.processSaveState(UIXComponentBase.java:1043)
         at javax.faces.component.UIComponentBase.processSaveState(UIComponentBase.java:1156)
         at org.apache.myfaces.trinidadinternal.application.StateManagerImpl.saveView(StateManagerImpl.java:193)
         at org.apache.myfaces.trinidadinternal.application.StateManagerImpl.getViewState(StateManagerImpl.java:134)
         at oracle.adfinternal.view.faces.renderkit.rich.PprResponseWriter._writeViewState(PprResponseWriter.java:514)
         at oracle.adfinternal.view.faces.renderkit.rich.PprResponseWriter.endDocument(PprResponseWriter.java:83)
         at oracle.adfinternal.view.faces.renderkit.rich.DocumentRenderer.encodeAll(DocumentRenderer.java:1490)
         at oracle.adf.view.rich.render.RichRenderer.encodeAll(RichRenderer.java:1452)
         at org.apache.myfaces.trinidad.render.CoreRenderer.encodeEnd(CoreRenderer.java:511)
         at org.apache.myfaces.trinidad.component.UIXComponentBase.encodeEnd(UIXComponentBase.java:923)
         at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1659)
         at oracle.adfinternal.view.faces.context.PartialViewContextImpl._processRender(PartialViewContextImpl.java:321)
         at oracle.adfinternal.view.faces.context.PartialViewContextImpl.processPartial(PartialViewContextImpl.java:152)
         at javax.faces.component.UIViewRoot.encodeChildren(UIViewRoot.java:974)
         at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1652)
         at oracle.adfinternal.view.faces.component.AdfViewRoot.encodeAll(AdfViewRoot.java:91)
         at com.sun.faces.application.view.JspViewHandlingStrategy.doRenderView(JspViewHandlingStrategy.java:431)
         at com.sun.faces.application.view.JspViewHandlingStrategy.renderView(JspViewHandlingStrategy.java:233)
         at org.apache.myfaces.trinidadinternal.application.ViewDeclarationLanguageFactoryImpl$ChangeApplyingVDLWrapper.renderView(ViewDeclarationLanguageFactoryImpl.java:350)
         at com.sun.faces.application.view.MultiViewHandler.renderView(MultiViewHandler.java:131)
         at javax.faces.application.ViewHandlerWrapper.renderView(ViewHandlerWrapper.java:273)
         at org.apache.myfaces.trinidadinternal.application.ViewHandlerImpl.renderView(ViewHandlerImpl.java:165)
         at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl._renderResponse(LifecycleImpl.java:1027)
         at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl._executePhase(LifecycleImpl.java:334)
         at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:232)
         at javax.faces.webapp.FacesServlet.service(FacesServlet.java:313)
         at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:227)
         at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:125)
         at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:300)
         at weblogic.servlet.internal.TailFilter.doFilter(TailFilter.java:26)
         at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
         at oracle.adf.model.servlet.ADFBindingFilter.doFilter(ADFBindingFilter.java:173)
         at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
         at oracle.adfinternal.view.faces.webapp.rich.RegistrationFilter.doFilter(RegistrationFilter.java:122)
         at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl$FilterListChain.doFilter(TrinidadFilterImpl.java:468)
         at oracle.adfinternal.view.faces.activedata.AdsFilter.doFilter(AdsFilter.java:60)
         at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl$FilterListChain.doFilter(TrinidadFilterImpl.java:468)
         at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl._doFilterImpl(TrinidadFilterImpl.java:293)
         at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl.doFilter(TrinidadFilterImpl.java:199)
         at org.apache.myfaces.trinidad.webapp.TrinidadFilter.doFilter(TrinidadFilter.java:92)
         at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
         at oracle.security.jps.ee.http.JpsAbsFilter$1.run(JpsAbsFilter.java:111)
         at java.security.AccessController.doPrivileged(Native Method)
         at oracle.security.jps.util.JpsSubject.doAsPrivileged(JpsSubject.java:313)
         at oracle.security.jps.ee.util.JpsPlatformUtil.runJaasMode(JpsPlatformUtil.java:413)
         at oracle.security.jps.ee.http.JpsAbsFilter.runJaasMode(JpsAbsFilter.java:94)
         at oracle.security.jps.ee.http.JpsAbsFilter.doFilter(JpsAbsFilter.java:161)
         at oracle.security.jps.ee.http.JpsFilter.doFilter(JpsFilter.java:71)
         at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
         at oracle.dms.servlet.DMSServletFilter.doFilter(DMSServletFilter.java:136)
         at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
         at weblogic.servlet.internal.RequestEventsFilter.doFilter(RequestEventsFilter.java:27)
         at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
         at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.wrapRun(WebAppServletContext.java:3715)
         at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3681)
         at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
         at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:120)
         at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2277)
         at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:2183)
         at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1454)
         at weblogic.work.ExecuteThread.execute(ExecuteThread.java:209)
         at weblogic.work.ExecuteThread.run(ExecuteThread.java:178)
    <RegistrationConfigurator> <handleError> ADF_FACES-60096:Eccezione server durante PPR, n. 1
    java.lang.NullPointerException
         at oracle.jbo.uicli.binding.JUCtrlHierNodeBinding.findChildNode(JUCtrlHierNodeBinding.java:867)
         at oracle.jbo.uicli.binding.JUCtrlHierBinding.bringNodeToRangeKeyPath(JUCtrlHierBinding.java:788)
         at oracle.adfinternal.view.faces.model.binding.FacesCtrlHierBinding.bringNodeToRangeKeyPath(FacesCtrlHierBinding.java:111)
         at oracle.adfinternal.view.faces.model.binding.RowDataManager.setRowKey(RowDataManager.java:130)
         at oracle.adfinternal.view.faces.model.binding.FacesCtrlHierBinding$FacesModel.setRowKey(FacesCtrlHierBinding.java:830)
         at org.apache.myfaces.trinidad.component.UIXCollection.setRowKey(UIXCollection.java:513)
         at org.apache.myfaces.trinidad.component.UIXCollection.processSaveState(UIXCollection.java:270)
         at org.apache.myfaces.trinidad.component.TreeState.saveState(TreeState.java:175)
         at org.apache.myfaces.trinidad.component.UIXComponentBase.processSaveState(UIXComponentBase.java:1043)
         at org.apache.myfaces.trinidad.component.TreeState.saveState(TreeState.java:175)
         at org.apache.myfaces.trinidad.component.UIXComponentBase.processSaveState(UIXComponentBase.java:1043)
         at org.apache.myfaces.trinidad.component.TreeState.saveState(TreeState.java:175)
         at org.apache.myfaces.trinidad.component.UIXComponentBase.processSaveState(UIXComponentBase.java:1043)
         at org.apache.myfaces.trinidad.component.TreeState.saveState(TreeState.java:175)
         at org.apache.myfaces.trinidad.component.UIXComponentBase.processSaveState(UIXComponentBase.java:1043)
         at javax.faces.component.UIComponentBase.processSaveState(UIComponentBase.java:1156)
         at org.apache.myfaces.trinidadinternal.application.StateManagerImpl.saveView(StateManagerImpl.java:193)
         at org.apache.myfaces.trinidadinternal.application.StateManagerImpl.getViewState(StateManagerImpl.java:134)
         at oracle.adfinternal.view.faces.renderkit.rich.PprResponseWriter._writeViewState(PprResponseWriter.java:514)
         at oracle.adfinternal.view.faces.renderkit.rich.PprResponseWriter.endDocument(PprResponseWriter.java:83)
         at oracle.adfinternal.view.faces.renderkit.rich.DocumentRenderer.encodeAll(DocumentRenderer.java:1490)
         at oracle.adf.view.rich.render.RichRenderer.encodeAll(RichRenderer.java:1452)
         at org.apache.myfaces.trinidad.render.CoreRenderer.encodeEnd(CoreRenderer.java:511)
         at org.apache.myfaces.trinidad.component.UIXComponentBase.encodeEnd(UIXComponentBase.java:923)
         at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1659)
         at oracle.adfinternal.view.faces.context.PartialViewContextImpl._processRender(PartialViewContextImpl.java:321)
         at oracle.adfinternal.view.faces.context.PartialViewContextImpl.processPartial(PartialViewContextImpl.java:152)
         at javax.faces.component.UIViewRoot.encodeChildren(UIViewRoot.java:974)
         at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1652)
         at oracle.adfinternal.view.faces.component.AdfViewRoot.encodeAll(AdfViewRoot.java:91)
         at com.sun.faces.application.view.JspViewHandlingStrategy.doRenderView(JspViewHandlingStrategy.java:431)
         at com.sun.faces.application.view.JspViewHandlingStrategy.renderView(JspViewHandlingStrategy.java:233)
         at org.apache.myfaces.trinidadinternal.application.ViewDeclarationLanguageFactoryImpl$ChangeApplyingVDLWrapper.renderView(ViewDeclarationLanguageFactoryImpl.java:350)
         at com.sun.faces.application.view.MultiViewHandler.renderView(MultiViewHandler.java:131)
         at javax.faces.application.ViewHandlerWrapper.renderView(ViewHandlerWrapper.java:273)
         at org.apache.myfaces.trinidadinternal.application.ViewHandlerImpl.renderView(ViewHandlerImpl.java:165)
         at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl._renderResponse(LifecycleImpl.java:1027)
         at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl._executePhase(LifecycleImpl.java:334)
         at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:232)
         at javax.faces.webapp.FacesServlet.service(FacesServlet.java:313)
         at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:227)
         at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:125)
         at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:300)
         at weblogic.servlet.internal.TailFilter.doFilter(TailFilter.java:26)
         at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
         at oracle.adf.model.servlet.ADFBindingFilter.doFilter(ADFBindingFilter.java:173)
         at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
         at oracle.adfinternal.view.faces.webapp.rich.RegistrationFilter.doFilter(RegistrationFilter.java:122)
         at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl$FilterListChain.doFilter(TrinidadFilterImpl.java:468)
         at oracle.adfinternal.view.faces.activedata.AdsFilter.doFilter(AdsFilter.java:60)
         at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl$FilterListChain.doFilter(TrinidadFilterImpl.java:468)
         at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl._doFilterImpl(TrinidadFilterImpl.java:293)
         at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl.doFilter(TrinidadFilterImpl.java:199)
         at org.apache.myfaces.trinidad.webapp.TrinidadFilter.doFilter(TrinidadFilter.java:92)
         at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
         at oracle.security.jps.ee.http.JpsAbsFilter$1.run(JpsAbsFilter.java:111)
         at java.security.AccessController.doPrivileged(Native Method)
         at oracle.security.jps.util.JpsSubject.doAsPrivileged(JpsSubject.java:313)
         at oracle.security.jps.ee.util.JpsPlatformUtil.runJaasMode(JpsPlatformUtil.java:413)
         at oracle.security.jps.ee.http.JpsAbsFilter.runJaasMode(JpsAbsFilter.java:94)
         at oracle.security.jps.ee.http.JpsAbsFilter.doFilter(JpsAbsFilter.java:161)
         at oracle.security.jps.ee.http.JpsFilter.doFilter(JpsFilter.java:71)
         at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
         at oracle.dms.servlet.DMSServletFilter.doFilter(DMSServletFilter.java:136)
         at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
         at weblogic.servlet.internal.RequestEventsFilter.doFilter(RequestEventsFilter.java:27)
         at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
         at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.wrapRun(WebAppServletContext.java:3715)
         at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3681)
         at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
         at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:120)
         at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2277)
         at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:2183)
         at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1454)
         at weblogic.work.ExecuteThread.execute(ExecuteThread.java:209)
         at weblogic.work.ExecuteThread.run(ExecuteThread.java:178)
    while I get this from my own project based on the above one:
    <UIXEditableValue> <_isBeanValidationAvailable> A Bean Validation provider is not present, therefore bean validation is disabled
    <UIXRegion> <_logIllegalContextChangeMessage> ADF_FACES-10026:Durante l'elaborazione del componente area, non è stata trovata una modifica di contesto oppure la modifica trovata non corrisponde all'istanza impostata dal componente corrente. Prevista oracle.adf.view.rich.component.fragment.UIXRegion$RegionContextChange, trovata UIXCollection.CollectionComponentChange[Component class: oracle.adf.view.rich.component.rich.data.RichTreeTable, component ID: tt1].
    <UIXRegion$RegionSiteImpl> <validate> Attempt to validate an already invalid RegionSite:
    <UIXCollection> <processSaveState> è possibile che la chiave di riga non venga reimpostata correttamente alla fine della richiesta. ID componente: :pt1:r1:pt1:pc1:tt1, ViewId: /main.jspx
    Edited by: user10047839 on 20-ott-2011 7.23

  • Runtime error when inserting rows in hrp1018 and hrt1018 tables

    Hi All,
    I have a requirement to insert row in hrp1018 and hrt1018 tables.These tables are interlinked.So, I have used FM 'RH_INSERT_INFTY'. The exact code which I have used is as follows.
    *****************************************code***************************************************************
    << Please post only the relevant portion of the code >>
    The runtime error which is coming is as follows:
    Error analysis
        An internal error in the database interface occurred during access to
        the data of table "HRT1018 ".
        The situation points to an internal error in the SAP software
        or to an incorrect status of the respective work process.
        For further analysis the SAP system log should be examined
        (transaction SM21).
        For a precise analysis of the error, you should supply
        documents with as many details as possible.
    Please let me know why this error is coming.I am not able to find out mistake in the FM and form used in the code.
    Thanks in advance,
    BBKrishna.
    Edited by: Rob Burbank on Jun 9, 2009 1:31 PM

    I am adding the code once again.Please let me know why the error is coming up.
    lv_mproj = 'BLDNG'.
      wa_p1018-mandt = sy-mandt.
      wa_p1018-otype = '9M'.
      wa_p1018-objid = '50009650'.
      wa_p1018-begda = '20090608'.
      wa_p1018-endda = '99991231'.
      wa_p1018-infty = '1018'.
      wa_p1018-plvar = '01'.
      wa_p1018-otype = '9M'.
      wa_p1018-istat = '1'.
      append wa_p1018 to it_p1018.
      repid = sy-repid.
    *Updating hrp1018 and hrt1018 tables
      CALL FUNCTION 'RH_INSERT_INFTY'
        EXPORTING
        FCODE                     = 'INSE'
        VTASK                     = 'D'
         AUTHY                    = ' '
          REPID                   =  repid
          FORM                    = 'FILL_TABS'
        TABLES
          INNNN                   = it_p1018
    EXCEPTIONS
       NO_AUTHORIZATION          = 1
       ERROR_DURING_INSERT       = 2
       REPID_FORM_INITIAL        = 3
       CORR_EXIT                 = 4
       BEGDA_GREATER_ENDDA       = 5
       OTHERS                    = 6
      IF SY-SUBRC <> 0.
        CALL FUNCTION 'BALW_BAPIRETURN_GET'
          EXPORTING
            TYPE                             = SY-MSGTY
            CL                               = sy-msgid
            NUMBER                           = SY-MSGNO
      PAR1                             = ' '
      PAR2                             = ' '
      PAR3                             = ' '
      PAR4                             = ' '
      LOG_NO                           = ' '
      LOG_MSG_NO                       = ' '
         IMPORTING
           BAPIRETURN                        = return_rec
    EXCEPTIONS
      ONLY_2_CHAR_FOR_MESSAGE_ID       = 1
      OTHERS                           = 2
        IF SY-SUBRC <> 0.
            lv_mproj = text-011
                      ELSE.
                      ii_return = return_rec.
                      CONCATENATE                  ii_return-type '-' ii_return-message
                      INTO lv_err_msg SEPARATED BY SPACE.
        ENDIF.
      ENDIF.
    *RHCD_TAB-PROZT
       FORM fill_tabs TABLES ins_tab
                   USING ins_set ins_index.
      DATA : BEGIN OF set.
              INCLUDE STRUCTURE wplog.
      DATA : END   OF set.
      DATA: BEGIN OF h_pt1018.             "to initialize INS_TAB
              INCLUDE STRUCTURE pt1018.
      DATA: END OF h_pt1018.
      REFRESH ins_tab.
      set = ins_set.
      CASE set-infty.
        WHEN '1018'.
          h_pt1018-posnr = lv_mproj.
          h_pt1018-prozt = '100.00'.
          IF NOT ( h_pt1018 IS INITIAL ).
            CLEAR ins_tab.
            ins_tab+36(8) = lv_mproj. "h_pt1018.
            ins_tab+134(5) = '100.00'.
            APPEND ins_tab.
          ENDIF.
      ENDCASE.
    ENDFORM.

Maybe you are looking for