When using the pysaprfc library you may encounter this error when performing a RFC_READ_TABLE. The reason for this is primarily because the table has too many fields to draw back into the itable python structure of the pysaprfc library. To overcome this you will need to limit the number of fields being returned in the read_table method as shown in this code below. By the way this particular code snippet is also useful for drawing back iDoc status codes for a list of iDoc numbers. Especially useful if you are having trouble getting read only access directly to the database as we were 🙂

import pysap

# Variables
WhereSQL = "DOCNUM IN (2016, 2017, 2018)"
SQLTable = "EDIDS"
MaxRows = "50"
CONN_FILE = "C:/Python26/pysaprfc/examples/sapconn.ini"

# Change next line to be able to connect to your SAP system

# Read entries from SQLTable
# Print some fields from itab to show it worked
for p in itab:
print '%(DOCNUM)s %(LOGDAT)s %(LOGTIM)s %(CREDAT)s %(CRETIM)s %(STATUS)s %(STACOD)s %(STATXT)s %(STAMQU)s %(STAMID)s ' % p