on 07-23-2015 11:02 AM
This is the first time I used PHP to call a SAP function. Ran into this problem that I couldn’t figure until someone with experience helped me.
This is the code used -- to fetch data from Saprfc to php
<html>
<h1>SAPRFC-Class</h1>
<?php
// saprfc-class-library
require_once("saprfc.php");
// Create saprfc-instance
$sap = new saprfc(array(
"logindata"=>array(
"ASHOST"=>"" // application server
,"SYSNR"=>"" // system number
,"CLIENT"=>"" // client
,"USER"=>"" // user
,"PASSWD"=>"" // password
)
,"show_errors"=>false // let class printout errors
,"debug"=>true)) ; // detailed debugging information
// Call-Function
$result=$sap->callFunction("ZBAPI",
array( array("IMPORT","FROM_","100"),
array("EXPORT","RETURN",""),
array("TABLE","Namesdata",array())
));
//var_dump($result);
// Call successfull?
if ($sap->getStatus() == SAPRFC_OK) {
// Yes, print out the Userlist
?><table>
<?php
//$sap->printStatus();
foreach ($result["Namesdata"] as $orders) {
echo "<tr><td>", $orders["name"],"</td><td>",$orders["form"],"</td> <td>",$orders["Names"],"</td></tr>";
}
?></table><?php
} else {
$sap->printStatus();
}
$sap->logoff();
?>
error appers like
saprfc::callFunction('ZBAPI')
Import-Parameter=FROM_ could not be set. (Does it exist?)
if i comment the IMPORT array means its displays data how to solve the issue .. whats wrong in this line -- array("IMPORT","FROM_","100"),
A simple example. Tested and running.
http://acelikbilek.net/index.php/2016/02/26/php-ile-sap-rfc-baglanti/
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
89 | |
10 | |
9 | |
9 | |
9 | |
6 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.