

<?php 
include "functions.php";
use SAPb1\Filters\Equal;
use SAPb1\Filters\InArray;

try 
{
    session_start();

    $sap = Login();
    $ItemsList = $sap->getService("Warehouses");
    $ItemsList->headers(['Prefer' => 'odata.maxpagesize=777740']);
    $Items_result = $ItemsList->queryBuilder()
    ->select('WarehouseCode,WarehouseName')
    ->findAll();

    $Items = json_decode(json_encode($Items_result), TRUE);
    echo json_encode($Items['value']);

} catch (Exception $e) {
    echo $e->getMessage();    
}