Skip to Content
0
Former Member
May 05, 2015 at 11:29 AM

You cannot allocate bin locations in document row 1 During Goods Issue using DIAPI on 9.1

704 Views

Hi Experts,

I upgrade from B1 9.0 to 9.1 Patch 4.

So, I have occurred following Error during Good issue using DIAPI on SAP 9.1 PL4. But in SAP 9.0 is is working fine.

Error Msg ---> 1470000465 - You cannot allocate bin locations in document row 1


SAPbobsCOM.Documents oIssue; oIssue = clsAddOn.LDNA_Company.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oInventoryGenExit); GC.Collect(); oIssue.Lines.ItemCode = MatrixItem; oIssue.Lines.Quantity = totalAllEggs1; oIssue.Lines.WarehouseCode = FrmWhrHs; oIssue.Comments = "Good Issue created Based on Inventory Transfer" + DocNum;

SAPbobsCOM.Items oItemM; oItemM = clsAddOn.LDNA_Company.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oItems); oItemM.GetByKey(MatrixItem); if (oItemM.ManageBatchNumbers == SAPbobsCOM.BoYesNoEnum.tYES)

{

ldna_Rec1 = clsAddOn.LDNA_Company.GetBusinessObject(SAPbobsCOM.BoObjectTypes.BoRecordset);

string strBatch1 = "SELECT T0.ObjType, T0.DocEntry , T1.DocLine , T1.ItemCode 'ItemCode' , T3.DistNumber 'Batch Number' , (T1.DocQty/Abs(T1.DocQty)) * T2.Quantity 'AvailableQty', T2.BinAbs 'AbsEntry', T1.LocCode 'Whse' , T4.BinCode 'BinCode' , T1.LogEntry FROM OWTR T0 JOIN OITL T1 ON T0.DocEntry = T1.DocEntry AND T0.ObjType = T1.DocType AND ISNULL(T1.DefinedQty,0)>0 JOIN OBTL T2 ON T1.LogEntry = T2.ITLEntry LEFT JOIN OBTN T3 ON T2.SnBMDAbs = T3.AbsEntry LEFT JOIN OBIN T4 ON T2.BinAbs = T4.AbsEntry WHERE T0.DocEntry = (select DocEntry from OWTR where DocNum ='" + DocNum + "' and Series = '" + Series1.Trim() + "') ORDER BY T0.DocEntry, T1.DocLine, T1.LogEntry";

ldna_Rec1.DoQuery(strBatch1);

string BatchNo = ldna_Rec1.Fields.Item("Batch Number").Value;

double Qty = totalAllEggs1;

int iBatchLine = 0; //Updated Here

while (!ldna_Rec1.EoF && Qty > 0)

{

string BatchNo1 = ldna_Rec1.Fields.Item("Batch Number").Value;

int binAbsI = ldna_Rec1.Fields.Item("AbsEntry").Value;

if (BatchNo.Length > 0)

{

if (iBatchLine > 0) oIssue.Lines.BatchNumbers.Add(); //Updated Here

oIssue.Lines.BatchNumbers.BatchNumber = ldna_Rec1.Fields.Item("Batch Number").Value;

double BatchQty = 0;

if (Qty > ldna_Rec1.Fields.Item("AvailableQty").Value)

BatchQty = ldna_Rec1.Fields.Item("AvailableQty").Value;

else

BatchQty = Qty;

oIssue.Lines.BatchNumbers.Quantity = BatchQty;

Qty = Qty - BatchQty;

oIssue.Lines.BinAllocations.BinAbsEntry = binAbsI;

SAPbobsCOM.DocumentLinesBinAllocations binI = oIssue.Lines.BinAllocations;

binI.SerialAndBatchNumbersBaseLine = iBatchLine; //Updated Here

binI.BinAbsEntry = binAbsI;

binI.Quantity = BatchQty; //qty

binI.Add();

ldna_Rec1.MoveNext();

if (Qty <= 0)

break;

iBatchLine++; //Updated Here

}

}

}

if (oIssue.Add() == 0)

{

clsAddOn.LDNA_Application.StatusBar.SetText("Goods Issue entry Sucessfully.", SAPbouiCOM.BoMessageTime.bmt_Medium, SAPbouiCOM.BoStatusBarMessageType.smt_Success);

}

else

{

BubbleEvent = false;

clsAddOn.LDNA_Application.StatusBar.SetText(clsAddOn.LDNA_Company.GetLastErrorDescription(), SAPbouiCOM.BoMessageTime.bmt_Medium, SAPbouiCOM.BoStatusBarMessageType.smt_Error);

return;

}

System.Runtime.InteropServices.Marshal.ReleaseComObject(oIssue);

oIssue = null;

GC.Collect();

So please help me as soon as possible.

Thank You All

Pradeep Khodke.