Skip to Content

SAPB1 DI API produces -1116 error on commit to add Production Order

I tried - using SAP B1 DI API - to add a Production Order I received -1116 error on commit. The error text is 'Could not commit transaction: Error -1 detected during transaction'. I didn't find -1116 error in the list of SAPB1 DI API errors.

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • Feb 20 at 09:50 AM

    Hi Tiberiu-Alexandru Galos,

    The mentioned issue/scenario does not look complete.

    Questions that are well worded, detailed questions are the best to get an answer. Even adding an image when necessary can help others to see the issue and possibly solve it.

    Therefore, always try to mention the complete issue along with the sample code and screenshot about the issue. Also mention which SAP Business One Version, you are using.

    Kind regards,

    ANKIT CHAUHAN

    SAP SME Support

    Add comment
    10|10000 characters needed characters exceeded

  • Feb 20 at 11:08 AM

    I am using SAP B1 version 910180.

    The code looks like

                    ProductionOrders _po;
                    _po = (ProductionOrders)(company.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oProductionOrders));
                    _po.ItemNo = <ItemCode>;
                    _po.PostingDate = <Date>;
                    _po.DueDate = <Date>;
                    _po.ClosingDate = <Date>;
                    _po.Warehouse = <Warehouse>;
                    _po.ProductionOrderType = BoProductionOrderTypeEnum.bopotSpecial;
                    _po.Lines.ItemType = ProductionItemType.pit_Item;
                    _po.Lines.ItemNo = <ItemComponentCode>;
                    _po.Lines.Warehouse = <Warehouse>;
                    _po.Lines.BaseQuantity = 1;
                    _po.Lines.PlannedQuantity = _po.Lines.BaseQuantity * _po.PlannedQuantity;
                    int _i = _po.Add();
                    int _docEntry = -1;
                    int _errNo = 0;
                    string _errMsg = String.Empty;
                    if (_i != 0)
                    {
                      company.GetLastError(out _errNo, out _errMsg);
                    }
                    else
                    {
                      _docEntry = int.Parse(company.GetNewObjectKey());
                    }
                    System.Console.WriteLine(String.Format("Add ProductionOrders: _i={0},_docEntry={1},_errNo={2},_errMsg={3}"                     , _i //0
                        , _docEntry //1
                        , _errNo //2
                        , _errMsg //3
                    ));

    The final answer is

    Add ProductionOrders: _i=-1116,_docEntry=-1,_errNo=-1116,_errMsg=Could not commit transaction: Error -1 detected during transaction

    Add comment
    10|10000 characters needed characters exceeded