Skip to Content
avatar image
Former Member

PHP create SalesOrder throws 'Field cannot be updated (ODBC -1029)'

Hello,

we worked with SAP B1 9.1 - BI API everything was ok. After upgrade to SAP 9.2 we get the ODBC 1029 error by initialisation of the SalesOrder. We can update existing SalesOrders, but when we create a new one we get the error. Here is our code:

$vCmp = new \COM(static::COM_MODULE_NAME, null, CP_UTF8);
        $vCmp->DbServerType = static::SAP_DB_SERVER_TYPE;
        $vCmp->Server = $server;
        $vCmp->CompanyDB = $dbName;
        $vCmp->LicenseServer = $licenseServer;
        $vCmp->UserName = $user;
        $vCmp->Password = $password;
        $vCmp->DbUserName = $dbUser;
        $vCmp->DbPassword = $dbPassword;


        $ret = $vCmp->Connect();


        if (0 != $ret) {
            throw new SAPException("Failed to connect to SAP host \"$server\". Return code: ".$ret);
        }


$order = $vCmp->GetBusinessObject(17);
$order->CardCode = $this->setStringValue($data, 'CardCode');
$order->CardName = $this->setStringValue($data, 'CardName');
$order->DocDueDate = MessageNormalizer::sapDateFormat($data['DocDueDate']);
$order->DocDate = MessageNormalizer::sapDateFormat($data['TaxDate']);
$order->NumAtCard = $this->setStringValue($data, 'AmazonOrderId');
$order->TaxDate = MessageNormalizer::sapDateFormat($data['TaxDate']);
$order->DocCurrency = $this->setStringValue($data, 'DocCurrency');
$order->PaymentMethod = $this->setStringValue($data, 'PaymentMethod');
$order->PaymentGroupCode = $this->setStringValue($data, 'PaymentGroupCode');

For all fields we get:

-1029: [ORDR.GroupNum] , 'Field cannot be updated (ODBC -1029)'
-1029: [ORDR.CardName] , 'Field cannot be updated (ODBC -1029)'
-1029: [ORDR.DocDueDate] , 'Field cannot be updated (ODBC -1029)'

Any suggestions?

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

0 Answers