How to sort data in  results table(advanced table) based on some conditons

I have a requirement like below I have 3 search columns and 3 sort columns in the page. when user enter values in the search columns I will get results into advanced table. After I got results into results table. User will enter values in sort columns and hit sort submit button, Now the final results data should first display the selected sort values first and remaining data in alphabetical order.
ex: select a,b,c form table1 where a = nvl(:1,a) and b = nvl(:2,b)
results from main query
a , b,c,d,e,f
now user selects a value a1 in column a then results from main query data should display the a1 records first and remaining all records in alphabetical order.
Please let me know how can we approach to solve this problem.
Thanks,
KC.

Hi
Use the following method :
Set the OrderByClause in your voImpl():
the following is the description of OrderByClause method :
setOrderByClause
public void setOrderByClause(java.lang.String expr)
Sets the ORDER BY clause of the View Object's query statement. Bind variables can be specified using '?' as a place-holder for the value. The new ORDER BY clause does not take effect until ViewObjectImpl.executeQuery() is called.
regards
sridhar

Similar Messages

  • How to Pull data from sap r/3 tables to oracle tables

    how to fetch data from sap r/3 tables & data pulled to oracle table .
    GIVE THE APPROPRITE ANSWER FOR THIS.
    THANKS IN ADVANCE.
    If it is useful for me , i am giving point.
    regards ,
    Navita
    Edited by: NAVITA YADAV on Mar 7, 2008 2:07 PM
    Edited by: NAVITA YADAV on Mar 7, 2008 2:08 PM

    You need to perform some native SQL to fetch data. Before doing this connection must be exists b/w your R/3 and Oracle server.
    Basis team will help you to have connection.
    Check the connection name in the table DBCON.
    Check the below code to handle native SQL.
      SELECT SINGLE  DBMS
               FROM  DBCON
               INTO  DBTYPE
               WHERE CON_NAME = DBS.
      IF DBTYPE = 'ORA'.
        TRY.
          EXEC SQL.
            CONNECT TO :dbs
          ENDEXEC.
    ERROR Handling for Native SQL *************
          IF SY-SUBRC <> 0.
            MESSAGE `Docusphere connection failed.` TYPE 'I'.
            EXIT.
          ENDIF.
      EXEC SQL PERFORMING loop_output.
        OPEN C1 FOR
        SELECT  UK1, UK7, uk6, uk9, uk22, uk23, uk25    "field names of Oracle table
        FROM IIS_DOCS_AP10D
        WHERE ( UK2 = 'ZFIINVOICE' OR UK2 = 'ZFIPAYREQ' )    AND
        UK19 = 'E'                                           AND
        UK20 IS NULL
      ENDEXEC.
          DO.
            CLEAR W_OUTPUT.
            EXEC SQL.
              FETCH NEXT C1 into :wa1-arc_doc_id, :wa1-bukrs, :wa1-belnr, :wa1-gjahr, :wa1-wi_id, :wa1-ARCH_METHOD, :wa1-barcd.
            ENDEXEC.
    enddo.
    Reward points if helpful.................

  • How to capture the row  value in Advanced Table on OAF ?

    Hi:
    I was wondering, if anyone has any idea as to how to capture a row value on an advanced table on a OAF Page.
    I am currently trying to capture the Expense Report Number ( first column) on the Track Expenses Reports table on the page /oracle/apps/ap/oie/webui/HomePG.
    Any idea would be helpful ?
    Thank You

    Hi,
    856070 wrote:
    This is what I am looking for :
    Default Functionality
    On the expenses home page there is a table for the Submitted expenses Table ( advanced table) with multiple Expense Number rows , which has a link associated with every expense number. When the user clicks the expense number link , EBS takes you to a more detail information page. ---As per default functionality :::whene ever user clicks on link it will takes u to details info page based expense no right.
    ---Check the property of the Destination URL of the ExpensionNumber column.
    ---In this property u can find the page path and paramam ex:pexpencenumber.
    Customized functionality
    I would like to capture the Expense number on the detailed page to call another application based on the expense number. The expense number on the
    detailed page is not available on the request-parameter or on the VO.
    I was thinking of capturing the ExpenseNumber when the user clicks it and save the expense number on a >transientvalue to retrieve it on the detaile dpage..but unable to do so.---Here get the paramereter pexpencenumber and pass it to another appilcation.
    Regards
    Meher Irk

  • JDBC-XI-FILE scenario. How to extract data from more than one table in JDBC

    Hi,
    I was asked a question like in JDBC-XI-FILE scenario........ How to extract data from more than one tables (i.e from JDBC system) ?? What is the logic to do the same ??
    I am not sure whether this is a valid question..........but any help in this regards is highly appreciated.
    Regards
    Kumar

    HI,
    Yes it can be possible ,please see the following links
    JDBC  Receiver with Oracle Stored Procedures
    configuring jdbc adapter with multiple tables
    RFC -> XI -> JDBC Scenario Updating Multiple Tables
    /people/alessandro.berta/blog/2005/10/04/save-time-with-generalized-jdbc-datatypes
    JDBC Adapter multiple Selects
    https://www.sdn.sap.com/irj/sdn/advancedsearch?query=jdbc%20with%20multiple%20tables&cat=sdn_all
    Regards
    Chilla..

  • How to display stored procedure results in SJSC table?

    I have been able to create a cached rowset and debug/watch the results, but do not understand how to transfer those results to a Table component. Can anyone point me in the right direction?
    Details:
    In SessionBean1.java, I declared the stored procedure and rowset along with get/set and update procedures:
    // SLS trying stored procedure 20060412
        private java.sql.CallableStatement spFXRatesStatement; 
        private CachedRowSetXImpl spFXRatesRowSet = new CachedRowSetXImpl();
        public CachedRowSetXImpl getSpFXRatesRowSet() {
            return spFXRatesRowSet;
        public void setSpFXRatesRowSet(CachedRowSetXImpl crsxi) {
            this.spFXRatesRowSet = crsxi;
        public void updateSpFXRatesRowSet(String inDate, String inCcy) {
            try {
                spFXRatesStatement.setString(1, inDate);
                spFXRatesStatement.setString(2, inCcy);
                spFXRatesRowSet.populate(spFXRatesStatement.executeQuery(), 1);
            catch (Exception e) {
                // TODO - write exception code
    // SLS trying stored procedure 20060412I then �prepared� the stored procedure within SessionBean1�s init() procedure:
    // SLS trying a stored proc 20060412
            try {
                javax.naming.Context ctx = new javax.naming.InitialContext();
                javax.sql.DataSource ds = (javax.sql.DataSource)ctx.lookup("java:comp/env/jdbc/bmo_fp");
                java.sql.Connection conn = ds.getConnection();
                // spGetFXRates
                spFXRatesStatement = conn.prepareCall("{call GetFXRates(?, ?)}",
                        java.sql.ResultSet.TYPE_SCROLL_INSENSITIVE, java.sql.ResultSet.CONCUR_READ_ONLY);          
               // next sp...
                // clean up
                ctx.close();
                conn.close();
            catch (Exception e) {
                // TODO - add exception code
    // SLS 20060412 I can see the results in a web page procedure with a �getSessionBean1().getSpFXRatesRowSet().getString(i)� watch.
    try {
                getSessionBean1().updateSpFXRatesRowSet("9/30/2005","EUR");
                getSessionBean1().getSpFXRatesRowSet().first();
                while (getSessionBean1().getSpFXRatesRowSet().isLast() != true) {
                    getSessionBean1().getSpFXRatesRowSet().next();
            catch (Exception e) {
                // TODO - specify error detail
            }Now, how do I transfer these results to a table?

    I think you have to add a CachedRowSetDataProvider to you page been.
    Then initalize it with your getSpFXRatesRowSet() in the init() method.
    Then link you table to the CachedRowSetDataProvider.

  • How to load data to dimensions and fact table is it simialr to sql server

    How to load data to dimensions and fact table in a data ware house environment, is it simialr to sql server, oracle?
    Never migrated or loaded data to datawarehouse server.
    I have an interview and am really confused if they ask anything related to the dataware house side elements.
    Coudl you please if you don't mind provide me some steps and dimension and fact table info, an example only.
    Atleast for my knowledge.
    Thank you very much for the helpful info.

    Some discussions in previous forums should help you
    http://forums.sdn.sap.com/thread.jspa?threadID=2019448
    http://forums.sdn.sap.com/thread.jspa?threadID=1908902
    In the SAP tutorial, you can see a sample example of making fact tables.
    http://help.sap.com/businessobject/product_guides/boexir32SP1/en/xi321_ds_tutorial_en.pdf
    Arun

  • How to insert data from JTable to mysql Table....

    hello everybody
    i need help about how to insert data from JTable to mysql table... i know about how to create Table model...facing problem about how to insert data from JTable to mysql table....any helping link or code ... ill be thankfulll....for giving me solution...

    table1.getValueAt(table1.getSelectedRow(),0)you are getting the value of a selected row... or if you want you can just use a loop..
    for(.....){
    table1.getValueAt(x,y);
    }I think you know INSERT STATEMENT.. here on it just string concat
    sample e.g. (This not insert)
    "delete from accrule " +
                    "where ruleid= " + tblRA.getValueAt(tblRA.getSelectedRow(),0)+
                    " and accountname='"+tblRA.getValueAt(tblRA.getSelectedRow(),1)+"'"

  • How to fix the header of the table(advanced table) on the top?

    I just start making oaf, so I feel difficult in case it is easy for you.
    My question is:
    How to fix the header of the table(advanced table) to see on the top of the OAF page, even though I scroll to the bottom of the page?
    I need your help.
    All my best,
    BH

    BH
    As far as i know dont think it would be possible. Do wait for others input as well.
    Thanks
    --Anil
    http://oracleanil.blogspot.com

  • How and put data frrom DB into JFrame.tables ?

    hello,
    I tried to get rows from a DB into a table. Therefore I created a class(A) with a function(a1) throws SQLException. Connect and select rows from the DB runs perfectly. Now I want to put this data into a table. I created another class(B) extends JFrame with an inner class(icB1) extends AbstractTableModel. From here I tried call A.a1 to get the rows but
    1. the return type should be StringArray, how should i declare a function returning type stringarray and
    2. I tried to put the data into a String, so that the return value is String(Iwould try sort the data after returning values) like
    " icB1 extends AbstractTableModel { A.a1(); }" then i get the error msg: "java.sql.SQLException; must caught or declared to be thrown". Then i tried with this: " try { statement } catch { statement }" but it also doesnt func .. So how put I data from a DB into a table ? the main idea is to show and manage DB tables from the web. Many Thanks
    regards erkan

    Hi Erkan
    Here's parts of a simple tutorial style app that shows how to easily get data from a DB into a table. Note that the code is incomplete and may have typos.
    public class SQLHandler {
      public List getData(String sql, List headers) {
        List result = new ArrayList();
        ResultSet rs = connection.executeQuery(sql);
        // Get column details
        ResultSetMetaData rsmd = rs.getMetaData();
        int columns = rsmd.getColumnCount();
        for (int i=0;i<columns;i++) {
          headers.add(rsmd.getColumnLabel(i+1));
        while(rs.next()) {
          Object array = new Object[columns];
          for(int i=0;i<columns;i++) {
            array[i] = rs.getObject(i+1); 
          list.add(array):
        return result;
    public class SQLDataTableModel implements AbstractTableModel {
      private List data;
      private List headers = new ArrayList();
      public SQLDataTableModel(String sql) {
         data = sqlHandler.getData(sql,headers);
      // abstract methods
      public int getRowCount() {
        return list.size();
      public int getColumnCount() {
        return headers.size();
      public Object getValueAt(int row, int column) {
        Object[] array = data.get(row);
        return array[column];
    // Create JTable and assign a model
    JTable table = new JTable();
    table.setModel( new SQLDataTableModel("select * from table")):cheers
    Dave

  • Sorting data by clicking on pivot table header in excel

    Hi,
    Do you have an elegant idea how to sort pivot table data, based on power pivot model,
    by clicking on header (not by using the arrow on the first one).
    I'm Using Excel 2013
    Thank you in advance!
    Dina

    You could implement a solution using slicers:
    http://www.powerpivotpro.com/2011/10/user-friendly-report-sorting-with-slicers/

  • How to sort data in cl_gui_alv_tree class?

    Hi,
    I thought that since this object uses an alv grid that the standard sort functionality would exist.  Now that I've developed most of the code, I realize that there is no native sorting functionality.
    Is there some way I can make use of the Superclass CL_ALV_TREE_BASE?
    It has some methods that are "Private", "Instance"  - I'm still a rookie at OO programming in SAP so I'm not sure how best to approach the situation.
    As I see it, I have a few options:
    1)  Manually manage sorting by providing an ascending and descending button/icon on the toolbar and then delete and rebuild the nodes in the tree.
    2)  Manually track the data along with the nodekeys and then use method MOVE_NODE to reposition the data in the tree
    3)  Clone these objects and somehow find the code that is causing the sort options to be suppressed in the toolbar.
    Has anyone built any applications using CL_ALV_TREE_BASE that permit sorting?
    Please don't waste my time by pasting in the links to all the SAP online help for ALV and expect to get points.  Been there, done that.  If there is a particular section that is of specific value, I'll happily study it and report my findings.  Particularly something that explains how to invoke the methods of a superclass and the difference between protected, public, and private.
    Mostly though, I really need a way to sort data in the CL_GUI_ALV_TREE class.
    Thanks

    Hi Ray,
    As far as I know, this will not work. I've had the same problem. The only solution I have found was to re-build the tree each time. It is easier than moving nodes around.
    You can take a look at the class cl_wa_notifications_wps - in case you have a PM or an A&D system.
    Ferenc

  • How to get selected row of an advanced table

    Hi All,
    I have created an advanced table with 5 rows and i can also add rows in that. Here my requirement is i want to get the data of a row which i have selected. There are 5 rows. i have entered data into all 5 rows. Suppose i have selected 3rd row i have to get that 3rd row. if i have selected 5th row i have to get 5th row.
    Can you please guide me to achieve this requirement..
    Many thanks
    Murali

    Hi ,
    you have to set the firepartialaction event on your selection button, then use row refernce to get the handle on specific button
    public void processFormRequest(OAPageContext pageContext, OAWebBean webBean)
    super.processFormRequest(pageContext, webBean);
    OAApplicationModule am =
    (OAApplicationModule)pageContext.getApplicationModule(webBean);
    String event = pageContext.getParameter("event");
    if ("<ItemPPREventName>").equals(event))
    // Get the identifier of the PPR event source row
    String rowReference =
    pageContext.getParameter(OAWebBeanConstants.EVENT_SOURCE_ROW_REFERENCE);
    // write your business logic
    Thanks
    Pratap

  • How to load data in a oracle-datapump table ...

    I have done following steps,
    1) I have created a external table locating a .csv file
    CREATE TABLE TB1 (
    COLLECTED_TIME VARCHAR2(8)
    ORGANIZATION EXTERNAL(
    TYPE oracle_loader
    DEFAULT DIRECTORY SRC_DIR
    ACCESS PARAMETERS (
    RECORDS DELIMITED BY NEWLINE
    BADFILE 'TB1.bad'
    LOGFILE 'TB1.log'
    FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '`'
    MISSING FIELD VALUES ARE NULL
    COLLECTED_TIME
    LOCATION ('TB.csv')
    2) I am creating a datapump table and .dmp file using the source from step1 table (TB1)
    CREATE TABLE TB2
    ORGANIZATION EXTERNAL
    ( TYPE oracle_datapump
    DEFAULT DIRECTORY SRC_DIR
    LOCATION ('TB.dmp')
    ) AS SELECT
    to_date(decode(COLLECTED_TIME,'24:00:00','00:00:00',COLLECTED_TIME),'HH24:MI:SS') COLLECTED_TIME
    FROM TB1;
    3) Finally I have create a datapump table which will use TB.dmp as source created by step2
    CREATE TABLE TB (
    COLLECTED_TIME DATE
    ORGANIZATION EXTERNAL (
    TYPE ORACLE_DATAPUMP
    DEFAULT DIRECTORY SRC_DIR
    LOCATION ('TB.dmp')
    Question : How to create the TB.dmp file in SRL_DIR of step2 using the PL/SQL code?
    How to get data in table TB of step3 using the PL/SQL code?
    Thanks
    abc

    Hi,
    Yes I want to execute the SQL code step 2(as mentioned below) in PL/SQL package,
    CREATE TABLE TB2
    ORGANIZATION EXTERNAL
    ( TYPE oracle_datapump
    DEFAULT DIRECTORY SRC_DIR
    LOCATION ('TB.dmp')
    ) AS SELECT
    to_date(decode(COLLECTED_TIME,'24:00:00','00:00:00',COLLECTED_TIME),'HH24:MI:SS') COLLECTED_TIME
    FROM TB1;
    Please advise.
    Thanks
    abc
    Edited by: user10775411 on Sep 15, 2010 10:40 AM

  • How to transfer data from a dynamic internal table

    Hi All
    I want to transfer data from a dynamic internal table<dyn_table>
    to a non dynamic internal table itab which should have the same structure as <dyn_table>.
    How can this be done?
    Regards,
    Harshit Rungta

    As stated earlier this can be done only through field symbols...
    You cannot create an non dynamic internal table with ANY structure...using DATA statement
    If the strucutre is defined well and good...you can create an non-dynamic internal table...
    If you do not know the structure then the internal table has to be dynamic...and to be generated using field symbols
    DATA: lv_ref TYPE REF TO data.
    FIELD-SYMBOLS: <fs_dyn_table> TYPE STANDARD TABLE.
    * You create a dynamic internal table...
    CREATE DATA lv_ref LIKE (your_dynamic_internal_table).
    ASSIGN lv_ref->* TO <fs_dyn_table>.
    Now...do the transfer.
    <fs_dyn_table> = "your_dynamic_internal_Table
    Hope it helps!

  • How to sort Data in XML template (rtf) file?

    Hi, I have an oracle 11i custom report (rdf) with an xml output to a PDF. There is a formula column in the report. Now I need the data to be sorted on this formula column. As we cannot sort on formula column, i have decided to find a way to sort it in the data in the XML template. But I don't really know how to sort and also where to specify the sort tag in the rtf file. I appreciate your response.
    Databse version : 9.2.0.8.0
    E-Biz Version : 11.5.10.2
    Oracle Reports Version : 6.0.8.27.0
    Oracle BI version : 10.1.3.2.1
    Note : I posted this question under : XML General forum also. But did not get any response. I assumed that may be thats not the right place to post it as my report is in e-Biz environment.

    Hi
    As long as you don't have your ^field commands grouped inside a ^group the order in the .dat file is not important. Your last command
    ^field BG_DOC_LN__LN_AM
    246624.12
    should populate field BG_DOC_LN_AM wherever you place it on your form. Obviously you need to name the fields according to your ^field commands and not just use tab (move to next field).
    Shout if this was not what you are asking.
    Stale Sodal

Maybe you are looking for