How to update multiple records in a table created in view (web dynpro)

Here is my coding......
*coding to get the district value
DATA lo_nd_district TYPE REF TO if_wd_context_node.
    DATA lo_el_district TYPE REF TO if_wd_context_element.
    DATA ls_district TYPE wd_this->element_district.
    DATA lv_district_txt LIKE ls_district-district_txt.
  navigate from <CONTEXT> to <DISTRICT> via lead selection
    lo_nd_district = wd_context->get_child_node( name = wd_this->wdctx_district ).
  get element via lead selection
    lo_el_district = lo_nd_district->get_element(  ).
  get single attribute
    lo_el_district->get_attribute(
      EXPORTING
        name =  `DISTRICT_TXT`
      IMPORTING
        value = lv_district_txt ).
*coding to diplay records when clicking a button(Submit)
DATA lo_nd_table TYPE REF TO if_wd_context_node.
DATA lo_el_table TYPE REF TO if_wd_context_element.
DATA ls_table TYPE wd_this->element_table.
  DATA lv_district LIKE ls_table-district.
navigate from <CONTEXT> to <TABLE> via lead selection
  lo_nd_table = wd_context->get_child_node( name = wd_this->wdctx_table ).
get element via lead selection
  lo_el_table = lo_nd_table->get_element(  ).
get single attribute
  lo_el_table->set_attribute(
    EXPORTING
      name =  `DISTRICT`
   " IMPORTING
      value = lv_district_txt ).
The above coding updates only one record to that
table created in view.
If i enter 2nd district value means then the first record
in the table is overwritten.
So my need is the record should not be overwritten.
it(2nd record ) should be displayed after the 1st record.
Any one can help me and send the coding plz....

instead of using set attribute you should use bind table method to display/update the records in table view.
step1 ) collect all the data in a local table
step2 ) and the bind that lacal table with your node
search1 = wd_context->get_child_node( name = `TABLE1` ).
search1->bind_table( lt_detail)
here lt_detail is your local table and TABLE1 is node which is bound with table ui element.

