on 05-15-2008 1:20 PM
Dear all in am unable to retrive data from sap using BAPI
BAPI_SALESORDER_GETLIST in PHP .
please checked what worng in prgram
<html>
<h1>SAPRFC-Class: ---PHP</h1>
<?php
// Example for using the saprfc-class-library for accessing sap-functions via rfc
// provided by lars laegner, btexx business technologies, august 2001
// !!!! PLEASE CHANGE THE LOGINDATA TO YOUR SAP-SYSTEM !!!!
// saprfc-class-library
require_once("saprfc.php");
// Create saprfc-instance
$sap = new saprfc(array(
"logindata"=>array(
"ASHOST"=>"1.11.213.7" // application server
,"SYSNR"=>"00" // system number
,"CLIENT"=>"500" // client
,"USER"=>"abcuser" // user
,"PASSWD"=>"abcpass" // password
)
,"show_errors"=>false // let class printout errors
,"debug"=>true)) ; // detailed debugging information
// Call-Function
$result=$sap->callFunction("BAPI_SALESORDER_GETLIST",
array( array("IMPORT","CUSTOMER_NUMBER",100000),
array("IMPORT","SALES_ORGANIZATION",1000),
array("EXPORT","RETURN",""),
array("TABLE","SALES_ORDERS",array())
));
// Call successfull?
if ($sap->getStatus() == SAPRFC_OK) {
// Yes, print out the Userlist
?><table>
<tr><td>SD_DOC</td><td>SHORT_TEXT</td></tr><?php
//$sap->printStatus();
//var_dump($result);
foreach ($result["SALES_ORDERS"] as $orders) {
echo "<tr><td>", $orders["SD_DOC"],"</td><td>",$orders["SHORT_TEXT"],"</td></tr>";
}
?></table><?php
} else {
// No, print long Version of last Error
$sap->printStatus();
// or print your own error-message with the strings received from
// $sap->getStatusText() or $sap->getStatusTextLong()
}
// Logoff/Close saprfc-connection LL/2001-08
$sap->logoff();
?>
Hi shahid ranazai
i think you should try to set the Customer Number to:
array("IMPORT","CUSTOMER_NUMBER","000100000")
also I would suggest that you fill the parameters DOCUMENT_DATE and DOCUMENT_DATE_TO to restrict the number of returned sales orders.
Have you tried the Function Module in SE37?
Best regards
Gregor
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
I am not sure about this code:
$sap = new saprfc(array(
"logindata"=>array(
"ASHOST"=>"1.11.213.7" // application server
,"SYSNR"=>"00" // system number
,"CLIENT"=>"500" // client
,"USER"=>"abcuser" // user
,"PASSWD"=>"abcpass" // password
Also are you using sqlserver.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
87 | |
10 | |
10 | |
10 | |
7 | |
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.