0

Below is my code : I am able to connect to SAP system and when I am trying to read data from table I am getting below exception. Please any one can help me to figure out the issue. Error message : {success:false, msg: 'Exception raised: TABLE_NOT_AVAILABLE'}

$fce = saprfc_function_discover($rfc, "SAPMOdule"); 
if (! $fce ){
    echo "{success: false, msg: 'Discovering interface of function module  failed'}";
    exit;
}
 saprfc_table_init ($fce,"TableName"); 
 saprfc_import ($fce,"Column1",'0602');
 saprfc_import ($fce,"Column2",'ZA00');
set_time_limit ( 0 );

$rfc_rc = saprfc_call_and_receive ($fce);

if ($rfc_rc != SAPRFC_OK){
    if ($rfc_rc == SAPRFC_EXCEPTION ){
        ExitRFC($rfc, $fce, "false", "Exception raised: " . saprfc_exception($fce));
    }else{
        ExitRFC($rfc, $fce, "false", "Call error: " . saprfc_error($fce));
    }
    exit;
}
Naresh Vm
  • 3
  • 4

2 Answers2

0

Often databases require a domainname.tablename instead of only tablename. I don't know about SAP.

Bert Verhees
  • 1,057
  • 3
  • 14
  • 25
0

The problem is, that the table you are trying to read, is not yet activated in the ABAP DDIC. For more details see my answer to this question: Table_not_available when using JAVA SAP RFC_READ_TABLE

(Just replace the name "LTAP" with the name of your table.)

Lanzelot
  • 15,976
  • 4
  • 18
  • 14