ATTENTION: THIS IS WORK IN PROGRESS AND NOT TO BE USED UNTIL THIS MESSAGE DISAPPEARS!
PHP/SAP defines a layer of abstraction between actual SAP remote function calls and your PHP-Code. As to why this project has been created and which goals it wants to achieve, you can read the motivation.
The interfaces define a common denominator on how to configure a connection to SAP, prepare a SAP remote function call, and invoke a SAP remote function call.
The common classes and exceptions add logic that is not specific to the underlying PHP module.
The module specific implementations contain code that is specific to the underlying PHP-module.
Especially short explanation for people in a hurry.
Use composer require
to add PHP/SAP to your project. Depending on the
PHP module you need to require a certain PHP/SAP composer
package.
Module Author | Module | supported PHP versions | composer require |
---|---|---|---|
Eduard Koucky | saprfc |
PHP 4.x - 5.5.x | composer require php-sap/saprfc-koucky |
Piers Harding | sapnwrfc |
PHP 5.x | composer require php-sap/saprfc-harding |
Gregor Kralik | sapnwrfc |
PHP 7.x | composer require php-sap/saprfc-kralik |
<?php
use phpsap\saprfc\SapRfcConfigA;
use phpsap\saprfc\SapRfcConnection;
$result = (new SapRfcConnection(new SapRfcConfigA([
'ashost' => 'sap.example.com',
'sysnr' => '001',
'client' => '002',
'user' => 'username',
'passwd' => 'password'
])))
->prepareFunction('MY_COOL_SAP_REMOTE_FUNCTION')
->setParam('INPUT_PARAM', 'some input value')
->invoke();