简体   繁体   中英

I am getting error “TABLE_NOT_AVAILABLE” when using PHP SAP RFC reading table data

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;
}

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

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.)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM