Skip to Content
author's profile photo Former Member
Former Member

Moving data from IRecordSet to DefaultTableViewModel

Hi,

I have written a simple application which calls a function model in SAP and retrieves data in a table and returns the result into a recordset.

I would like to display this data in a JSP and would like to know how to move the data from the RecordSet to the DefaultTableViewModel?

Is there a simple way to do this (i.e. Loop at recordset add value to DefaultTableViewModel) the only example I can find in the PDK documentation (ComplexSapConnection.java) seems very long and complicated.

Many Thanks.

Add a comment
10|10000 characters needed characters exceeded

Related questions

1 Answer

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Feb 14, 2005 at 08:14 PM

    Here is how I did it using vectors:

    java.util.Vector colNames = new java.util.Vector();

    colNames.addElement("Regions");

    IRecordSet exportTable = (IRecordSet)output.get("REGIONS");

    exportTable.beforeFirst();

    while (exportTable.next()) {

    java.util.Vector() column = new java.util.Vector();

    column.addElement(exportTable.getString("LEVEL_LTEXT"));

    rows.addElement(column);

    }

    DefaultTableViewModel model = new DefaultTableViewModel(rows, colNames);

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.