How to retrieve 2 values from a table in a LOV

Hi
I'm pretty new to APEX. I try to retrieve two values from a table using a LOV. I have a table named DEBIT with then columns SITE, NAME and KEY
I want to display NAME to the user in a list. When the user select an item from the list, I want to retrieve the data of the SITE and KEY column of this item in order to launch an SQL command based on this two values.
How to retrieve thes two values whant the user chooses an item from the list ?
I apologize for my english, being french.
Regards.
Christian

Christian,
From what I understood about your requirement, you want a 'select list with submit' which displays "NAME" and based on the value selected, you want to get the corresponding values for "SITE" and "KEY" from the table.
<b>Step 1: Create a select list with submit, say P1_MYSELECT </b><br><br>
Use something like this in the dynamic list of values for the select list: <br>
SELECT NAME display_value, NAME return_value
FROM DEBIT<br><br>
<b>Step 2: Create a page process of type PL/SQL block. Also create 2 hidden items P1_KEY and P1_SITE. </b><br><br>
In the PL/sQL, write something like:
DECLARE
  v_key DEBIT.KEY%TYPE;
  v_site DEBIT.SITE%TYPE;
  CURSOR v_cur_myvals IS
          SELECT KEY, SITE
          FROM DEBIT
          WHERE NAME = :P1_MYSELECT;
BEGIN
  OPEN v_cur_myvals;
  LOOP
          FETCH v_cur_myvals
          INTO  v_key,v_site;
          EXIT WHEN v_cur_myvals%NOTFOUND;
:P1_KEY := v_key;   
:P1_SITE := v_site; 
  END LOOP;
  CLOSE v_cur_myvals;
END; <br><br>
Then you can use these values for whatever purpose you need to.
Hope this helps.

