JCA - Reading the RFC export  into array

Iam successful in connecting to an RFC using JCA.
Iam trying to display the table values like:
table.beforeFirst();
while(table.next()){
String s1 = table.getString("column_1");
There are lot of values under column_1.If i try to display the column_1 like:
response.write(s1);
Itz only outputting the last column's value.
Guess it should be handled using arrays or vector in Java.
I need to get all the values of Column_1 from a dropdown Box.
Can i actually read the values into a dropdownbox on JSP directly?
Cud someone Help me out!!
Thanx
Naresh.

I still haven't gotten your email with code. This is what you need to do.
1. Modify your bean.
Add this import in your bean
import com.sap.htmlb.IListModel;
import com.sap.htmlb.DefaultListModel;
Add a variable in your bean class.
public IListModel model;
initialize your model in your bean constructor method.
public RfcBean () {
   model = new DefaultListModel();
2. Modify your JSPDynpage code.
table.beforeFirst();
  while(table.next()){
   bean.model.addItem(table.getString("column_1"),table.getString("column_1"));
3. Modif your JSP code your dropdownlist box.
<hbj:dropdownListBox
        id="List"
        model="<%=bean.model%>">
</hbj:dropdownListBox>
Message was edited by: Prakash  Singh

Similar Messages

  • How to get the record set into array?

    Hi,
    I want to get the record set into array in the procedure and do the processing of the array later in procedure.
    below is the stored procedure i am working on:
    procedure bulk_delete_group(p_group_id in Array_GroupListID) as
    begin
    for i in p_group_id.first..p_group_id.last loop
    --Here I have to get the list of user id before deleting group
    SELECT user_id into *<SOME ARRAY>* FROM group_members WHERE group_id = p_group_id(i);
    DELETE group WHERE group_id = p_group_id(i);
    --Process the user id array after group deletion..
    end loop;
    end bulk_delete_group;
    Thanks in advance
    Aditya

    Something like this ->
    satyaki>
    satyaki>select * from v$version;
    BANNER
    Oracle Database 10g Enterprise Edition Release 10.2.0.3.0 - Prod
    PL/SQL Release 10.2.0.3.0 - Production
    CORE    10.2.0.3.0      Production
    TNS for 32-bit Windows: Version 10.2.0.3.0 - Production
    NLSRTL Version 10.2.0.3.0 - Production
    Elapsed: 00:00:00.20
    satyaki>
    satyaki>
    satyaki>select * from emp;
         EMPNO ENAME      JOB              MGR HIREDATE         SAL       COMM     DEPTNO
          9999 SATYAKI    SLS             7698 02-NOV-08      55000       3455         10
          7777 SOURAV     SLS                  14-SEP-08      45000       3400         10
          7521 WARD       SALESMAN        7698 22-FEB-81       1250        500         30
          7566 JONES      MANAGER         7839 02-APR-81       2975                    20
          7654 MARTIN     SALESMAN        7698 28-SEP-81       1250       1400         30
          7698 BLAKE      MANAGER         7839 01-MAY-81       2850                    30
          7782 CLARK      MANAGER         7839 09-JUN-81       4450                    10
          7788 SCOTT      ANALYST         7566 19-APR-87       3000                    20
          7839 KING       PRESIDENT            17-NOV-81       7000                    10
          7844 TURNER     SALESMAN        7698 08-SEP-81       1500          0         30
          7876 ADAMS      CLERK           7788 23-MAY-87       1100                    20
         EMPNO ENAME      JOB              MGR HIREDATE         SAL       COMM     DEPTNO
          7900 JAMES      CLERK           7698 03-DEC-81        950                    30
          7902 FORD       ANALYST         7566 03-DEC-81       3000                    20
    13 rows selected.
    Elapsed: 00:00:02.37
    satyaki>
    satyaki>create type np is table of number;
      2  /
    Type created.
    Elapsed: 00:00:03.32
    satyaki>
    satyaki>Create or Replace Procedure myProc(myArray np)
      2  is
      3    i   number(10);  
      4    rec emp%rowtype;  
      5  Begin  
      6    for i in 1..myArray.count
      7    loop  
      8      select *  
      9      into rec 
    10      from emp 
    11      where empno = myArray(i); 
    12     
    13      dbms_output.put_line('Employee No:'||rec.empno||' Name:'||rec.ename); 
    14    end loop; 
    15  End myProc;
    16  /
    Procedure created.
    Elapsed: 00:00:00.88
    satyaki>
    satyaki>
    satyaki>declare
      2    v np:=np(9999,7777);  
      3  begin  
      4    myProc(v);  
      5  end;
      6  /
    Employee No:9999 Name:SATYAKI
    Employee No:7777 Name:SOURAV
    PL/SQL procedure successfully completed.
    Elapsed: 00:00:00.30
    satyaki>Regards.
    Satyaki De.

  • How can I read the trace data into LabVIEW for E5071B

    HI 
    I am setting up the measurement using vector network analyzer (VNA) E5071B controlled by NI 488.2. How can I read the trace data into LabVIEW and display on the graph? If anyone having an idea or know well about this process please give me the suggestion, I will much appreciate it.
    Many Thanks

    You want to start with the driver
     In case you do not know it, you can do the driver search in LabVIEW from Tools>Instrumentation>Find Instrument Drivers. You might also want to bookmark the Instrument Driver Network for information on what a driver is and how to use it.

  • Is DocumentBuilder.parse(..) reading the whole XML into memory?

    Hello,
    I have a quick question about the following code snippet:
    DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
    factory.setNamespaceAware(true);
    DocumentBuilder builder = factory.newDocumentBuilder();
    Document doc = builder.parse("books.xml");Please have a look at the last line "builder.parse("books.xml");". I would like to use XPath to retrieve some informations of a xml file without having to deserialize the whole file (since the XML file rather big and I need to go through several of them in a loop).
    What exactly does the "builder.parse(...)" method? Is it reading the XML file and writing all the content to memory? Or does it only analyze and read the structure of the XML code? Or in other words, is the text of an element "//books/title" in memory after parsing, or not until I really access the "title" node of that XML?
    Thanks a lot for your help
    Best Regards,
    Ben

    Hi ,
    I did'nt knew how to start a new thread , so i am asking the question here:
    ===========================================================
    I am trying to read a xml file but i am not able to do so properly. I am new to xml .
    am trying to read a xml file of the following format in the staf and stax job xml file:
    <?xml version="1.0" encoding="utf-8"?>
    <operating_system>
    <unix_80sp1>
    <tests type="quick_sanity_test">
    <prerequisitescript>preparequicksanityscript</prerequisitescript>
    <acbuildpath>acbuildpath</acbuildpath>
    <testsuitscript>test quick sanity script</testsuitscript>
    <testdir>quick sanity dir</testdir>
    </tests>
    <machine_name>u80sp1_L004</machine_name>
    <machine_name>u80sp1_L005</machine_name>
    <machine_name>xyz.pxy.dxe.cde</machine_name>
    <vmware id="155.35.3.55">144.35.3.90</vmware>
    <vmware id="155.35.3.56">144.35.3.91</vmware>
    </unix_80sp1>
    </operating_system>
    Here machine_name tag can be n number. I need to read all the machine_name tags in an array , so that i can use them later.
    Also i need to read all the vmware tags in an array (both value and attributes) so that i can use them later. The number of vmware tags can again be n numbers.
    I am trying to use the following code :
    <!-- ******************************************************************* -->
    <!-- Following function is used to parse an XML file and return the DOM -->
    <!-- document object -->
    <!-- ******************************************************************* -->
    <function name="parseXML" scope="local">
    <function-list-args>
    <function-required-arg name="xmlFileName">
    Name of file containing XML to be parsed
    </function-required-arg>
    </function-list-args>
    <sequence>
    <!-- Parse the XML -->
    <script>
    factory = DocumentBuilderFactory.newInstance();
    factory.setValidating(1)
    factory.setIgnoringElementContentWhitespace(0)
    builder = factory.newDocumentBuilder()
    document = builder.parse(xmlFileName)
    </script>
    <script>
    vmware = None
    machine_name = None
    # Get the text value for the element with tag name "vmware"
    nodeList = document.getElementsByTagName("vmware")
    for i in range(nodeList.getLength()):
    node = nodeList.item(i)
    if node.getNodeType() == Node.ELEMENT_NODE:
    children = node.getChildNodes()
    for j in range(children.getLength()):
    thisChild = children.item(j)
    if (thisChild.getNodeType() == Node.TEXT_NODE):
    machine_name = thisChild.getNodeValue()
    # Get the text value for the element with tag name "machine_name"
    nodeList = document.getElementsByTagName("vmware")
    for i in range(nodeList.getLength()):
    node = nodeList.item(i)
    if node.getNodeType() == Node.ELEMENT_NODE:
    children = node.getChildNodes()
    for j in range(children.getLength()):
    thisChild = children.item(j)
    if (thisChild.getNodeType() == Node.TEXT_NODE):
    machine_name = thisChild.getNodeValue()
    </script>
    <return>[machine_name,vmware]</return>
    </sequence>
    </function>
    I am able to read only one value for machine_name (u80sp1_L005) and also one value for vmware
    i.e 144.35.3.91.
    What i want is read all the machine_value tags into a list , so that i can use it later
    Also i want to read all the vmware tags attributes into a list and all corresponding values into another list.
    what i mean is considering the following:_
    <machine_name>u80sp1_L004</machine_name>
    <machine_name>u80sp1_L005</machine_name>
    <machine_name>xyz.pxy.dxe.cde</machine_name>
    <vmware id="155.35.3.55">144.35.3.90</vmware>
    <vmware id="155.35.3.56">144.35.3.91</vmware>
    read all machine_name tag values into one list (u80sp1_L004,u80sp1_L005,xyz.pxy.dxe.cde)
    also all vmware attributes into one list *(155.35.3.55,155.35.3.56).....*and all the vmware values into one list *(144.35.3.90,144.35.3.91)*
    Also a good link to understand parsing using doumentbilder factory would be good help.
    Regards
    Sangram
    mail: [email protected]

  • Read a text file into array

    Can anyone let me know how to get read the values column wise from the text file and put each column in each arrays.
    for eg: if we have 4 columns in the text file then the values will be stored in 4 arrays.
    Thanks in advance
    Regards
    Kutty

    Use a two dimensional array to store your data, and use the StringTokenizer class to split up the lines as you read them in from the file.

  • How to read the CSV Files into Database Table

    Hi
    Friends i have a Table called tblstudent this has the following fields Student ID, StudentName ,Class,Father_Name, Mother_Name.
    Now i have a CSV File with 1500 records with all These Fields. Now in my Program there is a need for me to read all these Records into this Table tblstudent.
    Note: I have got already 2000 records in the Table tblstudent now i would like to read all these CSV File records into the Table tblstudent.
    Please give me some examples to do this
    Thank your for your service
    Cheers
    Jofin

    1) Read the CSV file line by line using BufferedReader.
    2) Convert each line (record) to a List and add it to a parent List. If you know the columns before, you might use a List of DTO's.
    3) Finally save the two-dimensional List or the List of DTO's into the datatable using plain JDBC or any kind of ORM (Hibernate and so on).
    This article contains some useful code snippets to parse a CSV: http://balusc.xs4all.nl/srv/dev-jep-csv.html

  • Reading the data file into XI

    Hi,
    I am facing a problem in XI. I have a file Adapter which fetches the data file from the appln server. For the testing purpose we kept the adapter disabled and placed th files in the directory. When activating the adapter, it fetches all files and brings to XI.
    Now the adapter is enabled. If I am trying place the data file in the application server while the adapter is enabled, the file simply disappeared/archived as per the setting in adapter. But the data is not coming into XI.
    This problem occurs only when the adapter is on and placing the files in the server.
    Can any one help me on this?
    Thanks.
    Jahir.

    Hi,
    http://xiserver:port/MessagingSystem/monitor/monitor.jsp
    have a look at this link and check if you have any errors
    over there
    Regards,
    michal
    <a href="/people/michal.krawczyk2/blog/2005/06/28/xipi-faq-frequently-asked-questions"><b>XI / PI FAQ - Frequently Asked Questions</b></a>

  • Cfspreadsheet and reading the xlsx files issue

    I am trying to process large excel files (65,000 rows) into the DB.  So I try to use the new cfspreadsheet tag to read in the files by 5000 rows at a time and then process the query into the tables.  The process is working fine when reading the (pre 2003 format "xls" files) but not when reading the new "xlsx" type of files.  The server is running out of memory trying to read those files for some reason.  Is this a known bug in ColdFusion 9.0??  Has anyone experiansed similar issues?
    Thanks

    if it's a POI issue (not likely, admittedly), of CF's
    usage thereof.
    If you check the POI archives, you should see a LOT of memory issues with large xlsx files. Usually related to how the file is processed. IIRC the standard way of loading a spreadsheet ie new XSSFWorkbook(name) just reads the whole file into memory in one shot. So with all the bloated xml and parsing going on it is very prone to OOM errors.
    For big files, they actually recommend using the event api instead, because of its lower footprint. I used it a couple months ago for a side project and it made a huge difference!  I did some basic profiling and the standard method (usermodel) was definitely more prone to big spikes in memory and oom errors. In contrast, memory usage with event api was far lower and more stable.
    Reason for bringing this all of this up ...? Well depending on how CF actually reads/loads spreadsheets internally, maybe the problem is a little bit of both .. ?  Just my $0.02
    -Leigh
    Message was edited by: -==cfSearching==-

  • How to bring the RFC table values to front end

    All
    I want to display a table in front end
    For that I connect to the RFC .Get into the table .
    Here pl tell me how to get the values from the table
    I did the following
    JCO.Function func = getDefaultJCoConnection().getJCoFunction("Z_TestRFC");
    getDefaultJCoConnection().execute(func);
    JCO.Table records=func.getTableParameterList().getTable("ET_TestTable");
    ArrayList list=new ArrayList();
    for (int i = 0; i < records.getNumRows(); i++, records.nextRow()) {
    list.add(records.getString("Name"));            
    return list;
    But the table contains 4 columns Name,Address,age,remarks
    In the above code I'm able to take just one column which is "Name" which works fine
    I want to take all the values to front end
    Please suggest
    Murali

    sateesh
    If I iterate all other fields where do I store them to take it to my jsp
    If u see I added that column value in one ArrayList
    So you want me to create 4 ArrayList and add populate them inside that for loop.
    could you please elaborate on the same.or could you please improve that code and post
    Thanks in advance
    Murali

  • DAQ Input Signal into Array

    Hi,
    I have an input (voltage) signal comming into my DAQ assistant (6008). This information displays well into a chart, but I also want to covert the same data into array format so that I can do further calculations. So, basically I would like to put a DAQ signal into an array. I'm having a lot of trouble doing so, please help,
    thank you
    Nick

    Hello Nick,
    I can use the function "From DDT" in the Function palette Express -> Signal Manipulation.
    When you place it on the block diagram, a windows opens and you can configure: 1D Array of Scalar - Automatic.
    Best regard
    Nick_CH

  • HT4489 I am attempting to import a vcard from my outlook into my icloud contacts. Exporting works fine but I get the error...could not import some contacts becaus ethere was a problem reading the vcard. Any suggestions?

    I am attempting to import a vcard from Outlook 2010 into my iCloud. Exporting to Outlook works fine but I get an error ..could not be imported there was a problem reading the vcard. Any suggestions?

    bmitch3 wrote:
    I am attempting to import a vcard from Outlook 2010 into my iCloud. Exporting to Outlook works fine but I get an error .
    You mean exporting from Outlook surely, what exactly are you you importing to?

  • How to read a file and save the contents into array list

    i have textfile contains information like:
    Name: James Smith
    Customer no: 663,282
    Post code: BA1 74E
    Telephone no: 028-372632
    Last modified: Feb 10, 2008 6:50:00 PM GMT
    Name: Janet Smith
    Customer no: 663,283
    Post code: BA1 74E
    Telephone no: 028-372632
    Last modified: Jan 11, 2007 8:10:05 PM GMT
    etc...
    how can i read the contents of this textfile and put the data into an ArrayList called ArrayList<Customer> customerList.
    i knew that i need two classes, one for CustomerDetails and one for ReadFile.
    i have already done the customer class as:
    import java.util.Date;
    public class Customer
        String Name;
        int CustomerNo;
        String Postcode;
        String teleNo;
        Date lastModified;
        public Customer(String Name, int CustomerNo, String Postcode, String teleNo, Date lastModified)
         assign(Name, CustomerNo, Postcode, teleNo, lastModified);
        public void assign(String Name, int CustomerNo, String Postcode, String teleNo, Date lastModified)
         this.Name=Name;
         this.CustomerNo=CustomerNo;
         this.Postcode=Postcode;
         this.teleNo=teleNo;
         this.lastModified=lastModified;
        public String toString()
         String allDetails = "Name: "+Name+
             ", Customer No: "+CustomerNo+
             ", Postcode:"+Postcode+
             ", Telephone No: "+teleNo+
             ", Last Modified Date: "+lastModified;
         return allDetails;
    }i just wondering how can i code the ReadFile class?
    can anyone help me please. thank you in advance.

    thank you for your suggestion, but i have already started to code the readCustomer class using the Scanner.
    the code i got so far is:
    import java.util.Scanner;
    import java.io.*;
    public class readCustomer
        public static void main(String[] args)
         readCustomer("Customers.txt");
        public static void readCustomer(String filename)
         try {
             Scanner scanner = new Scanner(new File(filename));
             scanner.useDelimiter(System.getProperty("line.separator"));
             while (scanner.hasNext()) {
              processLine(scanner.next());
             scanner.close();
         } catch (FileNotFoundException e) {
             e.printStackTrace();
        public static void processLine(String line)
         Scanner scanner2 = new Scanner(line);
         scanner2.useDelimiter("\\s*:\\s*");
         String description = scanner2.next();
    *// here is where i am struggling. i don't know how to get the information after the : sign*   
    }i am currently struggling with the processLine method?
    also, i am not sure how to group a set of information and put them into the arraylist.
    Any hint, please. Thank you.
    Edited by: mujingyue on Feb 26, 2008 12:42 PM

  • I have a VI and an attched .txt data file. Now I want to read the data from the .txt file and display it as an array in the front panel. But the result is not right. Any help?

    I have a VI and an attched .txt data file. Now I want to read the data from the .txt file and display it as an array in the front panel. But the result is not right. Any help?
    Attachments:
    try2.txt ‏2 KB
    read_array.vi ‏21 KB

    The problem is in the delimiters in your text file. By default, Read From Spreadsheet File.vi expects a tab delimited file. You can specify a delimiter (like a space), but Read From Spreadsheet File.vi has a problem with repeated delimiters: if you specify a single space as a delimiter and Read From Spreadsheet File.vi finds two spaces back-to-back, it stops reading that line. Your file (as I got it from your earlier post) is delimited by 4 spaces.
    Here are some of your choices to fix your problem.
    1. Change the source file to a tab delimited file. Your VI will then run as is.
    2. Change the source file to be delimited by a single space (rather than 4), then wire a string constant containing one space to the delimiter input of Read From Spreadsheet File.vi.
    3. Wire a string constant containing 4 spaces to the delimiter input of Read From Spreadsheet File.vi. Then your text file will run as is.
    Depending on where your text file comes from (see more comments below), I'd vote for choice 1: a tab delimited text file. It's the most common text output of spreadsheet programs.
    Comments for choices 1 and 2: Where does the text file come from? Is it automatically generated or manually generated? Will it be generated multiple times or just once? If it's manually generated or generated just once, you can use any text editor to change 4 spaces to a tab or to a single space. Note: if you want to change it to a tab delimited file, you can't enter a tab directly into a box in the search & replace dialog of many programs like notepad, but you can do a cut and paste. Before you start your search and replace (just in the text window of the editor), press tab. A tab character will be entered. Press Shift-LeftArrow (not Backspace) to highlight the tab character. Press Ctrl-X to cut the tab character. Start your search and replace (Ctrl-H in notepad in Windows 2000). Click into the Find What box. Enter four spaces. Click into the Replace With box. Press Ctrl-V to paste the tab character. And another thing: older versions of notepad don't have search and replace. Use any editor or word processor that does.

  • How do I read directly from file into byte array

    I am reading an image from a file into a BuffertedImage then writing it out again into an array of bytes which I store and use later on in the program. Currently Im doing this in two stages is there a way to do it it one go to speed things up.
    try
                //Read File Contents into a Buffered Image
                /** BUG 4705399: There was a problem with some jpegs taking ages to load turns out to be
                 * (at least partially) a problem with non-standard colour models, which is why we set the
                 * destination colour model. The side effect should be standard colour model in subsequent reading.
                BufferedImage bi = null;
                ImageReader ir = null;
                ImageInputStream stream =  ImageIO.createImageInputStream(new File(path));
                final Iterator i = ImageIO.getImageReaders(stream);
                if (i.hasNext())
                    ir = (ImageReader) i.next();
                    ir.setInput(stream);
                    ImageReadParam param = ir.getDefaultReadParam();
                    ImageTypeSpecifier typeToUse = null;
                    for (Iterator i2 = ir.getImageTypes(0); i2.hasNext();)
                        ImageTypeSpecifier type = (ImageTypeSpecifier) i2.next();
                        if (type.getColorModel().getColorSpace().isCS_sRGB())
                            typeToUse = type;
                    if (typeToUse != null)
                        param.setDestinationType(typeToUse);
                    bi = ir.read(0, param);
                    //ir.dispose(); seem to reference this in write
                    //stream.close();
                //Write Buffered Image to Byte ArrayOutput Stream
                if (bi != null)
                    //Convert to byte array
                    final ByteArrayOutputStream output = new ByteArrayOutputStream();
                    //Try and find corresponding writer for reader but if not possible
                    //we use JPG (which is always installed) instead.
                    final ImageWriter iw = ImageIO.getImageWriter(ir);
                    if (iw != null)
                        if (ImageIO.write(bi, ir.getFormatName(), new DataOutputStream(output)) == false)
                            MainWindow.logger.warning("Unable to Write Image");
                    else
                        if (ImageIO.write(bi, "JPG", new DataOutputStream(output)) == false)
                            MainWindow.logger.warning("Warning Unable to Write Image as JPEG");
                    //Add to image list
                    final byte[] imageData = output.toByteArray();
                    Images.addImage(imageData);
                  

    If you don't need to manipulate the image in any way I would suggest you just read the image file directly into a byte array (without ImageReader) and then create the BufferedImage from that byte array.

  • How can I put the contents of an array into a set of write local variable clusters?

    I have a set of controls that a user fills in. The controls are clustered by rows, then combined into a 1D array, then written to a file. When I read the file, I want to feed the array back into the clusters with write local variables. Is there a simple way to handle the numerous local variable clusters so I can stuff the array back into them?
    Is there a better way to handle the whole issue of storing and recovering the information?
    The rows are steps in a procedure, and each row (cluster) contains numerical as well as string controls.

    There are many ways of doing this
    You may convert all your data to strings and save as an ascii file (you have to pay attention to the file format, so you can read it properly.
    Or you can use the configuration vi's, it may work in your case.
    or you may use an invoke node to get all controls of the vi's, save it, then read it, without worrying about any format. I have attached a vi that uses this method.
    Attachments:
    Temp.vi ‏52 KB

Maybe you are looking for

  • Sub-contracting Proclem..?

    Hi all I have created the subcontract challan . While doing the reconcilation its showing  error as challan as already completed, But still I have not reconciled in system. Only I have done the 542 movement for material. so can anybody explain me wha

  • Video Podcasts No Longer Transfer to iPod - Work OK in iTunes

    I am subscribed to a couple of different video podcasts - recently when I sync, I get the message that they are not copied to the iPod because the iPod can't play them. Same iPod, same podcasts as before.. The podcasts do play correctly in iTunes, th

  • My iMac no longer can display to a secondary monitor

    I had my iMac connected to a Samsung TV via the following: iMac --> displayport cable to DVI --> DVI to HDMI adaptor --> Samsung TV After doing some updates on OSX Mavericks this no longer works. The TV detects that there is something because the inp

  • Mailflow broken - error 451 4.7.0

    Hi, i have the following situation with an exchange 2010/2013 coexistence scenario: 3 Servers, 1 2008 R2 Server as DC with Exchange 2010, 1 2012 Server as DC, 1 2012 Server with Exchange 2013. The Problem is that the mailflow on the 2013 Exchange is

  • Itunes freezes when i try to sync apps

    when i push the sync applications box i tunes stops responding