Skip to Content
0
Former Member
Mar 18, 2011 at 08:17 PM

Problem using RFC_READ_TABLE function

775 Views

Hi all,

I am trying to access COEP table through RFC_READ_TABLE function. But it keeps giving me this error:

EXCEPTION DATA_BUFFER_EXCEEDED RAISED

I have been searching a lot in forums and I've red that the problem is the lenght of each row, not the number of rows (and i've checked this by putting ROWCOUNT = 1 in parameters and still gives the same error). Some people suggest to select fewer fields to solve the lenght problem but i don't know how to do that, maybe someone knows how to do it with SAPRFC and can help me?

This is the error if i execute the function in SAP:

http://i.imgur.com/lg9I1.jpg

And here is the code i am using

//////////////////////

// Connection

$sap = new SAPConnection();
$sap->Connect('logon_data.conf');

if ($sap->GetStatus() == SAPRFC_OK) {
	$sap->Open();
}
else {
	$sap->PrintStatus();
	exit;
}

// Function start
$fce = &$sap->NewFunction ('RFC_READ_TABLE');
if (!$fce) {
	$sap->PrintStatus();
	exit;
}

// Table and parameters
$fce->QUERY_TABLE = 'COEP';
$fce->ROWCOUNT = '1';
$fce->Call();

if ($fce->GetStatus() == SAPRFC_OK) {

	$fce->OPTIONS->Reset();
	$fce->FIELDS->Reset();
	$fce->DATA->Reset();
	while ( $fce->DATA->Next() ) {
		echo $fce->DATA->row['FIELDNAME'];
	}
}
else {
	$fce->PrintStatus();
}

$sap->Close();

Sorry for my poor english.

Thanks!