How to get a specific Row based on filter on a specific column value

Friends,
I have a requirement to fetch a row, maximum salary of an employee row from employee table using ADF View object, I have a view object with result set based on some critieria, now I have to get a row out of result set which is having maximum employee salary.
Please put your thoughts or experiences!!
Thanks

You should be able to add a transient attribute called maxSalary and use groovy functions to find vo.max(Salary) like -
https://blogs.oracle.com/adf/entry/using_groovy_aggregate_functions_in
How to calculate ADF table column [check Laura Akel's post]Then you can create a view criteria which equates the salaryfield to maxSalary and returns just one row.

Similar Messages

  • How to get a specific tag value from SAX parser

    I am using the SAX method to parse my xml file.
    My Question is how to get the returning characters parsed after calling?
    esp the value of <body> tag?
    Here is my xml file, and i want to get the parsed <body> value after call sax parser.
    <?xml version="1.0" encoding="UTF-8"?>
    <article>
    <content>
    <title>floraaaaa</title>
    <date>2004-03-19</date>
    <body>
    Details of an article, and i want to get the article details
    </body>
    </content>
    </article>

    here is the parser code I am using:
    import java.io.*;
    import org.apache.xerces.parsers.SAXParser;
    import org.xml.sax.Attributes;
    import org.xml.sax.ContentHandler;
    import org.xml.sax.ErrorHandler;
    import org.xml.sax.Locator;
    import org.xml.sax.SAXException;
    import org.xml.sax.SAXParseException;
    import org.xml.sax.XMLReader;
    import org.xml.sax.helpers.XMLReaderFactory;
    public class test2 {
         public String m_xmlDetail;
         public void readDetail(String url) {
              System.out.println("Parsing XML File: " + url + "\n\n");
              try {
                   XMLReader parser = new SAXParser();
                   ContentHandler contentHandler = new MyContentHandler();
                   parser.setContentHandler(contentHandler);
                   parser.parse(url);
              } //try ends here
              catch (IOException e) {
                   System.out.println("Error reading URI: " + e.getMessage());
              } //catch ends here
              catch (SAXException e) {
                   System.out.println("Error in parsing: " + e.getMessage());
              } //catch ends here
         } //function
    }//close class
    public class MyContentHandler implements ContentHandler {
         private Locator locator;
         //public String m_bodyDetail=new String();
         public void setDocumentLocator(Locator locator) {
              System.out.println(" * setDocumentLocator() called");
              this.locator = locator;
         public void startDocument() throws SAXException {
              System.out.println("Parsing begins...");
         public void endDocument() throws SAXException {
              System.out.println("...Parsing ends.");
         public void processingInstruction(String target, String data)throws SAXException {
              System.out.println("PI: Target:" + target + " and Data:" + data);
         public void startPrefixMapping(String prefix, String uri) {
              System.out.println("Mapping starts for prefix " + prefix + " mapped to URI " + uri);
         public void endPrefixMapping(String prefix) {
              System.out.println("Mapping ends for prefix " + prefix);
         public void startElement(String namespaceURI, String localName,String rawName, Attributes atts)throws SAXException {
              System.out.print("startElement: " + localName);
              if (!namespaceURI.equals("")) {
                   System.out.println(" in namespace " + namespaceURI + " (" + rawName + ")");
              else {
                   System.out.println(" has no associated namespace");
              for (int i=0; i<atts.getLength(); i++)
                   System.out.println(" Attribute: " + atts.getLocalName(i) +"=" + atts.getValue(i));
         public void endElement(String namespaceURI, String localName, String rawName) throws SAXException {
              System.out.println("endElement: " + localName + "\n");
         public void characters(char[] ch, int start, int end) throws SAXException {
              String s = new String(ch, start, end);
              System.out.println("characters: " + s);
         public void ignorableWhitespace(char[] ch, int start, int end)throws SAXException {
              String s = new String(ch, start, end);
              System.out.println("ignorableWhitespace: [" + s + "]");
         public void skippedEntity(String name) throws SAXException {
              System.out.println("Skipping entity " + name);
    } //close class

  • How to get number of rows return in SELECT query

    i'm very new in java, i have a question:
    - How to get number of rows return in SELECT query?
    (i use SQL Server 2000 Driver for JDBC and everything are done, i only want to know problems above)
    Thanks.

    make the result set scroll insensitve, do rs.last(), get the row num, and call rs.beforeFirst(), then you can process the result set like you currently do.
             String sql = "select * from testing";
             PreparedStatement ps =
              con.prepareStatement(sql,ResultSet.TYPE_SCROLL_INSENSITIVE,ResultSet.CONCUR_READ_ONLY);
             ResultSet rs = ps.executeQuery();
             rs.last();
             System.out.println("Row count = " + rs.getRow());
             rs.beforeFirst();~Tim
    NOTE: Ugly, but does the trick.

  • How to get a unique row in a value set

    How to get a unique row in a value set which is used in concurrent program.
    Example if a table contains 10 unique rows i need only one row to show.
    Thanks

    add conditions in where clause to supress the duplicate values.
    On how to supress the duplicate values follow the link
    http://oracleschools.com/index.php?topic=40.msg76#msg76
    Thanks
    Prudhvi
    www.erpschools.com

  • How to get the specific name of the workset which is currently selected by the user in sap portal 7.0

    Dear Expert,
    I have one requirement like to read the selected workset name in portal by the current user.I have read two documents regarding how to retrieve the PCD contents (iViews, Pages, Worksets and Roles) and its properties like Created by, Changed by, Last changed by and others using PCD API.
    http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/6112ecb7-0a01-0010-ef90-941c70c9e401?overridelayout=true
    http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/508baf88-9335-2d10-efa6-c6ad61e5fc4b?quicklink=index&overridelayout=true
    But I am not able to understand how to get the specific name of the workset which is currently selected by the user.Can you please help me.
    I am using portal 7.0.
    Thanks & Regards,
    Patralekha

    Hi Expert,
    I found that we can use Interface INavigationHelperService to read Portal Role selected by user at runtime from http://scn.sap.com/thread/52194
    But this class is available in SAP NetWeaver 7.30 Enterprise Portal .
    But in SAP NetWeaver 7.0 Enterprise Portal that interface is not available.
    INavigationService is available there.
    But didn't get any proper discussion on this interface for the same requirement.
    Can you please help me.
    Thanks & Regards,
    Patralekha

  • How to get count of rows for a table?

    Hi,
    How to get count of rows for a table and secondly, how can i have access to a particular cell in a table?
    Regards,
    Devashish

    Hi Devashish,
    WdContext.node<Your_node_name>().size() will give you the no: of rows.
    This should be the node that is bound to the table's datasource property.
    WdContext.node<Your_node_name>().get<node_name>ElementAt(index_value); will select the row at that particular index.
    You can access an attribute of a particular row as
    WdContext.node<Your_node_name>().get<node_name>ElementAt(index_value).get<attribute_name>();
    Hope this helps,
    Best Regards,
    Nibu.
    Message was edited by: Nibu Wilson

  • How to get the pricing hierarchy based on the delivery date for sales order

    Hi,
    How to get the pricing hierarchy based on the delivery date for sales order other than system date.
    My requirement is to get the Pricing hierarchy based on the delivery date other than system date.
    Waiting for kind response.
    Best Regards,
    BDP

    HI Sai,
    please refer teh document already how to write FM based extration on generic extractors.
    and here  the logic to find the latest records values:-
    -> get the data in an internal table
    ->Sort the internal table data based from date descending
    -> Using READ statement , we can read the first record of the table which is nothign but your latest record.
    Regards.
    Sakthi

  • How to get customer-specific objects into PCUI ?

    Hello,
    we want to get an Z-table as tab page of the business partner-application into PCUI. It should 'only' be possible to create new entries - today there is no need to modify or delete records.
    Does there exist something like a "cookbook" on this task or has anyone of you experience how to get customer-specific objects (without using EEWB) into PCUI ?
    Thanks in advance
    Martin

    Option 1:
    If you are good in ABAP.
    You can add new tab in which create a new Field group. Assign it to a model access clas in which handle the table update.You can get the details in PCUI cookbook itsel.
    Option 2:
    If you are good at java
    Develop an FM to update the table.
    Call the FM from webdynpro
    Include this webdynpro as HTML viewer in PCUI.
    Regards,
    Abdul Raheem S

  • How to get the number of decimal places configured for a site column

    Hi,
    I have a column 'SampleNumCol' of type Number, the number of decimal places to be displayed is configured as 2.
    The column conatins a value, but when retrieved programatically is displayed as 5.00000000  instead of 5.00.
    I am retrieving this column using listitem.Properties[field.InternalName].
    I need to trim the decimals based on  number of decimal places configured for the site column.
    How to get the number of decimal places configured for a site column?
    Thanks in advance,
    dhijit

    Get the field as SPFieldNumber and then check DisplayFormat which returns
    SPNumberFormatTypes
    SPFieldNumber numberField = list.Fields.GetFieldByInternalName("YourNumberFieldName") as SPFieldNumber;
    SPNumberFormatTypes numFormatType = numberField.DisplayFormat;

  • Changing a row colour in JTable, depending on a column value

    Hi,
    I need assistance with the following:
    I need to change the colour of a row in a JTable, depending on a column value. I have been successful on changing one column's colour in each cell, depending on the value by using a CellRenderer extending DefaultTableCellRenderer.I am unable to set the other 2 columns's cell's depending on the first column value's.
    I would appreciate any help, source would be a bonus.
    Thx
    Charl

    Ok, here follows the code as requested. Note that this is the code setting each row in one of my columns depending on the value. Now i have to cgange column0 and column1 's foreground the same as what this column (column2) 's foreground is. Thx
    import java.awt.*;
    import java.util.*;
    import javax.swing.*;
    import javax.swing.table.*;
    class ColorizedCell extends DefaultTableCellRenderer {
    static Hashtable cache;
    static {
    cache = new Hashtable();
    cache.put ("Device Responding to Poll",Color.green);
    cache.put ("Wan link Recovered",Color.green);
    cache.put ("No Response to Device Poll",Color.yellow);
    cache.put ("Wan Link Failure",Color.red);
    cache.put ("Lan Link Failure down",Color.red);
    cache.put ("Device Down",Color.red);
    public Component getTableCellRendererComponent(JTable table,
    Object value, boolean isSelected,
    boolean hasFocus, int row, int column)
    JLabel label = (JLabel) super.getTableCellRendererComponent(table,value,isSelected,hasFocus,row,column);
    label.setText((String)value);
    if(column == 2) {
    //setFont(bold);
    Color c = (Color)cache.get(value);
    label.setForeground(c);
    if (isSelected) {
    label.setOpaque(true);
    label.setBackground(Color.white);
    else {
    //setFont(plain);
    label.setForeground(Color.white);
    return label;
    }

  • How to get only new rows

    hello,
    I have a table like below
    id_emp (int)
    id_est (int)
    dt_est(date)
    for each id_emp I can have multiple id_est with multiple dt_est... like below
    id_emp id_est dt_est
    1 1 2009-01-10
    1 2 2009-01-13
    2 3 2009-01-10
    2 4 2009-01-12
    2 5 2009-01-14
    3 6 2009-01-12
    4 7 2009-01-15
    5 8 2009-01-17
    5 9 2009-01-19
    I would like to get just the new rows based on date for each id_emp, so my result should be like below
    id_emp id_est dt_est
    1 2 2009-01-13
    2 5 2009-01-14
    3 6 2009-01-12
    4 7 2009-01-15
    5 9 2009-01-19
    How could I do that?
    Thanks

    Hi,
    Try this one :
    SELECT id_emp,
           max(id_est) keep (dense_rank last order by dt_est) id_est,
           max(dt_est) dt_est
    FROM <your_table_here>
    GROUP BY id_emp;

  • How to get a single row column from a viewobject in java?

    I have a class file that goes out and gets a viewobject and sets its where clause
    this is it:
    vcRow = vc.createViewCriteriaRow();
    vcRow.setAttribute("LogonId", "='" + strPcis_Login.toUpperCase() + "'");
    vc.addElement(vcRow);
    vo.applyViewCriteria(vc);
    vo.executeQuery();
    I know this working cause I can watch it in debug..
    but now the problem.
    I've looked in the docs and don't see how one can pull the value of the row it found and place it in a uix page in a textinput area
    how can I get a single row column, in this case the UserName that is in the view object to a string and then place it into my
    uix page? I've looked and looked and don't see a method for this.
    is there a way to take the oracle.cabo.servlet.Page and set a textinput with a viewobject get method?
    what way do you do this and where is it documented?

    is there a way to take the oracle.cabo.servlet.Page and set a textinput with a viewobject get method?
    what way do you do this and where is it documented? What you can do is get the value from your VO and set it somewhere that UIX can data bind to -- as a Page proprety, on HttpSession, etc. This is documented in Chapters 4 (Data Binding) and 5 (Controller) of the UIX Developer's Guide.
    To set a property, you use Page.setProperty(String key, String value). Then, in your UIX file, to make a textInput that has the value pulled from a given page property, use:
    <textInput data:text="key@ctrl:page" />
    -brian
    Team UIX

  • How to get the selected rows & columns in the table?

    hi everybody,
                         In my application the table is kept inside the event structure.I select the cells  in the table (using mouse) on running time.How to get the selected number of rows & columns in that table?

    Hello,
    You can fill selected values of the table by writing to it or the corresponding property using a property node - the table is just a 2D array of strings.  I think for your "disable" question you are referring to the shortcut menu (when you right click).  If you are using LabVIEW 8.x, you can edit or disable that shortcut menu - just right click on your table at edit time and choose Advanced >> Run-Time Shortcut Menu.
    Best Regards,
    JLS
    Best,
    JLS
    Sixclear

  • Check box als column in a standard table, how to get the selected row

    Dear experts,
    I habe standard tablt with check box as column. Now I want to get the current selected row structure and do some changes. How could I solve this problem? till now I just know to get the structure via lead selection.
    lo_node->get_element().
    lo_element = lo_node->get_static_attributes ( static_attributes = ls_row).
    How could I get the element through check-box in stead of lead selection. Many thanks!

    check this code
    To get the selected row number
    data: lr_element type ref to if_wd_context_element,
              lv_index type i.
      lr_element = wdevent->get_context_element( name = 'CONTEXT_ELEMENT'  ).
      lv_index = lr_element->get_index( ).
    Thanks
    Bala Duvvuri

  • How to get number of rows in tableview

    Hello,
    Could anybody help me on how to get the number of rows in a tableview? Sort of using DESCRIBE TABLE in classic ABAP.
    Thanks,
    Ricky

    There is an attribute of the class CL_HTMLB_TABLEVIEW named
    ROWCOUNT.
    Inside an event u need to get this info use this code:
    Replace 'Monitor'  for the ID of your tableview
    DATA: tv TYPE REF TO CL_HTMLB_TABLEVIEW,
          r_count  type i,
          tv ?= CL_HTMLB_MANAGER=>GET_DATA(
          request = runtime->server->request
          name = 'tableView'
          id = 'Monitor' ).
          IF tv IS NOT INITIAL.
            DATA: tv_data TYPE REF TO CL_HTMLB_EVENT_TABLEVIEW.
            tv_data = tv->data.
            r_count = tv_data->rowcount.
          ENDIF.

  • V v urgent ...  how to get the selected rows in the vl02n transaction

    Hi ,
    I have requirement that i have selected the line items in the vl02n transaction.
    If I select only one row there is option gs_get_cursor-line.
    If I select more than one line item at a time I am getting only the last value in to gs_get_cursor-line.
    Can anybody let me know how to get the multiple line items  that are selected
    It is very urgent ..
    Plz Help

    Hi,
    can you check the E_row_id .
    v_row type LVC_S_ROW
    read table itab index E_ROW-index.
    regards,
    Ajay
    Edited by: Ajay on Feb 14, 2008 6:22 PM

Maybe you are looking for