0

I cannot connect to SAP using PHP sapnwrfc, this is my code :

use SAPNWRFC\Connection as SapConnection;
use SAPNWRFC\Exception as SapException;

$config = [
  'GROUP'     => '*****', // Group/Server
  'MSHOST'    => '*****', // Message Server
  'CLIENT'    => '*****', // System ID
  'SYSNR'     => '*****', // Instance Number
  'USER'      => '*****', // Username
  'PASSWD'    => '*****', // Password
  'SAPROUTER' => '*****', // SAP Router
  'TRACE'     => SapConnection::TRACE_LEVEL_OFF, // Trace
];

try {
   $c = new SapConnection($config);

   $f = $c->getFunction('*****');
   $result =  $f->invoke();

   echo "<pre>";
   print_r($result);
   echo "<pre>";
} catch(SapException $ex) {
   echo 'Exception: ' . $ex->getMessage() . PHP_EOL;
}

Is there something wrong? Please help me. Thankyou in advance.

Sandra Rossi
  • 11,934
  • 5
  • 22
  • 48
Dewa Aditya
  • 79
  • 1
  • 2
  • 9

0 Answers0