Home > Ask the SAP software/management Experts > Questions & Answers > Retrieving table contents with JSP
Ask The SAP Expert: Questions & Answers
EMAIL THIS

Retrieving table contents with JSP

Austin Sincock EXPERT RESPONSE FROM: Austin Sincock

Pose a Question
Other SAP Categories
Meet all SAP Experts
Become an Expert for this site
>
QUESTION POSED BY: craig.cmehil@hella.com on 14 April 2003
Using the examples of JCo and RFC functions found on this site I am trying to create a small JSP page that will retrieve the contents of some tables for me. I am very new to SAP but not to Java.

My code is the following:

// Get a function template from the
//repository
IFunctionTemplate ftemplate = repository.getFunctionTemplate("RFC_READ_TABLE");

// Create a function from the template
JCO.Function function = new JCO.Function(ftemplate);
   
JCO.ParameterList tables = function.getTableParameterList(); 

out.println(tables);
If I understand correctly the output should show something? but I only get:

----------------- | PARAMETERS 'TABLES' ----------------- | DAT| FIELD| OPTION| ----------------- |0123|456789|0123456| ----------------- |TAB5|RFC_DB|RFC_DB_| ----------------- 
...Which leads me to believe I have not set a property or value or something? In the ST03 transaction you have the option to "Survey Graphics". This is the data that I'm trying to retreive and store in secondary database. Any help or at least a direction to head in?

>
You are getting the right response, as far as the Java statement's execution goes. The getTableParameterList()-method returns the internal structure or metadata for any in/outbound tables in the RFC interface. Simply printing that structure to the command console will only result in the display of that structure. This is exactly what you are seeing. In order to retrieve any table data, you must populate the appropriate import parameters (QUERY_TABLE would be best) then execute the call to SAP using JCO.Client.execute(function). I recommend using the Function Builder (SE37) to test the RFC_READ_TABLE for the data you need to retrieve. This will also help you better understand how to use this RFC through JCo.


Digg This!    StumbleUpon Toolbar StumbleUpon    Bookmark with Delicious Del.icio.us   



RELATED RESOURCES
2020software.com, trial software downloads for accounting software, ERP software, CRM software and business software systems
Search Bitpipe.com for the latest white papers and business webcasts
Whatis.com, the online computer dictionary



Search and Browse the Expert Answer Center
Search and browse more than 25,000 question and answer pairs from more than 250 TechTarget industry experts.
Browse our Expert Advice



SAP White Paper Topics
About Us  |  Contact Us  |  For Advertisers  |  For Business Partners  |  Site Index  |  RSS
SEARCH 
TechTarget provides technology professionals with the information they need to perform their jobs - from developing strategy, to making cost-effective purchase decisions and managing their organizations' technology projects - with its network of technology-specific websites, events and online magazines.

TechTarget Corporate Web Site  |  Media Kits  |  Site Map




All Rights Reserved, Copyright 2000 - 2009, TechTarget | Read our Privacy Policy
SearchSAP.com is a search service provided by TechTarget and is completely
independent of and not affiliated with SAP AG.
  TechTarget - The IT Media ROI Experts