Similar Messages

  • How to update multiple records in the table using POST parameters:

    i got this idea from this website:http://www.karlrixon.co.uk/articles/sql/update-multiple-rows-with-different-values-and-a-s ingle-sql-query/comment-page-1/#comment-5409. Basically i am trying to update all the status in the results page, and by adding $i in front of the id in the text fields, and checkboxes, i can name the different inputs with different names:
    The image of how it takes the inputs is shown here:http://forums.adobe.com/thread/709034?tstart=0
    I tried this but got this error:Parse error: syntax error, unexpected T_IF, expecting ')' in C:\xampp\htdocs\Database Query\results_change.php on line 51
    will not work in the update code section:
    for($i=0;$i<$maxRows_Recordset1;$i++)
    {$a=sprintf("%s",GetSQLValueString($_POST['changeid $i'],"int"));
    $b=sprintf("%s",GetSQLValueString($_POST['checkbox $i'],"text"));
    $display_order .= array(
        $a => $b
    if($i<$maxRows_Recordset1-1)
    $ids = implode(',', array_keys($display_order));
    $updateSQL = "UPDATE `change` SET Status = CASE Change_id ";
    foreach ($display_order as $a => $b) {
        $updateSQL .= sprintf("WHEN %d THEN %s ", $a,$b);
    $updateSQL .= sprintf("END WHERE `Change_id` IN ($ids)");

    Hi,
    Try
    BEGIN
      FOR i IN 1..APEX_APPLICATION.G_F03.COUNT LOOP
        UPDATE xx_test
        SET checkbox = 'Y'
        WHERE rec_no = APEX_APPLICATION.G_F03(i);
      END LOOP;
    END;Code loops all checked checkbox. You do not need commit on page process.
    Regards,
    Jari
    http://dbswh.webhop.net/dbswh/f?p=BLOG:HOME:0

  • How to update multiple records in a table using procedure?

    Dear All,
    1 am using 11.1.2.1.0
    my question is i have a table like
    emp id(primary key), empname,location
    1                             damby      blore
    2                             rocky       kormangala
    3                              biswa     india
    my question  is i need to write one procure that at a time i can update empname and location(wat the value are there in empname and location i  need to change at a time).
    thanks
    Damby

    Hi, Damby,
    That sounds like what the UPDATE statement does, exactly.  Just use an UPDATE statement to change any number of columns in existing rows.  You don't need a procedure, but, if you're using a procedure for some other reason, you can do the UPDATE in the procedure.  UPDATE works the same in SQL or PL/SQL.
    Sometimes MERGE is more convenient than UPDATE.  Like UPDATE, it can change any number of columns, either in SQL or PL/SQL.
    I hope this answers your question.
    If not, post a little sample data (CREATE TABLE and INSERT statements, relevant columns only) for all the tables involved, and the results you want from that data.
    In the case of a DML operation (such as UPDATE) the sample data should show what the tables are like before the DML, and the results will be the contents of the changed table(s) after the DML.
    Explain, using specific examples, how you get those results from that data.
    See the forum FAQ: https://forums.oracle.com/message/9362002

  • How to update multiple records in custom table using checkbox in APEX 4.1?

    Hi,
    I have a SQL report which brings up all the data records using the following query.
    select
    "REC_NO" AS hidden_rec_no,
    "REC_NO",
    APEX_ITEM.CHECKBOX (3,rec_no) AS edit,
    "MEETING_TYPE",
    "PAGE_NO",
    "CHECKBOX"
    from "XX_TEST" m
    WHERE page_no = :p_page_no
    Out of all records, any records which are checked, I only want to update their flag to 'Y' on the database column "Checkbox". For this, I have a SUBMIT button on the report region. The processing code on pressing the SUBMIT button is:
    DECLARE.
    l_row NUMBER := 1;
    BEGIN
    FOR i IN 1..APEX_APPLICATION.G_F03.COUNT
    LOOP
    FOR j IN l_row..APEX_APPLICATION.G_F01.COUNT
    LOOP
    IF APEX_APPLICATION.G_F01(j) = APEX_APPLICATION.G_F03(i) THEN
    UPDATE xx_test
    SET checkbox = 'Y', -- APEX_APPLICATION.G_F03(j)
    WHERE rec_no = APEX_APPLICATION.G_F03(i);
    l_row := j + 1;
    EXIT;
    END IF;
    END LOOP;
    END LOOP;
    COMMIT;
    END;
    However, that is not happening. Please help me with this. Any solutions/suggestions are most welcome.
    Regards.

    Hi,
    Try
    BEGIN
      FOR i IN 1..APEX_APPLICATION.G_F03.COUNT LOOP
        UPDATE xx_test
        SET checkbox = 'Y'
        WHERE rec_no = APEX_APPLICATION.G_F03(i);
      END LOOP;
    END;Code loops all checked checkbox. You do not need commit on page process.
    Regards,
    Jari
    http://dbswh.webhop.net/dbswh/f?p=BLOG:HOME:0

  • Programmatic updating multiple records of a table in ADF

    Hi,
    I am using Jdeveloper : 10g 10.1.3.3
    Problem : I need to update multiple records in DB using ADF feature.
    The senario is like user is shown records of item consisting of item name, item code, category code, price etc. then user clicks "change category code" link availabe against each record. In next page user is shown current code and provided a text box to enter new code. Once i get this in my bean i need to update all records as:
    update item_info set category_code = :new_code where category_code = :current_code. Means to udate category code in all the records where category_code is :current_code.
    I have Entity and View Object for this table.
    How do i update multiple records using created view which is entity based?
    Have A Nice Time!
    Regards,
    Kevin

    In ADF you don't use update statement directly. This is done by the framework.
    You have to search for the records which match your condition category_code = :current_code using your VO based on the entity.
    Then iterate over the result set and change each row to your need setCategoryCode(newCode);
    When you commit the changes they are persist them in the DB.
    To see the changes in the UI you have to update the display using PPR or execute the query again.
    Timo

  • How to update multiple records checked by check box

    I have list of items in my jsp pages and that are being generated by the following code
    and I want to be able to update multiple records that have a checkbox checked:
    I have a method to update the status and employee name that uses hibernate that takes the taskID
    as a paratmeter to update associated status and comments, but my issue is how to do it with multiple records:
    private void updateTaskList(Long taskId, String status, String comments) {
    TaskList taskList = (TaskList) HibernateUtil.getSessionFactory()
                   .getCurrentSession().load(TaskList.class, personId);
    taskList.setStatus(status);
    taskList.setComment(comments);
    HibernateUtil.getSessionFactory().getCurrentSession().update(taskList);
    HibernateUtil.getSessionFactory().getCurrentSession().save(taskList);
    <table border="0" cellpadding="2" cellspacing="2" width="98%" class="border">     
         <tr align="left">
              <th></th>
              <th>Employee Name</th>
              <th>Status</th>
              <th>Comment</th>
         </tr>
         <%
              List result = (List) request.getAttribute("result");
         %>
         <%
         for (Iterator itr=searchresult.iterator(); itr.hasNext(); )
              com.dao.hibernate.TaskList taskList = (com.dao.hibernate.TaskList)itr.next();
         %>     
         <tr>
              <td> <input type="checkbox" name="taskID" value=""> </td>
              <td>
                   <%=taskList.empName()%> </td>           
              <td>          
                   <select value="Status">
                   <option value="<%=taskList.getStatus()%>"><%=taskList.getStatus()%></option>
                        <option value="New">New</option>
                        <option value="Fixed">Fixed</option>
                        <option value="Closed">Closed</option>
                   </select>          
    </td>
              <td>               
                   <input type="text" name="Comments" MAXLENGTH="20" size="20"
                   value="<%=taskList.getComments()%>"></td>
         </tr>
    <%}%>
    _________________________________________________________________

    I solved it by making changes in the occurrence  parameter of data type ...:-)

  • How to update multiple records in Oracle ?

    Hi Guys,
    <b>I have to update multiple records from a file into Oracle Table...</b>
    I can successfully insert the multiple records into the table but can't update the multiple records into the table.
    when i am using UPDATE_INSERT only my first record of the file is getting updated in th e table..
    Please share your views with me.
    Regards,

    I solved it by making changes in the occurrence  parameter of data type ...:-)

  • How to update multiple columns from different tables using cursor.

    Hi,
    i have two tables test1 and test2. i want to udpate the column(DEPT_DSCR) of both the tables TEST1 and TEST2 using select for update and current of...using cursor.
    I have a code written as follows :
    DECLARE
    v_mydept1 TEST1.DEPT_CD%TYPE;
    v_mydept2 TEST2.DEPT_CD%TYPE;
    CURSOR C1 IS SELECT TEST1.DEPT_CD,TEST2.DEPT_CD FROM TEST1,TEST2 WHERE TEST1.DEPT_CD = TEST2.DEPT_CD AND TEST1.DEPT_CD = 'AA' FOR UPDATE OF TEST1.DEPT_DSCR,TEST2.DEPT_DSCR;
    BEGIN
    OPEN C1;
         LOOP
              FETCH C1 INTO v_mydept1,v_mydept2;
              EXIT WHEN C1%NOTFOUND;
              UPDATE TEST2 SET DEPT_DSCR = 'PLSQL1' WHERE CURRENT OF C1;
              UPDATE TEST2 SET DEPT_DSCR = 'PLSQL2' WHERE CURRENT OF C1;
         END LOOP;
         COMMIT;
    END;
    The above code when run says that it runs successfully. But it does not updates the desired columns[DEPT_DSCR].
    It only works when we want to update single or multiple columns of same table...i.e. by providing these columns after "FOR UPDATE OF"
    I am not sure what is the exact problem when we want to update multiple columns of different tables.
    Can anyone help me on this ?

    oops my mistake.....typo mistake...it should have been as follows --
    UPDATE TEST1 SET DEPT_DSCR = 'PLSQL1' WHERE CURRENT OF C1;
    UPDATE TEST2 SET DEPT_DSCR = 'PLSQL2' WHERE CURRENT OF C1;
    Now here is the upated PL/SQL code where we are trying to update columns of different tables --
    DECLARE
    v_mydept1 TEST1.DEPT_CD%TYPE;
    v_mydept2 TEST2.DEPT_CD%TYPE;
    CURSOR C1 IS SELECT TEST1.DEPT_CD,TEST2.DEPT_CD FROM TEST1,TEST2 WHERE TEST1.DEPT_CD = TEST2.DEPT_CD AND TEST1.DEPT_CD = 'AA' FOR UPDATE OF TEST1.DEPT_DSCR,TEST2.DEPT_DSCR;
    BEGIN
    OPEN C1;
    LOOP
    FETCH C1 INTO v_mydept1,v_mydept2;
    EXIT WHEN C1%NOTFOUND;
    UPDATE TEST1 SET DEPT_DSCR = 'PLSQL1' WHERE CURRENT OF C1;
    UPDATE TEST2 SET DEPT_DSCR = 'PLSQL2' WHERE CURRENT OF C1;
    END LOOP;
    COMMIT;
    END;
    Please let us know why it is not updating by using using CURRENT OF

  • How to insert multiple records into a table?

    hi all 
    i have a table that name is : TiketsItem
    now i  want to 100 records insert my table
    for example : TicketsHeaderRef=52000
    Active=False
    TicketsItemId=45000 to 45100
    how to insert TicketsItemId  45000 to 45100 in my table
    thanks all
    Name of Allah, Most Gracious, Most Merciful and He created the human

    So, you just want to insert the serialized data into the table, without useDate or WKRef? I'm assuming these values will be updated later?
    Try something like this:
    DECLARE @TicketsHeader TABLE (TicketsItemID BIGINT, ticketsHeaderRef BIGINT, active BIT, useDate DATETIME, WKRef SMALLINT)
    DECLARE @startInt BIGINT = 45000
    WHILE @startInt <= 45100
    BEGIN
    INSERT INTO @TicketsHeader (TicketsItemID, ticketsHeaderRef, active)
    VALUES (52000, @startInt, 0)
    SET @startInt = @startInt + 1
    END
    SELECT *
    FROM @TicketsHeader
    thanks 
    i edited your codes:
    DECLARE @TicketsItem TABLE (TicketsItemID BIGINT, ticketsHeaderRef BIGINT, active BIT, useDate DATETIME, WKRef SMALLINT)
    DECLARE @startInt BIGINT = 45000
    WHILE @startInt <= 45100
    BEGIN
    INSERT INTO @TicketsItem (TicketsItemID, ticketsHeaderRef, active)
    VALUES (@startInt,52000 , 0)
    SET @startInt = @startInt + 1
    END
    when i execute:
    SELECT *  FROM TiketsItem
    i do not see any records inserted in TiketsItem
    how to solve it?
    Name of Allah, Most Gracious, Most Merciful and He created the human

  • How to get multiple records from internal table through BDC

    PERFORM DYNPRO USING:
      'X'  'SAPMM61L'  '0500',
      ' '  'BDC_OKCODE'  '=NEWC',
      'X'  'SAPMM61L'  '0500',
      ' '  'BDC_CURSOR'  'PLPTU-PLWRK(01)',
      ' '  'BDC_OKCODE'  '=TAKE',
      ' '  'PLPTU-PLWRK(01)' '2531'. (2531 is a plant)
    This is the recording used to get plant via BDC of MS31.
    Using this code i can get only single plant...
    If i want to get multiple plants from an internal table,how i can change this code?
    Since it is a recording i cant put this code in LOOP..ENDLOOP.
    Suggest any method for doing this....
    Awaiting for ur reply...

    Hi,
    While recording also record the scroll down button.
    The you can place different plant in the BDC using loop and endloop
    Regards
    Arun

  • How to insert multiple records in DB table

    HI Experts,
    Jdev 11.1.2.3
    I have requirement where my form belongs to two different tables (TableA and TableB).
    In this form am using ADF shuttle component. The number of values i select in shuttle component same number of records to be inserted in TableB with each value.
    on commit TableA and TableB both should be commited.
    Thanks,
    Nitesh

    Hi,
    You can use a managed bean as the target of the value property of the shuttle component. Then in a value change listener you read the selected values and manually update the model. For this you could e.g. expose two view objects (one for each table) as an iterator to the PageDef file, access it from Java and then call dcIteratorBindingInstance.getRowSet().createRow() to create and populate new rows
    The above is a bit rough in the outline, but so is the question
    Frank

  • How to update the records in SAP table through BADIs?

    Hi all,
    I have added custom tab with one field(input/output field) in ME22N. As soon as the user enters the value in the field,the value should be updated in the appended structure which has been included in EKKO table. I was told to be done in the BADI ME_PROCESS_PO_CUST and method PROCESS_HEADER. Please someone tell me how to do this.
    << Moderator message - The answers in the forum are provided by volunteers. Please do not ask for help quickly. >>
    Thanks,
    MKannan.
    Edited by: Rob Burbank on Nov 15, 2011 10:19 AM

    Hi,
    First subscribe the Header Tab in the method SUBSCRIBE
    DATA: ls_struc  LIKE LINE OF re_subscribers.
    Check for the Header data
        CHECK im_application = 'PO'.
        CHECK im_element     = 'HEADER'.
    CLEAR re_subscribers[].
    ls_struc-name = subscreen1.
        ls_struc-dynpro = '0001'.
      ls_struc-program = <dynpro program name >.
      ls_struc-struct_name = 'CI_EKKODB'.
        ls_subscriber-height = 7.
        APPEND ls_struc TO re_subscribers
    Use the method MAP_DYNPRO_FIELDS
    FIELD-SYMBOLS: <mapping> LIKE LINE OF ch_mapping.
        LOOP AT ch_mapping ASSIGNING <mapping>. 
       CASE <mapping>-fieldname.    
      WHEN <field name>. 
        <mapping>-metafield = mmmfd_cust_03.
        ENDCASE. 
    ENDLOOP.
    use method TRANSPORT_FROM_MODEL
    use method TRANSPORT_TO_DYNP
    TRANSPORT_TO_MODEL
    ls_mepoheader = l_header->get_data( ).
    CALL METHOD l_header->set_data
                EXPORTING
                  im_data = ls_mepoheader.
    Thanks,
    Shailaja Ainala.

  • How to update specific records in 03 tables

    i have 03 tables test1 test2 and test3 all 03 tables have a common column (referenced) 'code' there are thousands of records in these 03 columns of 03 tables but some records(old records) were not tagged with 1905 like 6789123 i want to tagged 1905 with these old records such as 19056789123 i am using oracle 10g.
    thanks in advance
    Edited by: user8765528 on May 25, 2011 11:51 AM
    Edited by: user8765528 on May 25, 2011 11:55 AM

    Like this?
    UPDATE table1
       SET code   =
              REGEXP_REPLACE (code,
                              '^(0{0,4})(.*)',
                              '0000\2')
    WHERE NOT REGEXP_LIKE ( code, '^0{4}')What I am doing above is if the code does not start with four zeroes , I am adding 4 zeroes.
    Also considering that if the code starts with 3 zeroes I am adding only one zero etc.
    You can do the same for rest of the tables.
    Example. I will be only touching the forst two rows and will be updating them. Row3 is already fine,
    SQL> WITH T AS (SELECT '11231' code FROM DUAL UNION ALL
      2             SELECT '0011232' code FROM DUAL UNION ALL
      3             SELECT '000011233' code FROM DUAL)
      4  SELECT REGEXP_REPLACE (code,
      5                         '^(0{0,4})(.*)',
      6                         '0000\2') code
      7    FROM T
      8   WHERE NOT REGEXP_LIKE ( code, '^0{4}');
    CODE
    000011231
    000011232
    SQL> Edited by: Ganesh Srivatsav on May 25, 2011 1:32 PM

  • How to update multiple records using for loop

    Hi I want to update a particular column of few rows in database i had written followin code after that few lines of code and calling action from the task which having commit return ,still it's not updating particular colum.I had debug the code loop is running fine but still changes are not reflecting to database.Let me know if there is any prob with following code snippet.
    RealEstatePropertyUnitDetailsVOImpl realEstatePropertyUnitDetailsVO = RealEstatePropertyUnitDetailsVOImpl)realEstateService.getRealEstatePropertyUnitDetailsVO();
    for(Row row : realEstatePropertyUnitDetailsVO.getAllRowsInRange())
    if("N".equalsIgnoreCase((String)row.getAttribute("RlstdSellYn"))
    || "false".equalsIgnoreCase((String)row.getAttribute("RlstdSellYn")))
    row.setAttribute("RlstdAvlblYn", "Y" );
    System.out.println("RlsthId "+row.getAttribute("RlstdRlsthId"));
    System.out.println("AvlbYN "+row.getAttribute("RlstdAvlblYn"));
    System.out.println("RlstdUnitId "+row.getAttribute("RlstdUnitId"));
    }

    Vishwesh,
    I'd start with something along the lines of ...
        RowSet vo = (RowSet)getRealEstatePropertyUnitDetailsVO();
        vo.reset();
        while (vo.hasNext())
          Row row = vo.next();
          row.setAttribute("Attribute", value);
        }getAllRowsInRange() may exclude some rows outside the "range". Also, the vo.reset is needed since your View Object currency may not be at the beginning of your RowSet.
    Hope that helps.
    Will

  • How to select multiple records from a TREE in the table

    HI,
    I have a tree structure which is in the table.When I open the node of the tree,all the subnodes are coming as one-one records in the table.I want to slect multiple record from this table.I applied onLeadSelect for this table,I can select only 1 record from the table.
    Can any one plz suggest me how to select multiple records from the table so that I can get all the data of those selected record.
    Regards
    -Sandip

    Rashmi/Kukku,
    First of all, Thanks for your help!
    Is there any other way in which we can access tables other than using BAPIs or RFCs?
    In my case, there is a table structure which has to be updated with values after validating a key. i don't think there is any RFC available now. do i need to create bapi/rfc for that?
    Krishna Murthy

Maybe you are looking for

  • InDesign CC Server 2014 app.open() File does not exist.

    I've set up InDesign CC Server 2014 trial on a Windows Server 2008 R2 and trying to run a simple script that converts a idml to PDF. Here's the code document = app.open(File("C:\inetpub\wwwroot\presentation\Documents\Resumes.idml")); document.exportF

  • Arctic Cooling VGA Silencer + Zalman CNPS7000 = Fit?

    I'm thinking about getting an Arctic Cooling VGA Silencer for my Hercules 9800 Pro, but I was wondering if the back piece really fits between the AGP card and the Zalman CNPS7000. Right now my gfx has the special stock cooling on, a.k.a Hercules-styl

  • I'm unable to set up ATT account in mail

    I'm unable to set up ATT account in mail

  • Want to run compensation process for all employee at once.

    Dear All, I have created Compensation Adjustment which use an user exit to read employee appraisal and create the compensation amount. its working fine by this transaction code HRCMP0001C - Change . but i want to run for all employees simultaneously,

  • 1131 config issue, not connecting.

    im at a loss, i have setup a 1131 with multiple ssid's, they show up, but neither one will connect. i need 2 ssid's, one open and one protected. this is the config i have so far: version 12.3 no service pad service timestamps debug datetime msec serv