php-sap / saprfc-kralik
PHP/SAP implementation for Gregor Kraliks sapnwrfc module. See https://php-sap.github.io for details.
v5.0.3
2026-09-01 12:11 UTC
Requires
- php: ^8.1
- ext-sapnwrfc: ^2.1
- php-sap/common: ^6.2.0
- php-sap/interfaces: ^5.1.6
Requires (Dev)
- ext-json: *
- php-sap/integration-tests: ^8.0.1
- phpstan/phpstan: ^2.2.3
- phpunit/phpunit: ^9.6.33
- squizlabs/php_codesniffer: ^4.0
Suggests
None
Provides
None
Conflicts
- kba-team/php-sapnwrfc-harding: *
- kba-team/php-sapnwrfc-kralik: *
- php-sap/saprfc-harding: *
- php-sap/saprfc-koucky: *
Replaces
None
This package is auto-updated.
Last update: 2026-09-01 12:13:41 UTC
README
This repository implements the PHP/SAP interface for Gregor Kraliks sapnwrfc PHP module.
Usage
composer require php-sap/saprfc-kralik
<?php //Include the composer autoloader ... require_once 'vendor/autoload.php'; //... and add the namespaces of the classes used. use phpsap\classes\Config\ConfigTypeA; use phpsap\DateTime\SapDateTime; use phpsap\saprfc\SapRfc; /** * Create an instance of the SAP remote function using its * name, input parameters, and connection configuration. * * The imaginary SAP remote function requires a * date as input and will return a date as output. * * In this case the configuration array is defined manually. */ $result = SapRfc::create( 'MY_COOL_SAP_REMOTE_FUNCTION', [ 'IV_DATE' => (new DateTime('2019-12-31')) ->format(SapDateTime::SAP_DATE) ], new ConfigTypeA([ ConfigTypeA::JSON_ASHOST => 'sap.example.com', ConfigTypeA::JSON_SYSNR => '999', ConfigTypeA::JSON_CLIENT => '001', ConfigTypeA::JSON_USER => 'username', ConfigTypeA::JSON_PASSWD => 'password' ]) )->invoke(); //The output array contains a DateTime object. echo $result['OV_DATE']->format('Y-m-d') . PHP_EOL;
For further documentation, please read the documentation on PHP/SAP!
Development
All development commands (install, test, lint, analyze, beautify, sniff, audit,
validate) run via Docker through the Makefile, so no local PHP installation is
needed. Run make help to list all targets. Most targets require PHP_VERSION,
e.g.:
make install PHP_VERSION=8.1