PHP code example of php-sap / saprfc-harding
1. Go to this page and download the library: Download php-sap/saprfc-harding library. Choose the download type require. 2. Extract the ZIP file and open the index.php. 3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
php-sap / saprfc-harding example snippets
//Include the composer autoloader ...
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 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;