Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

problem calling function

Hi,

i have creted a function module which read stock quantity using BAPI_MATERIAL_AVAILABILITY.

Import - MFRPN

Export - QNTY

If i execute function module from SAP the result it's OK but when i call function from PHP it does not output nothing.

$sap = new saprfc(array(
							"logindata"=>array(
								"ASHOST"=>"192.168.3.1"		// application server
								,"SYSNR"=>"00"				// system number
								,"CLIENT"=>"200"			// client
								,"USER"=>"rfc"			// user
								,"PASSWD"=>"123456789"		// password
								)
							,"show_errors"=>true			// let class printout errors
							,"debug"=>false)) ; 				// detailed debugging information
		// Call-Function


		// Call-Function
		$result=$sap->callFunction("Z_READ_QNTY",
											  array(
													array("IMPORT","MFRPN",$_POST['cod']),
													array("EXPORT","QNTY",$quantity),
													)
									  );

		// Call successfull?
		if ($sap->getStatus() == SAPRFC_OK)
		{
			echo $quantity;
		}
		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()
		}

Please someone help me.

Thank you.

Former Member
Not what you were looking for? View more on this topic or Ask a question