Design a Custom SAP Function Module to Circumvent RFC_READ_TABLE Limitations



You can use CData SAP Data Providers to view SAP data as a relational database and select any data set you need through data access standards. However, the RFC_READ_TABLE function module that all CData driver technologies use by default has a 512-byte-per-row limitation. You can follow the steps below to bypass this and other limitations with RFC_READ_TABLE.

Create a Custom Function Module

You can follow the procedure below to use the included source code to create an alternative to RFC_READ_TABLE.

  1. Use the RFC_READ_TABLE function as a template for the new function: Select transaction code SE37 and the SDTX Function Group and copy RFC_READ_TABLE to a new function group or your working function group. In this example, RFC_READ_TABLE is copied to "Z_CUSTOM_READ_TABLE".
  2. On the Attributes tab of the SAP screen, select "Remote Enabled Module".
  3. On the Tables tab, set the DATA parameter to "CHAR8000" (you may need to right-click and then click "Display <-> Change"):
  4. On the Source Code tab, paste the example source code for the replacement RFC_READ_TABLE function module located in the "db" subfolder of the installation directory. The code is located in Z_CUSTOM_READ_TABLE.txt. Click Save.
  5. Define the imports, tables, and exceptions as documented in the provided custom read table.
  6. Activate the function module and in your connection string set ReadTableFunction to Z_CUSTOM_READ_TABLE, or the name of your function module.
  7. Call the CreateTableSchema, CreateQuerySchema, and CreateFunctionSchema stored procedures to regenerate the schemas for the tables you want. You can also access custom ABAP queries. See the help documentation for a guide.
You can now select any fields in SAP.
 
 
Downloads