How to clear rows from iterator and re-fetch fresh data from the table ?

Hi,
I am using JDev 11.1.1.2.0
I have generated JPA Service Facade and by using it, I have created Data Control which finally I have dragged & dropped on my .jsff file.
In viewObject, there is a method clearCache() to clear the viewObject data.
Iterator has also one method clear() but when it invoked, ADF framework throws StackOverFlow error.
So, I want to clear my iterator before calling executeQuery() method.
How Can I clear it ?
Because In my case if I run executeQuery() method on DCIteratorBinding, it is not getting updated with the lates value from DB table.
So I want to clear all the rows from iterator and then want to call executeQuery() method to updated latest data from DB tables.
I have also tried below peace of code to refresh iterator but still iterator getting updated with two same rows () while in DB it is proper.
FacesContext fctx = FacesContext.getCurrentInstance();
ValueBinding dcb =
fctx.getApplication().createValueBinding("#{bindings}");
DCBindingContainer iteratorbindings =
(DCBindingContainer)dcb.getValue(fctx);
DCIteratorBinding dciter =
iteratorbindings.findIteratorBinding(<iteratorname>);
dciter.releaseData();
dciter.executeQuery();
dciter.refresh(DCIteratorBinding.RANGESIZE_UNLIMITED);
regards,
devang

Hi,
Have you try to drag and drop to your refresh or query button an "Execute" operation from the Data Control Pallete?
We are using JPA/ EJB Session Beans and that works for us.
regards,
pino

