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

try 
{
    session_start();
    $Groupe = $_GET["Groupe"];

    $sap = Login();
    $ItemsList = $sap->getService("view.svc/B1_GetItemsB1SLQuery");
    $Items_result = $ItemsList->queryBuilder()
    ->select('Groupe,ItemCode,ItemName')
    ->where(new Equal("Groupe", $Groupe ))
    ->findAll(); 

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

 

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