<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic filter fields using RFC_read_table to avoid data_buffer_exceeded exception in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/filter-fields-using-rfc-read-table-to-avoid-data-buffer-exceeded-exception/m-p/3890048#M934328</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi, &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;how do i filter the fields returned using function RFC_read_table to avoid the exception data_buffer_exceeded &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;i'm trying to read data from the but000 table. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;this is my code: &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;otherwise pasted below: [http://pastebin.com/f458665a9|http://pastebin.com/f458665a9]&lt;/P&gt;&lt;P&gt;                                                                                import com.sap.mw.jco.*;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;public class JcoTest {&lt;/P&gt;&lt;P&gt; private static JCO.Client theConnection;&lt;/P&gt;&lt;P&gt; private static IRepository theRepository;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;//JCO.Table fieldData = null;&lt;/P&gt;&lt;P&gt;  &lt;/P&gt;&lt;P&gt; public static void main(String[] args) {&lt;/P&gt;&lt;P&gt;  createConnection();&lt;/P&gt;&lt;P&gt;  retrieveRepository();  &lt;/P&gt;&lt;P&gt;  try {&lt;/P&gt;&lt;P&gt;  JCO.Function function = getFunction("RFC_READ_TABLE");&lt;/P&gt;&lt;P&gt;  JCO.ParameterList listParams = function.getImportParameterList();&lt;/P&gt;&lt;P&gt;  &lt;/P&gt;&lt;P&gt;  listParams.setValue("BUT000", "QUERY_TABLE");&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;//listParams.setValue("|","DELIMITER");&lt;/P&gt;&lt;P&gt;  &lt;/P&gt;&lt;P&gt;  theConnection.execute(function);&lt;/P&gt;&lt;P&gt;//fieldData = function.getTableParameterList().getTable("FIELDS");&lt;/P&gt;&lt;P&gt;//&lt;/P&gt;&lt;P&gt;  &lt;/P&gt;&lt;P&gt;  JCO.Table tableList = function.getTableParameterList().getTable("DATA");&lt;/P&gt;&lt;P&gt;  &lt;/P&gt;&lt;P&gt;  if (tableList.getNumRows() &amp;gt; 0) {&lt;/P&gt;&lt;P&gt;   do {&lt;/P&gt;&lt;P&gt;    for (JCO.FieldIterator fI = tableList.fields();&lt;/P&gt;&lt;P&gt;      fI.hasMoreElements();)&lt;/P&gt;&lt;P&gt;     {&lt;/P&gt;&lt;P&gt;      JCO.Field tabField = fI.nextField();&lt;/P&gt;&lt;P&gt;      System.out.println(tabField.getName()&lt;/P&gt;&lt;P&gt;           + ":t" +&lt;/P&gt;&lt;P&gt;           tabField.getString());&lt;/P&gt;&lt;P&gt;     }&lt;/P&gt;&lt;P&gt;     System.out.println("n");&lt;/P&gt;&lt;P&gt;   }&lt;/P&gt;&lt;P&gt;   while (tableList.nextRow() == true);&lt;/P&gt;&lt;P&gt;  }&lt;/P&gt;&lt;P&gt;  }&lt;/P&gt;&lt;P&gt;  catch (Exception ex) {&lt;/P&gt;&lt;P&gt;   ex.printStackTrace();&lt;/P&gt;&lt;P&gt;  }&lt;/P&gt;&lt;P&gt;  &lt;/P&gt;&lt;P&gt;  &lt;/P&gt;&lt;P&gt;  &lt;/P&gt;&lt;P&gt; }&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt; private static void createConnection() {&lt;/P&gt;&lt;P&gt;  try {&lt;/P&gt;&lt;P&gt;   theConnection = JCO.createClient("000", "DDIC", "minisap", "en", "sincgo", "00");&lt;/P&gt;&lt;P&gt;   theConnection.connect(); &lt;/P&gt;&lt;P&gt;  }&lt;/P&gt;&lt;P&gt;  catch (Exception ex) {&lt;/P&gt;&lt;P&gt;   System.out.println("Failed to connect to SAP system");&lt;/P&gt;&lt;P&gt;  }&lt;/P&gt;&lt;P&gt; }&lt;/P&gt;&lt;P&gt; private static void retrieveRepository() {&lt;/P&gt;&lt;P&gt;  try {&lt;/P&gt;&lt;P&gt;   theRepository = new JCO.Repository("saprep", theConnection);&lt;/P&gt;&lt;P&gt;  }&lt;/P&gt;&lt;P&gt;  catch (Exception ex)&lt;/P&gt;&lt;P&gt;  {&lt;/P&gt;&lt;P&gt;   System.out.println("failed to retrieve repository");&lt;/P&gt;&lt;P&gt;  }&lt;/P&gt;&lt;P&gt; }&lt;/P&gt;&lt;P&gt;  public static JCO.Function getFunction(String name) {&lt;/P&gt;&lt;P&gt;    try {&lt;/P&gt;&lt;P&gt;         return theRepository.getFunctionTemplate(name.toUpperCase()).getFunction();&lt;/P&gt;&lt;P&gt;    }&lt;/P&gt;&lt;P&gt;    catch (Exception ex) {&lt;/P&gt;&lt;P&gt;     ex.printStackTrace();&lt;/P&gt;&lt;P&gt;    }&lt;/P&gt;&lt;P&gt;      return null;&lt;/P&gt;&lt;P&gt;    }  &lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanks .&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 04 Jun 2008 10:41:01 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2008-06-04T10:41:01Z</dc:date>
    <item>
      <title>filter fields using RFC_read_table to avoid data_buffer_exceeded exception</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/filter-fields-using-rfc-read-table-to-avoid-data-buffer-exceeded-exception/m-p/3890048#M934328</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi, &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;how do i filter the fields returned using function RFC_read_table to avoid the exception data_buffer_exceeded &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;i'm trying to read data from the but000 table. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;this is my code: &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;otherwise pasted below: [http://pastebin.com/f458665a9|http://pastebin.com/f458665a9]&lt;/P&gt;&lt;P&gt;                                                                                import com.sap.mw.jco.*;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;public class JcoTest {&lt;/P&gt;&lt;P&gt; private static JCO.Client theConnection;&lt;/P&gt;&lt;P&gt; private static IRepository theRepository;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;//JCO.Table fieldData = null;&lt;/P&gt;&lt;P&gt;  &lt;/P&gt;&lt;P&gt; public static void main(String[] args) {&lt;/P&gt;&lt;P&gt;  createConnection();&lt;/P&gt;&lt;P&gt;  retrieveRepository();  &lt;/P&gt;&lt;P&gt;  try {&lt;/P&gt;&lt;P&gt;  JCO.Function function = getFunction("RFC_READ_TABLE");&lt;/P&gt;&lt;P&gt;  JCO.ParameterList listParams = function.getImportParameterList();&lt;/P&gt;&lt;P&gt;  &lt;/P&gt;&lt;P&gt;  listParams.setValue("BUT000", "QUERY_TABLE");&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;//listParams.setValue("|","DELIMITER");&lt;/P&gt;&lt;P&gt;  &lt;/P&gt;&lt;P&gt;  theConnection.execute(function);&lt;/P&gt;&lt;P&gt;//fieldData = function.getTableParameterList().getTable("FIELDS");&lt;/P&gt;&lt;P&gt;//&lt;/P&gt;&lt;P&gt;  &lt;/P&gt;&lt;P&gt;  JCO.Table tableList = function.getTableParameterList().getTable("DATA");&lt;/P&gt;&lt;P&gt;  &lt;/P&gt;&lt;P&gt;  if (tableList.getNumRows() &amp;gt; 0) {&lt;/P&gt;&lt;P&gt;   do {&lt;/P&gt;&lt;P&gt;    for (JCO.FieldIterator fI = tableList.fields();&lt;/P&gt;&lt;P&gt;      fI.hasMoreElements();)&lt;/P&gt;&lt;P&gt;     {&lt;/P&gt;&lt;P&gt;      JCO.Field tabField = fI.nextField();&lt;/P&gt;&lt;P&gt;      System.out.println(tabField.getName()&lt;/P&gt;&lt;P&gt;           + ":t" +&lt;/P&gt;&lt;P&gt;           tabField.getString());&lt;/P&gt;&lt;P&gt;     }&lt;/P&gt;&lt;P&gt;     System.out.println("n");&lt;/P&gt;&lt;P&gt;   }&lt;/P&gt;&lt;P&gt;   while (tableList.nextRow() == true);&lt;/P&gt;&lt;P&gt;  }&lt;/P&gt;&lt;P&gt;  }&lt;/P&gt;&lt;P&gt;  catch (Exception ex) {&lt;/P&gt;&lt;P&gt;   ex.printStackTrace();&lt;/P&gt;&lt;P&gt;  }&lt;/P&gt;&lt;P&gt;  &lt;/P&gt;&lt;P&gt;  &lt;/P&gt;&lt;P&gt;  &lt;/P&gt;&lt;P&gt; }&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt; private static void createConnection() {&lt;/P&gt;&lt;P&gt;  try {&lt;/P&gt;&lt;P&gt;   theConnection = JCO.createClient("000", "DDIC", "minisap", "en", "sincgo", "00");&lt;/P&gt;&lt;P&gt;   theConnection.connect(); &lt;/P&gt;&lt;P&gt;  }&lt;/P&gt;&lt;P&gt;  catch (Exception ex) {&lt;/P&gt;&lt;P&gt;   System.out.println("Failed to connect to SAP system");&lt;/P&gt;&lt;P&gt;  }&lt;/P&gt;&lt;P&gt; }&lt;/P&gt;&lt;P&gt; private static void retrieveRepository() {&lt;/P&gt;&lt;P&gt;  try {&lt;/P&gt;&lt;P&gt;   theRepository = new JCO.Repository("saprep", theConnection);&lt;/P&gt;&lt;P&gt;  }&lt;/P&gt;&lt;P&gt;  catch (Exception ex)&lt;/P&gt;&lt;P&gt;  {&lt;/P&gt;&lt;P&gt;   System.out.println("failed to retrieve repository");&lt;/P&gt;&lt;P&gt;  }&lt;/P&gt;&lt;P&gt; }&lt;/P&gt;&lt;P&gt;  public static JCO.Function getFunction(String name) {&lt;/P&gt;&lt;P&gt;    try {&lt;/P&gt;&lt;P&gt;         return theRepository.getFunctionTemplate(name.toUpperCase()).getFunction();&lt;/P&gt;&lt;P&gt;    }&lt;/P&gt;&lt;P&gt;    catch (Exception ex) {&lt;/P&gt;&lt;P&gt;     ex.printStackTrace();&lt;/P&gt;&lt;P&gt;    }&lt;/P&gt;&lt;P&gt;      return null;&lt;/P&gt;&lt;P&gt;    }  &lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanks .&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 04 Jun 2008 10:41:01 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/filter-fields-using-rfc-read-table-to-avoid-data-buffer-exceeded-exception/m-p/3890048#M934328</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-06-04T10:41:01Z</dc:date>
    </item>
    <item>
      <title>Re: filter fields using RFC_read_table to avoid data_buffer_exceeded exception</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/filter-fields-using-rfc-read-table-to-avoid-data-buffer-exceeded-exception/m-p/3890049#M934329</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is it some kind of new version of ABAP? It doesn't seem familiar for me...&lt;/P&gt;&lt;P&gt;Try posting in the Java forums instead of this one...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Tamá&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 04 Jun 2008 11:13:51 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/filter-fields-using-rfc-read-table-to-avoid-data-buffer-exceeded-exception/m-p/3890049#M934329</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-06-04T11:13:51Z</dc:date>
    </item>
  </channel>
</rss>

