|
|
|
อยากรู้วิธีเขียน PHP เชื่อมกับ BAPI ของ SAP ครับ Call หา Web service ได้แล้ว แต่ไม่รู้จะโยนค่าเข้าไปยังไง? |
|
|
|
|
|
|
|
ได้แล้วนะครับ
Code (PHP)
$client = new \SoapClient($wsdl, $SOAP_CONFIG);
echo '<pre>';
var_dump($client->__getFunctions());
echo '</pre>';
$head = new \stdClass();
$head->Plant="1100";
$head->ResDate="2020-08-17";
$head->MoveType="241";
$head->GrRcpt="test";
$head->CostCtr="3191112";
$head->AssetNo="000099900001";
$head->SubNumber="";
$head->OrderNo="";
$head->MovePlant="";
$head->MoveStloc="";
$head->CreatedBy="";
$detail = new \stdClass();
$detail->MaterialLong = 'C21-MCAA151';
$detail->Plant = '2100';
$detail->StoreLoc = 'F131';
$detail->Batch = '';
$detail->Quantity = '5';
$detail->ReqDate = '2020-08-17';
$detail->Unit = 'ST';
$detail->ShortText = 'qweasd';
$detail->UnloadPt = '';
$detail->FixedQuan = '1';
$detail->Movement = '1';
$de[] = $detail;
$detail = new \stdClass();
$detail->MaterialLong = 'C21-SWAA001';
$detail->Plant = '2100';
$detail->StoreLoc = 'F131';
$detail->Batch = '';
$detail->Quantity = '10.00';
$detail->ReqDate = '2020-08-17';
$detail->Unit = 'ST';
$detail->ShortText = 'qweasd';
$detail->UnloadPt = '';
$detail->FixedQuan = '1';
$detail->Movement = '1';
$de[] = $detail;
$re = new \stdClass();
$re->item = '';
$main = new \stdClass();
$main->IHeader = $head;
$main->It_Items = $de;
$main->EtReturn = $re;
$result = $client->Zk2BapiIbReservation($main);
ประมาณนี้
|
|
|
|
|
Date :
2020-08-17 17:31:50 |
By :
popfanta |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Load balance : Server 05
|