Similar Messages

  • How to Retrieve data from Variant Table

    Can anyone help me by telling how to retrieve data from variant table which was created by user. I am able to see data of variant table only thru cu60 transaction but not se11. I s there any function module to do this?

    Hello Mohan,
    if u already have data and u want to populate it in F4 help then use below code -
    u Have to make use of FM - 'F4IF_INT_TABLE_VALUE_REQUEST'
    REPORT  ZGILL_VALUE_REQUEST                     .
    data: begin of lt_all occurs 0.
            include structure DYNPREAD.
    data  end of lt_all.
    data: begin of lt_selected occurs 0.
           include structure DDSHRETVAL.
    data: end of lt_selected.
    DATA: BEGIN OF lt_code OCCURS 0,
                code LIKE zgill_main-PERNR,
          END OF lt_code.
    data no_dyn like sy-dynnr.
    Parameters : ECODE like zgill_main-PERNR.
    *parameters: pernr like pa0001-pernr .
    no_dyn =  sy-dynnr.   "give the scren no directly or sy-dynnr in case of report.
    At selection-screen on value-request for ECODE.
    select PERNR into table lt_code from zgill_main.
      CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
          EXPORTING
            retfield               = 'ECODE'
            dynpprog               = sy-repid
           dynpnr                  = no_dyn
          dynprofield              =       'ECODE'
          window_title           = 'Employee Details'
           value_org              = 'S'
          DISPLAY                = 'F'
       TABLES
            value_tab             = lt_code
           RETURN_TAB             = lt_selected.
    EXCEPTIONS
      PARAMETER_ERROR        = 1
      NO_VALUES_FOUND        = 2
      OTHERS                 = 3
    *if sy-subrc eq '0' .
      write: 'success'.
    *endif.
    read   table lt_selected index sy-tabix.
    move lt_selected-fieldval to ECODE.

  • How to retrieve value from xml file

    hi all,
    can somebody pls tell me how to retrieve value from xml file using SAXParser.
    I want to retrieve value of only one tag and have to perform some validation with that value.
    it's urgent .
    pls help me out
    thnx in adv.
    ritu

    hi shanu,
    the pbm is solved, now i m able to access XXX no. in action class & i m able to validate it. The only thing which i want to know is it ok to declare static ArrayList as i have done in this code. i mean will it affect the performance or functionality of the system.
    pls have a look at the following code snippet.
    public class XMLValidator {
    static ArrayList strXXX = new ArrayList();
    public void validate(){
    factory.setValidating(true);
    parser = factory.newSAXParser();
    //all factory code is here only
    parser.parse(xmlURI, new XMLErrorHandler());     
    public void setXXX(String pstrXXX){          
    strUpn.add(pstrXXX);
    public ArrayList getXXX(){
    return strXXX;
    class XMLErrorHandler extends DefaultHandler {
    String tagName = "";
    String tagValue = "";
    String applicationRefNo = "";
    String XXXValue ="";
    String XXXNo = "";          
    XMLValidator objXmlValidator = new XMLValidator();
    public void startElement(String uri, String name, String qName, Attributes atts) {
    tagName = qName;
    public void characters(char ch[], int start, int length) {
    if ("Reference".equals(tagName)) {
    tagValue = new String(ch, start, length).trim();
    if (tagValue.length() > 0) {
    RefNo = new String(ch, start, length);
    if ("XXX".equals(tagName)) {
    XXXValue = new String(ch, start, length).trim();
    if (XXXValue.length() > 0) {
    XXXNo = new String(ch, start, length);
    public void endElement(String uri, String localName, String qName) throws SAXException {                    
    if(qName.equalsIgnoreCase("XXX")) {     
    objXmlValidator.setXXX(XXXNo);
    thnx & Regards,
    ritu

  • How to retrieve data from catsdb table and convert into xml using BAPI

    How to retrieve data from catsdb table and convert into xml using BAPI
    Points will be rewarded,
    Thank you,
    Regards,
    Jagrut BharatKumar Shukla

    Hi,
    This is not your requirment but u can try this :
    CREATE OR REPLACE DIRECTORY text_file AS 'D:\TEXT_FILE\';
    GRANT READ ON DIRECTORY text_file TO fah;
    GRANT WRITE ON DIRECTORY text_file TO fah;
    DROP TABLE load_a;
    CREATE TABLE load_a
    (a1 varchar2(20),
    a2 varchar2(200))
    ORGANIZATION EXTERNAL
    (TYPE ORACLE_LOADER
    DEFAULT DIRECTORY text_file
    ACCESS PARAMETERS
    (FIELDS TERMINATED BY ','
    LOCATION ('data.txt')
    select * from load_a;
    CREATE TABLE A AS select * from load_a;
    SELECT * FROM A
    Regards
    Faheem Latif

  • How to retrieve data from edcauditentity table?

    Hello!
    I am interested how to connect to edcauditentity table and retrieve data from this table.
    I have sql query but i don't have idea how to start. For now i can connect to LiveCycle and retrieve policy name.
    Thank in advance!

    Hello Mohan,
    if u already have data and u want to populate it in F4 help then use below code -
    u Have to make use of FM - 'F4IF_INT_TABLE_VALUE_REQUEST'
    REPORT  ZGILL_VALUE_REQUEST                     .
    data: begin of lt_all occurs 0.
            include structure DYNPREAD.
    data  end of lt_all.
    data: begin of lt_selected occurs 0.
           include structure DDSHRETVAL.
    data: end of lt_selected.
    DATA: BEGIN OF lt_code OCCURS 0,
                code LIKE zgill_main-PERNR,
          END OF lt_code.
    data no_dyn like sy-dynnr.
    Parameters : ECODE like zgill_main-PERNR.
    *parameters: pernr like pa0001-pernr .
    no_dyn =  sy-dynnr.   "give the scren no directly or sy-dynnr in case of report.
    At selection-screen on value-request for ECODE.
    select PERNR into table lt_code from zgill_main.
      CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
          EXPORTING
            retfield               = 'ECODE'
            dynpprog               = sy-repid
           dynpnr                  = no_dyn
          dynprofield              =       'ECODE'
          window_title           = 'Employee Details'
           value_org              = 'S'
          DISPLAY                = 'F'
       TABLES
            value_tab             = lt_code
           RETURN_TAB             = lt_selected.
    EXCEPTIONS
      PARAMETER_ERROR        = 1
      NO_VALUES_FOUND        = 2
      OTHERS                 = 3
    *if sy-subrc eq '0' .
      write: 'success'.
    *endif.
    read   table lt_selected index sy-tabix.
    move lt_selected-fieldval to ECODE.

  • How to get values from a table(in jsp) for validation using javascript.

    hi,
    this is praveen,pls tell me the procedure to get values from a table(in jsp) for validation using javascript.
    thank you in advance.

    Yes i did try the same ..
    BEGIN
    select PROD_tYPE into :P185_OFF_CITY from
    magcrm_setup where atype = 'CITY' ;
    :p185_OFF_CITY := 'XXX';
    insert into mtest values ('inside foolter');
    END;
    When i checked the mtest table it shos me the row inserted...
    inside foolter .. Now this means everything did get execute properly
    But still the vallue of off_city is null or emtpy...
    i check the filed and still its empty..
    while mtest had those records..seems like some process is cleaining the values...but cant see such process...
    a bit confused..here..I tried on Load after footer...
    tried chaning the squence number of process ..but still it doesnt help
    some how the session variables gets changed...and it is changed to empty
    Edited by: pauljohny on Jan 3, 2012 2:01 AM
    Edited by: pauljohny on Jan 3, 2012 2:03 AM

  • Retrieving values from a table

    Hi all,
    I need to retrieve values from CSKS-KOSTL for values containing the pattern entered by the user. For example, if the user enters 1, need to retrieve all the KOSTL values starting with 1. But when i write a SELECT statement mentioning where kostl in '1', it is ignoring all the values like (0000001, 00001034, 0012334, and others). Only values starting with 1 is only retrieved as this is a character field and due to conversion routine, zeroes are prefixed while storing in the database.
    Could any one let me know how to retrieve the values from the database in this situation?

    If you want to use IN operator in your where clause then you should define a range variable(R_KOSTL) which refers to CSKS=KOSTL and populate the range as below
    R_KOSTL-SIGN = 'I'.
    R_KOSTL-OPTION = 'CP'.
    R_KOSTL-LOW = '1*'.
    APPEND R_KOSTL.
    and then write your select statement as .... WHERE kostl IN r_kostl.
    The approach suggested by Amit should also work fine.
    Thanks
    Kiran

  • Can retrieve value from one table, but not the other (exception thrown)

    Hi
    I hope some friendly soul can help me out here. I have a local Access database file. I am able to get a value from all tables except for one, which throws this error: "System.NullReferenceException:
    Object reference has not been specified to an object".
    The rather simple lines of code when working is this:
    Dim email As Object
    value = MyDataSet.Tables("Table")(0)(1).ToString
    Msgbox(email)
    However, when simply changing from "Table" to "AnotherTable", the exception is thrown. I
    have seriously no idea why. I've made sure the datatypes are the same and that the values are not NULL.
    What gives?

    Hello,
    Going with your last reply, you should be accessing data via the strong typed classes that get generated.
    Example using Microsoft Northwind database accessing the customers table in a MS-Access database. Note the check for Rows, we could even go farther if we are questioning issue with the data via try-catch statements writing errors to the IDE Output window.
    I would highly recommend never referencing rows without first checking if there are rows and secondly never reference columns by ordinal index, always use the column name. One example with ordinal positioning, suppose someone did SomeDataTable.Columns("SomeColName").SetOrdinal(3)
    and you expect the ordinal position to be 1 ? things will crash-n-burn. Food for thought :-)
    Public Class Form1
    Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
    Me.CustomersTableAdapter.Fill(Me.MainDataSet.Customers)
    End Sub
    Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
    If MainDataSet.Customers.Rows IsNot Nothing Then
    Dim FirstCompanyName As String = MainDataSet.Customers.FirstOrDefault.CompanyName
    MessageBox.Show(FirstCompanyName)
    Else
    MessageBox.Show("No rows in customer table")
    End If
    End Sub
    End Class
    In this case we get the first record from below in Button1 Click
    Please remember to mark the replies as answers if they help and unmark them if they provide no help, this will help others who are looking for solutions to the same or similar problem.

  • Retrieving values from a table in ADF

    Hi All,
    Can any one give me the code or an example as how to retrieve the values associated with the table in jspx page.
    I am working in ADF10.1.3.
    Thanks,

    Hi,
    I am using ADF10.1
    I have a table with multi selection in my jspx page.
    I have to get the table particular row and using that need to get other values associated with the table.
    I have used the floowing code..but this is not functioning properly
    SelectedRowSet = this.getTable1().getSelectionState().getKeySet();
    rowSetIter = selectedRowSet.iterator();
    // Get the Selected Row Values from
    if (selectedRowSet.size() > 0)
    for (int counter = 0; counter < selectedRowSet.size(); counter++)
    int index = (Integer) rowSetIter.next();
    JUCtrlValueBindingRef currentRow =
    (JUCtrlValueBindingRef) getTable1().getRowData(index);
    Row row = currentRow.getRow();
    if (row!=null)
    variable name = ((String) row.getAttribute());
    Debugger is raising an exception at JUCtrlValueBindingRef line.
    Do share some ideas on it.
    Thanks,

  • How to retrieve values from Dynamic Selection screen while using LDB  - PSJ

    I am having problem in PSJ Logical database. In a custom report which is using PSJ LDB, we are using PROJ and PRPS_R tables.
    When I run program it displays one dynamic selection screen, there we are giving selection criteria for PRPS (Master data WBS element) - Created on (giving some range like 2011/01/01 to 2011/01/31).
    So I want to display all WBS element which are created during the period (2011/01/01 - 2011/01/31).
    How do I retrieve the select-option low and high value of the field Created on Of WBS element if we Select data from any table based on this condition.
               Please help me.
    Thanks.

    in fact you don't have to get the values, you only need to tell to the program to take them into account :
    GET PRPS.
      CHECK SELECT-OPTIONS.

  • How to retrieve records from taxonomy table

    Hi,
    I have a main table which has taxonomy field,for ex: category.
    Main table: Products which has ProductName(text),ProductNo(text),Category fields(Lookup[taxnomoy])
    Could anyone please tell me how to retrieve the records and attributes from a taxonomy table.
    Please provide some sample codes.
    Thanks
    Sabari

    Hi Sabari,
    your question is not so clear-  any way find the following example
    if you want to get records based on search criteria( ex: taxonomy values where ProductName = "something "),, follow the below steps;
    1 . build Search Object-  ( I guess you know this step)
    2.  get RecordResultSet Object -
         Example
         //Compose array of the fields to retrieve
         FieldId[] fields = new FieldId[5];
         fields[0] = assign FiledId of Category field ;
         //Create the result definition for the search table
         ResultDefinition rd = new ResultDefinition(productsTableId);
         rd.setSelectFields(fields);
        // Retrive ResultSet
           RetrieveLimitedRecordsCommand recordsCommand = new  
           RetrieveLimitedRecordsCommand(mdmConnection.getConnection());
         recordsCommand.setSession(mdmConnection.getAuthenticatedUserSession().getSession());
         recordsCommand.setResultDefinition(rd);
         recordsCommand.setSearch(search);
         recordsCommand.execute();          
            RecordResultSet  records= recordsCommand.getRecords();
    3 . Now Iterate through resultSet for CategoryRecord lookUp Id
               Record record = records.getRecord( i );
         FieldId[] fieldIds = record.getFields();
                for(int n=0; n<fieldIds.length; n++) {
                   FieldId fieldId = fieldIds[n];
                   FieldProperties fieldProps = records.getRecordMetadata().getField(fieldId);
                   String fieldCode = fieldProps.getCode();
                            MdmValue value = record.getFieldValue(fieldId);                    
                          if(fieldCode.equals("Category")) {                         
                   if (!(value instanceof NullValue)) {
                                  //LookupValue appLookUpValue = (LookupValue) value;
                                  Record[] lookupRecord=record.findLookupRecords(fieldId);
                                  if(lookupRecord!=null && lookupRecord.length>0)
                                                            populate for  a category for every lookup record 
                                       // cat=this.getCategory(lookupRecord[0].getId(),locale);
    Note:- from Main table records  , you will get Category lookup records, you need to look up for every Category lookUp Record; there may be number of Category records for one main table Record;
    if you still face problem , let me know;
    Regards
    Rajasekhar k

  • How to get values from Hash Table

    Hi all,
    I have a hash table "lovResults" craeted with following code -
    String lovInputSourceId = pageContext.getParameter(SOURCE_PARAM);
    Hashtable lovResults = pageContext.getLovResultsFromSession(lovInputSourceId);
    values which I can see through SOP are - ******Value of lovResults is{roleid=1000, domainFV=CREATIVE, Role=Account Director}
    How can I get the domain value "domainFV=CREATIVE" from hash table in a variable because I have to set this vaue in another field.
    Please help me ASAP
    Thanks
    Amit

    Hi Amit ,
    Since you are successfully printing the values using sop's , please try this code
    Capture the value in controller .
    if(oapagecontext.getParameter("domainFV") != null)
    String formvalue= oapagecontext.getParameter("domainFV") // ensure hashtable id is correct
    Keerthi
    Edited by: keerthioaf on Nov 26, 2012 8:46 PM

  • How to get values from RT table

    Hello friends ,
    I want to get earned basic from RT table  T-code - pc00_m40_clstr
    how to get that values for wage types
    gaurav

    Hi Gaurav,
    The Function Module u2018 PYXX_READ_PAYROLL_RESULT u2019 generically reads a complete payroll result, that is for all country versions, from file PCL2 or from the buffer. In doing so, the payroll result is transferred to the PAYROLL_RESULT parameter. In the calling system, this must be classified as a complex structure according to the 'PAYxx_RESULT' dictionary structure. u2018 xx u2018 is the ISO code for the country. Now the payroll result is in the parameter FS_PAY99_RESULT. In this parameter the RT table is considered and the required values are moved into a internal table (say  T_RT).
    Regards,
    Swapna.

  • How to retrieve values from the struts DAO to Struts JSP

    Hi friends,
    I have one question. i want to display values in the struts jsp file from the struts DAO class. can anyone tell how do it.
    Appreciated for your help.
    Thanks
    G1 :)

    Hi Santosh,
    Thanks for your prompt reply.
    Actually, my problem is i want to display complete rows from the DAO to JSP page. I'm displaying all the rows in the DAO from DB.
    But i dont know how to retrieve all these data from DAO. Can i take arraylist.??
    DAO:
    ------------     public Customers getData(Customers customers){ // Reading data from DB
         //ArrayList list = null ;
         try
              Connection conn = getSQLConnection();
              Statement statement = conn.createStatement();
              String qry = "select * from register";
              ResultSet resultSet = null;
              PreparedStatement pstat = conn.prepareStatement(qry);
              // pstat.setString(1, customers.getFname());
              resultSet = pstat.executeQuery();
    //Print the data to the console
    while(resultSet.next()){
              String fnam = resultSet.getString(1);
              String lnam = resultSet.getString(2);
              String gen = resultSet.getString(3);
              String addres = resultSet.getString(4);
              String cit = resultSet.getString(5);
              String zip = resultSet.getString(6);
              String county = resultSet.getString(7);
              String emal = resultSet.getString(8);
              System.out.println("First name:"+fnam);
              System.out.println("Last name:"+lnam);
              System.out.println("Address:"+addres);
              customers.setFname(fnam);
              customers.setLname(lnam);
              customers.setGender(gen);
              customers.setAddress(addres);
              customers.setCity(cit);
              customers.setZipcode(zip);
              customers.setCountry(county);
              customers.setEmail(emal);
                   statement.close();
                   conn.close();
              }catch(Exception e1){
                   e1.printStackTrace();
              return customers;
    Bean:
    I have specified in this line in Bean:
    request.getSession().setAttribute("customers", customers);
    But in JSP. how will i populate all these data. Pls..send some code.
    I'm sorry this is just practicals. i'm not doin any real time project. that;s why i have placed all these code.
    Thanks for your patience for resolving my problems.
    Thanks
    G1

  • How to retreive value from my table..

    hi,
    I have developed a GUI which consists of table..of three columns and 16 rows..
    the table consists of propety and value and operator column..property column when user clicks on that cell it shows a combobox of 16 values like empno and empname and emporg,date etc..if user selects any of these value then in operator column it shows corresponding values ..like if selects empno it shows acombo box of less than,greater than,equals..if selects empname then equal,like ,not like with a combo box for selection..like that there r upto 16 rows//user can select any no of rows..after selection if he clicks on find then the selected values should be submitted to a query and passed to maethod..
    my doubt is how to retrieve the values and generate query..bcos iam not sure how many rows he is going to select..and in operator column it is string form and i have convert it to >=,< etc form..and submitt to query..
    can any body give me some tips for this with sample code..
    regards,
    sam

    Put your logo in a subreport, then you can suppress if no data etc.
    CR is a Relational Database reporting tool, it requires the tables to be linked otherwise there are 2 SELECT statements generated and unknown results...
    Don

Maybe you are looking for