<?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 Re: DATA_BUFFER_EXCEEDED ABAP Exception in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/data-buffer-exceeded-abap-exception/m-p/12773131#M2023209</link>
    <description>&lt;P&gt;Hello &lt;SPAN class="mention-scrubbed"&gt;amankumarchagti&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;As per note &lt;A href="https://me.sap.com/notes/382318" target="_blank"&gt;382318 - FAQ | Function module RFC_READ_TABLE&lt;/A&gt; the function is not recommended for customer usage.&lt;/P&gt;&lt;P&gt;The DATA_BUFFER_EXCEEDED exception is caused by the fact that the function uses 512 chars buffer to get the data from a table. To get around it select fewer fields from the table, so a single result row fits 512 chars limitation. You can specify the fields with FIELDS parameters.&lt;/P&gt;&lt;P&gt;Alternatively as per note &lt;A href="https://me.sap.com/notes/3291780" target="_blank"&gt;3291780 - Enhancement RFC_READ_TABLE (7.31)&lt;/A&gt; you can get the data from the table in ET_DATA export parameter which is not limited to 512 chars:&lt;/P&gt;&lt;P&gt;&lt;EM&gt;Instead of using the table parameter DATA with the maximum output length of 512 characters and the fixed length display, the new export parameter ET_DATA can be used to return data in a string-based format. In this format, cell contents are transferred in dynamic lengths separated by delimiters. This means that data fields with dynamic length (STRING, ... ) are supported. Set the new optional import parameter USE_ET_DATA_4_RETURN to 'X' to get results returned in ET_DATA.&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;Best regards&lt;/P&gt;&lt;P&gt;Dominik Tylczynski&lt;/P&gt;</description>
    <pubDate>Tue, 21 Nov 2023 08:22:11 GMT</pubDate>
    <dc:creator>Dominik_Tylczynski</dc:creator>
    <dc:date>2023-11-21T08:22:11Z</dc:date>
    <item>
      <title>DATA_BUFFER_EXCEEDED ABAP Exception</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/data-buffer-exceeded-abap-exception/m-p/12773130#M2023208</link>
      <description>&lt;P&gt;Hi, I am trying to pull list of all users in SAP ECC using the below code:&lt;BR /&gt;```&lt;BR /&gt;import java.io.BufferedWriter;&lt;/P&gt;
  &lt;P&gt;import java.io.FileWriter;&lt;/P&gt;
  &lt;P&gt;import java.io.IOException;&lt;/P&gt;
  &lt;P&gt;import com.sap.conn.jco.JCoDestination;&lt;/P&gt;
  &lt;P&gt;import com.sap.conn.jco.JCoDestinationManager;&lt;/P&gt;
  &lt;P&gt;import com.sap.conn.jco.JCoException;&lt;/P&gt;
  &lt;P&gt;import com.sap.conn.jco.JCoFunction;&lt;/P&gt;
  &lt;P&gt;import com.sap.conn.jco.JCoParameterList;&lt;/P&gt;
  &lt;P&gt;import com.sap.conn.jco.JCoTable;&lt;/P&gt;
  &lt;P&gt;public class SAPDestinationTable { &lt;/P&gt;
  &lt;P&gt;public static void main(String[] args) { &lt;/P&gt;
  &lt;P&gt;try { // &lt;/P&gt;
  &lt;P&gt;Establish connection &lt;/P&gt;
  &lt;P&gt;JCoDestination destination = JCoDestinationManager.getDestination("SAP-ECC"); destination.ping();&lt;/P&gt;
  &lt;P&gt; // Create function module call JCoFunction function = destination.getRepository().getFunction("RFC_READ_TABLE");&lt;/P&gt;
  &lt;P&gt; &lt;BR /&gt; // Set up function module parameters &lt;/P&gt;
  &lt;P&gt;JCoParameterList imports = function.getImportParameterList(); &lt;/P&gt;
  &lt;P&gt;imports.setValue("QUERY_TABLE", "USR02");&lt;/P&gt;
  &lt;P&gt; imports.setValue("DELIMITER", ",");&lt;/P&gt;
  &lt;P&gt; &lt;BR /&gt; // Execute the function module call &lt;/P&gt;
  &lt;P&gt;function.execute(destination); &lt;BR /&gt; System.out.println(function.getTableParameterList().getTable("OPTIONS")); &lt;/P&gt;
  &lt;P&gt;// Get the data table &lt;/P&gt;
  &lt;P&gt;JCoTable dataTable = function.getTableParameterList().getTable("DATA"); &lt;BR /&gt; // Get the fields table &lt;/P&gt;
  &lt;P&gt;JCoTable fieldsTable = function.getTableParameterList().getTable("FIELDS");&lt;/P&gt;
  &lt;P&gt; &lt;BR /&gt; System.out.println(dataTable.getNumRows());&lt;/P&gt;
  &lt;P&gt; System.out.println(fieldsTable); &lt;/P&gt;
  &lt;P&gt;// Create CSV file writer &lt;/P&gt;
  &lt;P&gt;BufferedWriter writer = new BufferedWriter(new FileWriter("output-testing.csv"));&lt;/P&gt;
  &lt;P&gt; &lt;BR /&gt; // Write column headings to CSV &lt;/P&gt;
  &lt;P&gt;System.out.println(fieldsTable); &lt;/P&gt;
  &lt;P&gt;for (int i = 0; i &amp;lt; fieldsTable.getNumRows(); i++) { &lt;/P&gt;
  &lt;P&gt;fieldsTable.setRow(i); &lt;/P&gt;
  &lt;P&gt;String fieldName = fieldsTable.getString("FIELDTEXT"); &lt;/P&gt;
  &lt;P&gt;writer.write(fieldName); &lt;/P&gt;
  &lt;P&gt;if (i &amp;lt; fieldsTable.getNumRows() - 1) {&lt;/P&gt;
  &lt;P&gt; writer.write(","); &lt;/P&gt;
  &lt;P&gt;} &lt;/P&gt;
  &lt;P&gt;} writer.newLine();&lt;/P&gt;
  &lt;P&gt; &lt;BR /&gt; // Write data rows to CSV &lt;/P&gt;
  &lt;P&gt;for (int i = 0; i &amp;lt; dataTable.getNumRows(); i++) { &lt;/P&gt;
  &lt;P&gt;dataTable.setRow(i); &lt;/P&gt;
  &lt;P&gt;for (int j = 0; j &amp;lt; dataTable.getNumColumns(); j++) { &lt;/P&gt;
  &lt;P&gt;String fieldValue = dataTable.getString(j); &lt;/P&gt;
  &lt;P&gt;writer.write(fieldValue);&lt;/P&gt;
  &lt;P&gt; if (j &amp;lt; dataTable.getNumColumns() - 1) { &lt;/P&gt;
  &lt;P&gt;writer.write(",");&lt;/P&gt;
  &lt;P&gt; } } &lt;/P&gt;
  &lt;P&gt;writer.newLine(); &lt;/P&gt;
  &lt;P&gt;}&lt;/P&gt;
  &lt;P&gt; &lt;BR /&gt; // Close the writer writer.close(); &lt;BR /&gt; System.out.println("Data written to output-testing.csv successfully."); &lt;BR /&gt; } &lt;/P&gt;
  &lt;P&gt;\catch (JCoException | IOException e) { &lt;/P&gt;
  &lt;P&gt;e.printStackTrace(); &lt;/P&gt;
  &lt;P&gt;} &lt;/P&gt;
  &lt;P&gt;}} &lt;BR /&gt; &lt;BR /&gt; &lt;/P&gt;
  &lt;P&gt;```&lt;BR /&gt;&lt;BR /&gt;but getting below error:&lt;BR /&gt;&lt;BR /&gt;com.sap.conn.jco.AbapException: (126) DATA_BUFFER_EXCEEDED: DATA_BUFFER_EXCEEDED at com.sap.conn.jco.rt.ClientConnection.executeInternal(ClientConnection.java:2062) at com.sap.conn.jco.rt.ClientConnection.execute(ClientConnection.java:2257) at com.sap.conn.jco.rt.ClientConnection.execute(ClientConnection.java:2124) at com.sap.conn.jco.rt.RfcDestination.execute(RfcDestination.java:2289) at com.sap.conn.jco.rt.RfcDestination.execute(RfcDestination.java:2253) at com.sap.conn.jco.rt.AbapFunction.execute(AbapFunction.java:305) at SAPDestinationTable.main(SAPDestinationTable.java:27) &lt;/P&gt;</description>
      <pubDate>Tue, 21 Nov 2023 06:34:03 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/data-buffer-exceeded-abap-exception/m-p/12773130#M2023208</guid>
      <dc:creator>amankumarchagti</dc:creator>
      <dc:date>2023-11-21T06:34:03Z</dc:date>
    </item>
    <item>
      <title>Re: DATA_BUFFER_EXCEEDED ABAP Exception</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/data-buffer-exceeded-abap-exception/m-p/12773131#M2023209</link>
      <description>&lt;P&gt;Hello &lt;SPAN class="mention-scrubbed"&gt;amankumarchagti&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;As per note &lt;A href="https://me.sap.com/notes/382318" target="_blank"&gt;382318 - FAQ | Function module RFC_READ_TABLE&lt;/A&gt; the function is not recommended for customer usage.&lt;/P&gt;&lt;P&gt;The DATA_BUFFER_EXCEEDED exception is caused by the fact that the function uses 512 chars buffer to get the data from a table. To get around it select fewer fields from the table, so a single result row fits 512 chars limitation. You can specify the fields with FIELDS parameters.&lt;/P&gt;&lt;P&gt;Alternatively as per note &lt;A href="https://me.sap.com/notes/3291780" target="_blank"&gt;3291780 - Enhancement RFC_READ_TABLE (7.31)&lt;/A&gt; you can get the data from the table in ET_DATA export parameter which is not limited to 512 chars:&lt;/P&gt;&lt;P&gt;&lt;EM&gt;Instead of using the table parameter DATA with the maximum output length of 512 characters and the fixed length display, the new export parameter ET_DATA can be used to return data in a string-based format. In this format, cell contents are transferred in dynamic lengths separated by delimiters. This means that data fields with dynamic length (STRING, ... ) are supported. Set the new optional import parameter USE_ET_DATA_4_RETURN to 'X' to get results returned in ET_DATA.&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;Best regards&lt;/P&gt;&lt;P&gt;Dominik Tylczynski&lt;/P&gt;</description>
      <pubDate>Tue, 21 Nov 2023 08:22:11 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/data-buffer-exceeded-abap-exception/m-p/12773131#M2023209</guid>
      <dc:creator>Dominik_Tylczynski</dc:creator>
      <dc:date>2023-11-21T08:22:11Z</dc:date>
    </item>
    <item>
      <title>Re: DATA_BUFFER_EXCEEDED ABAP Exception</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/data-buffer-exceeded-abap-exception/m-p/12773132#M2023210</link>
      <description>&lt;P&gt;RFC_READ_TABLE is a security risk. If the service user is authorised for that FM, there is nothing to stop it being used to read &lt;EM&gt;any&lt;/EM&gt; data on the system. Very insecure, not recommended at all.&lt;/P&gt;&lt;P&gt; If you want data from a sap system, create your own function module. Then the service user can be authorised for just that function module and nothing else.&lt;/P&gt;&lt;P&gt;Additionally, it'll make it easy to code for in Java.&lt;/P&gt;</description>
      <pubDate>Tue, 21 Nov 2023 08:50:28 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/data-buffer-exceeded-abap-exception/m-p/12773132#M2023210</guid>
      <dc:creator>matt</dc:creator>
      <dc:date>2023-11-21T08:50:28Z</dc:date>
    </item>
    <item>
      <title>Re: DATA_BUFFER_EXCEEDED ABAP Exception</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/data-buffer-exceeded-abap-exception/m-p/12773133#M2023211</link>
      <description>&lt;P&gt;made below change in code, giving an error:&lt;BR /&gt;```&lt;BR /&gt; JCoParameterList imports = function.getImportParameterList();&lt;/P&gt;            imports.setValue("QUERY_TABLE", "USR02");            imports.setValue("DELIMITER", ",");            imports.setValue("USE_ET_DATA_4_RETURN", "X");&lt;BR /&gt;            // Execute the function module call            function.execute(destination);&lt;BR /&gt;        System.out.println(function.getTableParameterList().getTable("OPTIONS"));            // Get the data table            JCoTable dataTable = function.getTableParameterList().getTable("ET_DATA");&lt;P&gt;```&lt;BR /&gt;&lt;BR /&gt;error:&lt;BR /&gt;```&lt;/P&gt;&lt;P&gt;Exception in thread "main" com.sap.conn.jco.JCoRuntimeException: (127) JCO_ERROR_FIELD_NOT_FOUND: Field 'USE_ET_DATA_4_RETURN' is not a member of record 'INPUT'&lt;BR /&gt;&lt;BR /&gt;```&lt;/P&gt;</description>
      <pubDate>Tue, 21 Nov 2023 09:19:23 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/data-buffer-exceeded-abap-exception/m-p/12773133#M2023211</guid>
      <dc:creator>amankumarchagti</dc:creator>
      <dc:date>2023-11-21T09:19:23Z</dc:date>
    </item>
    <item>
      <title>Re: DATA_BUFFER_EXCEEDED ABAP Exception</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/data-buffer-exceeded-abap-exception/m-p/12773134#M2023212</link>
      <description>&lt;P&gt;&lt;SPAN class="mention-scrubbed"&gt;amankumarchagti&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Check the RFC_READ_TABLE function in the SE37 transaction and see its interface. The interface in my system is the following:&lt;/P&gt;&lt;P&gt;&lt;IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/attachments/storage/7/attachments/2228913-image.png" /&gt;&lt;/P&gt;&lt;P&gt;USE_ET_DATA_4_RETURN is there. Maybe we are on an older version where this parameter is not implemented yet?&lt;/P&gt;&lt;P&gt;If you don't have USE_ET_DATA_4_RETURN and ET_DATA, then you need to fit your result within 512 chars limit by specifying result fields in FIELDS.&lt;/P&gt;</description>
      <pubDate>Tue, 21 Nov 2023 09:31:19 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/data-buffer-exceeded-abap-exception/m-p/12773134#M2023212</guid>
      <dc:creator>Dominik_Tylczynski</dc:creator>
      <dc:date>2023-11-21T09:31:19Z</dc:date>
    </item>
  </channel>
</rss>

