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

try 
{
    session_start();

    $Groupe = $_GET["Groupe"];

    $sap = Login();
    $ItemsList = $sap->getService("Items");
    $ItemsList->headers(['Prefer' => 'odata.maxpagesize=777740']);
    $Items_result = $ItemsList->queryBuilder()
    ->select('ItemCode,ItemName,ManageBatchNumbers')
    ->where(new Equal("Valid", "tYES" ))
    ->findAll();

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

 

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