Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

filter fields using RFC_read_table to avoid data_buffer_exceeded exception

Former Member
0 Likes
318

Hi,

how do i filter the fields returned using function RFC_read_table to avoid the exception data_buffer_exceeded

i'm trying to read data from the but000 table.

this is my code:

otherwise pasted below: [http://pastebin.com/f458665a9|http://pastebin.com/f458665a9]

import com.sap.mw.jco.*;

public class JcoTest {

private static JCO.Client theConnection;

private static IRepository theRepository;

//JCO.Table fieldData = null;

public static void main(String[] args) {

createConnection();

retrieveRepository();

try {

JCO.Function function = getFunction("RFC_READ_TABLE");

JCO.ParameterList listParams = function.getImportParameterList();

listParams.setValue("BUT000", "QUERY_TABLE");

//listParams.setValue("|","DELIMITER");

theConnection.execute(function);

//fieldData = function.getTableParameterList().getTable("FIELDS");

//

JCO.Table tableList = function.getTableParameterList().getTable("DATA");

if (tableList.getNumRows() > 0) {

do {

for (JCO.FieldIterator fI = tableList.fields();

fI.hasMoreElements();)

{

JCO.Field tabField = fI.nextField();

System.out.println(tabField.getName()

+ ":t" +

tabField.getString());

}

System.out.println("n");

}

while (tableList.nextRow() == true);

}

}

catch (Exception ex) {

ex.printStackTrace();

}

}

private static void createConnection() {

try {

theConnection = JCO.createClient("000", "DDIC", "minisap", "en", "sincgo", "00");

theConnection.connect();

}

catch (Exception ex) {

System.out.println("Failed to connect to SAP system");

}

}

private static void retrieveRepository() {

try {

theRepository = new JCO.Repository("saprep", theConnection);

}

catch (Exception ex)

{

System.out.println("failed to retrieve repository");

}

}

public static JCO.Function getFunction(String name) {

try {

return theRepository.getFunctionTemplate(name.toUpperCase()).getFunction();

}

catch (Exception ex) {

ex.printStackTrace();

}

return null;

}

}

thanks .

1 REPLY 1
Read only

Former Member
0 Likes
270

Hi!

Is it some kind of new version of ABAP? It doesn't seem familiar for me...

Try posting in the Java forums instead of this one...

Regards

Tamá