PHP code example of protendai / sap-business-one

1. Go to this page and download the library: Download protendai/sap-business-one 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/ */

    

protendai / sap-business-one example snippets


    Protendai\SapBusinessOne\SapBusinessOneServiceProvider::class

    'SAPClient' => Protendai\SapBusinessOne\SAPClient::class,

    use Protendai\SapBusinessOne\SAPClient;

    $sap = SAPClient::createSession('SAP UserName', 'SAP Password', 'Company DB');

    $session = $sap->getSession();

    $sap = new SAPClient(config('sap.sap') ,$session);
    $orders = $sap->getService('Orders');
    $result = $orders->queryBuilder()
    ->select('DocEntry,DocNum')
    ->orderBy('DocNum', 'asc')
    ->limit(5)
    ->findAll();
shell
    php artisan vendor:publish --provider="Protendai\SapBusinessOne\SapBusinessOneServiceProvider"
shell
    php artisan config:cache