Similar Messages

  • How to list all the rows from the table VBAK

    Friends ,
    How to list all the rows from the table VBAK.select query and the output list is appreciated.

    Hi,
    IF you want to select all the rows for VBAK-
    Write-
    Data:itab type table of VBAK,
           wa like line of itab.
    SELECT * FROM VBAK into table itab.
    Itab is the internal table with type VBAK.
    Loop at itab into wa.
    Write: wa-field1,
    endloop.

  • How to bring the more than one rows from the table into the script

    Hi
    I have to bring more than one rows from the table into the Main windows of the script. so plz help me out.
    Thanks in Advance
    Ananya

    Hi Ananya,
       Bring more than one row into main window of script.
       For this you need to do some changes for data which you pass to main window.At a time you need to pass more than one row,so for this you need to define one structure.See below code.
    Types:begin of ty_rows,
         include structure (your row_structure),
         include structure (your row_sturcture),
    Types:end of ty_rows.
    for example....
    If i need to pass 2 vendor details at a time to main window then the structure should be like this.
    Types:begin of ty_rows,
           vendor1 like lfa1-lifnr,
           vendor1_name like lfa1-name1,
           vendor2 like lfa1-lifnr,
           vendor2_name like lfa1-name1,
          end of ty_rows.
    Data:i_main type standard table of ty_rows,
         wa_main type ty_rows.
    Based on condition you can pass more than one rows of your actual internal table data to i_main internal table.
    Then you can pass i_main internal table to your main window.
        I think this will help you.
    Cheers,
    Bujji

  • AP- How to clear receipt from the GR/IR when an invoice is not received

    Good Afternoon-
    What is the best procedure or transaction code to use when a user needs to clear receipt from the GR/IR when an invoice is not received. 
    Thanks!

    Hi,
    As you know GR/IR clearing account is a provision account and it is posted to whenever you receive goods that have not been invoiced or receive invoice that have not been delivered. On the balance sheet date during the period end we have to make transfer postings to reflect the goods invoiced but not delivered and the goods delivered but not invoiced accounts.
    You need to create one adjustment (Correction) account and two target accounts Goods deliverd but not invoiced, Goods invoiced but not delivered. In t-code OBYP you need to assign these accounts for each of your reconciliation account.
    This t-code F.19 analyses the GR/IR claring account and posts outstanding amount to adjustment account. It creates the offsetting entry to the Goods deliverd but not invoiced if the account has a credit balance and Goods invoiced but not delivered if the account has a debit balance. These 2 accounts are target accounts. These postings are made separately per company code, GR/IR clearing account and reconciliation account. They are then reversed on the day you specify in the (F.19)program run.
    Regards,
    Krishna Kishore

  • How to rerieve records from the table starting with character 'D'

    Hi Folks,
    How to get the records from the table starting with character 'D'.
    Select Max (fld1) fron tab1 into tab1-fld1 where fld 2 = l_fld2 and starting character of fld(1) is 'D'.
    last record in the table starting with character 'D'
    How can i do that??
    Pl explain.
    Thanks,
    Matt

    Hi,
    Select Max (fld1) fron tab1 into tab1-fld1 where fld 2 = l_fld2 and starting character of fld(1) is 'D'.
    Select MAX (fld1)
       From  tab1
    into table itab
    where fld 2 = l_fld2
       and fld1 like 'D%'.

  • How I can extract from the table KONM?

    Hi Experts,
    I need to extract information from the table KONM.
    Somebody know any standard extractor?
    Thanks a lot!

    Hi Leticia,
    I think SAP does'nt deliver any standard extractor or Datasource related to the table KONM. The datasources delivered by SAP and related to the pricing are 2lis_11_VAKON and 2lis_13_VDKON but linked to the table KOMV.
    In your case you have to create a generic datasource using the T-Code RSO2 and you link it to the table KONM with a View, Infoset query or a function module.
    Regards.
    Yacine

  • How to Transfer Rows from one table to another in a different Page

    Hi Friends,
    My problem is; I need to call a custom page as a popup using Java-Script. ( This is because our business users want the multi-select LOV to look and function differently ).
    I have a table in the popped-up page from where; upon a button action I need to close the pop-up and transfer the selected rows , back to the base-page's table.
    ( Both the Base Page and the Pop-Up are Custom Pages.)
    Please find below the AM code that I call before closing the window using Java Script.
    But the Base-Page table remains un-disturbed. Can you please show me how to do the transfer of records if possible ?
    OAViewObjectImpl main_vo = getBasePageTableVO1();
    OAViewObjectImpl sel_vo = getPopupPageTableVO1();
    int fetchedRowCount = sel_vo.getFetchedRowCount();
    RowSetIterator iterator = sel_vo.createRowSetIterator("SelectedRows_Iterator");
    if (fetchedRowCount > 0)
    iterator.setRangeStart(0);
    iterator.setRangeSize(fetchedRowCount);
    for (int i = 0; i < fetchedRowCount; i++)
    PopupPageTableVORowImpl row = (PopupPageTable)iterator.getRowAtRangeIndex(i);
    BasePageTableVORowImpl main_row = (BasePageTableVORowImpl)main_vo.createRow();
    if (main_vo.getFetchedRowCount() == 0)
         main_vo.setMaxFetchSize(0);
         main_vo.setWhereClause(" 1 = 0 ");
         main_vo.executeQuery();
         main_vo.setCurrentRow(main_vo.last());
    main_vo.next();
         main_vo.insertRow(main_row);
         main_row.setNewRowState(main_row.STATUS_INITIALIZED);
         main_vo.setCurrentRow(main_row);
    try
    main_row.setField1(row.getField1());
    main_row.setField2(row.getField2());
    main_row.setField3(row.getField3());
    catch(JboException _ex)
    iterator.closeRowSetIterator();

    Thanks Ramkumar. I am able to catch the action after I used formSubmit .
    The below lines in processRequest declares the function cszRefreshBase and later; on attaching the function name in the open window java script call, I get my desired functionality.
    StringBuffer stringbuffer = new StringBuffer();
    stringbuffer.append("function cszRrefreshBase(lovwin, event) ");
    stringbuffer.append("{ ");
    stringbuffer.append(" if (!lovwin.PopupSL) ");
    stringbuffer.append(" return false; ");
    stringbuffer.append(" submitForm('DefaultFormName', 0, {'cmePopupEvent':'popupUpdate'}); ");
    stringbuffer.append("}");
    oapagecontext.putJavaScriptFunction("cszRefreshBaseJS", stringbuffer.toString());

  • How to populate rows from another table in new blank rows of other table

    I have to convert an oracle form 6i to Jdeveloper application. In forms 6i we use create a cursor for other table and then populate the current table data block row using create record and assigning its values from cursor and then issuing next record until all cursor records are written in data block. After some manual editing we save the whole form and then all block records are saved as new rows in table.
    Now how to create this functionality in jdeveloper application.
    Kindly help.

    two steps-
    1. get row from first VO.iterate them - like below -
    DCBindingContainer bindings = (DCBindingContainer)BindingContext.getCurrent().getCurrentBindingsEntry();
                                    DCIteratorBinding dcIteratorBindings = bindings.findIteratorBinding("ViewObj1Iterator");
                                    HSSFRow  excelrow = null;
                                            // Get all the rows of a iterator
                                            oracle.jbo.Row[] rows = dcIteratorBindings.getAllRowsInRange();
                                        int i = 0;
                                                for (oracle.jbo.Row row : rows) {
                                                                                                                    row.getAttribute(colName).toString());  // by this you can get row attribute value..
    2. inside iteration create row for VO 2 for example-
    ViewObject employee= findViewObject("EmployeeVO");
    // Create a row and fill in the columns.
    Row row = employee.createRow();
    row.setAttribute("Name", "Vinay");
    row.setAttribute("EmpId", 1);
    //Insert row in to the default row set
    employee.insertRow(row);
    Read more: http://www.techartifact.com/blogs/2012/12/creating-new-row-of-view-object-in-adf-techartifact.html#ixzz2iL978UOD
    http://www.techartifact.com/blogs/2012/12/creating-new-row-of-view-object-in-adf-techartifact.html

  • How to return rows from tmp table created inside function??

    Hi,
    I'm trying to return rows from a cursor or table (created within
    the function). How do I specify the return type?

    Hi,
    Here is the code that examples to create a function that can
    return data from table.This is achieved using REFCURSOR concept.
    Hope this helps you.I'm giving all stuff in single PL/SQL
    block.You can break it and create a package and declare
    refcursor type and function in that as well.
    DECLARE
    -- Declare generic cursor type
    TYPE gencur_type IS REF CURSOR ;
    -- Declare generic cursor varaible
    gencur gencur_type;
    -- Declare record type
    TYPE rec_type IS RECORD(descr emp.ename%type) ;
    -- Declare record type variable
    rec rec_type;
    --This how you declare a local function that returns gencrtype
    data set
    --This function is called in main block
    FUNCTION call_refcur return gencur_type
    AS
              rr gencur_type;
    BEGIN
         OPEN rr FOR SELECT descr FROM emp;
         RETURN rr;
    END;-- end of local function
    -- Main block begins here
    BEGIN
    -- Call the local function so that gencur will have
    -- the data set returned by select statement
    gencur:= call_refcur;
    -- Open a loop to test the stuff
    LOOP
         FETCH gencur INTO rec;
         EXIT WHEN gencur%NOTFOUND;
         null;
         dbms_output.put_line(rec.ename);
    END LOOP;
    END;
    Regards,
    Sridhar

  • How to delete rows from multiple tables when pressing button

    Hi, I'm wondering how do I delete a row from two different tables at the same time when I press the Delete button. Both tables have GROUP_ID as their primary key.

    Nevermind! I realized that I had "reset" before my process to delete from the 2nd table.

  • How to delete the duplicate rows from the table

    Hi,
    I have 2 tbales namely component, component_audit
    For each record in component table there are multiple entries in component_audit table.
    I need to keep the first record and delete the others from the component_audit table
    say for example
    select a.component_id,a.dt_ti_stamp,a.component_name,a.column_before,b.comments from component_audit a,component b where a.component_id=b.component_id
    ( on the above result set only I shold apply the actual delete query )
    PLease help me in this regards.
    Thanks.

    delete from component_audit a where dt_ti_stamp not in (select
                                            min(b.dt_ti_stamp)
                                       from
                                            component_audit b
                                       where
                                            a.component_id = b.component_id)

  • Deleting the Row from the table is not refreshing the contents in the form

    Hi,
    We developed a table and form in the same UI based on the following suggestion.
    Display and edit currently selected row of ADF Table in ADF Form
    1. Created one view object based on the employees table.
    2. dragged the view object to the UI as table.
    3. dragged the view object as form.
    4. set partial triggers on the form's container (panelformlayout) as tableId.
    Tested the application with the edit options and everything is working fine. But the problem comes when we delete the record from table. it is not refreshing the form based on the newly selected row after deleting the record. If we commit the data the form contents are updated to the selected row (which is not desired).
    Can you please suggest how to fix the issue, refreshing the form with the selected row after deleting the records.
    Thanks and Regards,
    S R Prasad

    The Code snippet looks fine. I think, the issue is in the partial trigger setting
    4. set partial triggers on the form's container (panelformlayout) as tableId.In order to the table to get refreshed, the table's partialTriggers property should be set to id of the delete Button.
    Go to table, select partialTriggers in the Property Inspector, Click on Expression Builder at the right and select the delete Button.
    Can you set this and check?
    Sample Code:
    <af:panelHeader text="panelHeader 1" id="ph1">
    <f:facet name="context"/>
    <f:facet name="menuBar"/>
    <f:facet name="toolbar">
    <af:commandButton text="Delete" id="cb1"/>
    </f:facet>
    <f:facet name="legend"/>
    <f:facet name="info">
    <af:table var="row" rowBandingInterval="0" id="t1"
    partialTriggers="::cb1">
    <af:column sortable="false" headerText="col1" id="c1">
    <af:outputText value="#{row.col1}" id="ot1"/>
    </af:column>
    <af:column sortable="false" headerText="col2" id="c4">
    <af:outputText value="#{row.col2}" id="ot3"/>
    </af:column>
    <af:column sortable="false" headerText="col3" id="c3">
    <af:outputText value="#{row.col3}" id="ot4"/>
    </af:column>
    <af:column sortable="false" headerText="col4" id="c5">
    <af:outputText value="#{row.col4}" id="ot2"/>
    </af:column>
    <af:column sortable="false" headerText="col5" id="c2">
    <af:outputText value="#{row.col5}" id="ot5"/>
    </af:column>
    </af:table>
    </f:facet>
    </af:panelHeader>
    Thanks,
    Navaneeth

  • Select rows from the table which don't exist in another table

    Hi, in this relatively simple task I have some problem. I need to get the records from the T1 which don't exist in T2, based on some criteria.
    here is my query:
    select a.ordernum, sum(totchg), b.tracknum, rownum from T1 a, T2 b where 1=1 and a.ordernum not in( select ordernum from T2 ) and entrydate between to_date('06/23/2007','MM/dd/yyyy') and to_date('06/30/2007','MM/dd/yyyy') group by a.ordernum, b.tracknum, rownum
    it suppose to return me "TRACKNUM" empty, however it's being returned populated.
    I also tried :
    select a.ordernum, sum(totchg),b.tracknum, rownum from T1 a,
    T2 b where[b] not exists( select '1' from T2 where a.ordernum = b.ordernum )
    and entrydate between to_date('06/23/2007','MM/dd/yyyy') and to_date('06/30/2007','MM/dd/yyyy') group by a.ordernum, b.tracknum, rownum
    the results are the same.
    please advise.

    You are trying to get a returned value field from T2 when you just said that the
    records returned from Only T1 are not found in T2, therefore no T2 record to return.
    You only get T1 records where the Ordernum key is not found in T2.
    select ordernum, tracknum, rownum, sum(totchg)
    from T1
    where ordernum not in( select ordernum from T2 )
    and (entrydate between to_date('06/23/2007','MM/dd/yyyy') and
    to_date('06/30/2007','MM/dd/yyyy') )
    group by ordernum, tracknum, rownum

  • How to get ridd of Garbage Values in the row from the Tables

    Hi Experts,
    I have an excel Sheet which has a value as
    Name
    ABC
    PQR
    XYZ
    MNO
    STU
    DEF
    JKL
    So i converted that to a csv (Comma de-limited) file and created an external table out off it.
    So when i try to match to "select * from table;" it displys the vlaue as below
    *"ABC*
    however, it should have been just ABC.
    select length(Name) from Table;
    O/p: 4 (It Should have been 3)
    How to get rid off this garbaje character?
    Please Help!!!!!!!
    Regards,
    Ravi R

    You didn't post CSV file. I can't reproduce your issue using the following CSV:
    "ABC"
    "PQR"
    "XYZ"
    "MNO"
    "STU"
    "DEF"
    "JKL"
    SQL> CREATE TABLE EXT_EMP
      2  (
      3  EMP_L VARCHAR2(255)
      4  )
      5  ORGANIZATION EXTERNAL
      6  ( TYPE ORACLE_LOADER
      7  DEFAULT DIRECTORY "TEMP"
      8  ACCESS PARAMETERS
      9  ( RECORDS DELIMITED BY NEWLINE
    10  CHARACTERSET WE8MSWIN1252
    11  STRING SIZES ARE IN BYTES
    12  BADFILE "EXT_EMP.BAD"
    13  NODISCARDFILE
    14  LOGFILE "EXT_EMP.LOG"
    15  SKIP 1 FIELDS TERMINATED BY ','
    16  OPTIONALLY ENCLOSED BY '"' AND '"'
    17  NOTRIM
    18  (
    19  EMP_L CHAR
    20  )
    21  )
    22  LOCATION
    23  (
    24  'Employess.csv'
    25  )
    26  )
    27  REJECT LIMIT UNLIMITED;
    Table created.
    SQL> SELECT  *
      2    FROM  EXT_EMP
      3  /
    EMP_L
    PQR
    XYZ
    MNO
    STU
    DEF
    JKL
    6 rows selected.
    SQL> SY.

  • How to clear entries from a table view

    Hi All,
      I am using a tableview in a BSP page. I am setting the attribute allrowseditable = 'TRUE'. The internal table I am using for the tableview contains only initial lines. Once the tableview is displayed i am entering some values on the cells. But even after triggering the DO_REQUEST the values i entered in the tableview remains, its not getting cleared eventhough my internal table contains only initial lines. I am not getting back the values from tableview in HANDLE_DATA or EVENT. Can anyone tell me why the cells in tableview is retaining the values. How can i overcome this.
    Thanks,
    regards
    Vishnu Aravind

    Hi Sebastian,
      The following is the code of my view
    <%@page language="abap"%>
    <%@ extension name="bsp" prefix="bsp" %>
    <%@ extension name="htmlb" prefix="htmlb" %>
    <%@ extension name="xhtmlb" prefix="xhtmlb" %>
    <%@ extension name="PlmHelp" prefix="plmhelp" %>
    <htmlb:gridLayout columnSize="1"
                      rowSize="2"
                      cellSpacing="10">
    <htmlb:gridLayoutCell rowIndex="1"
                          columnIndex="1">
    <htmlb:tableView
                        id                     = "attribute1"
                        allRowsEditable        = "X"
                        table                  = "<%= controller->tbl_attributes %>"/>
    </htmlb:gridLayoutCell>
    </htmlb:gridLayout>

Maybe you are looking for