Hello experts, I need your valuable assistance.
The issue is this, I have a pick list with different sales orders and by di api at different times I make the picking for each sales order. I have no problems with the first pick, but when I try to do it at another time throws me the following error:
1470000344 - Batch "NACIONAL" of item "DTC-C73-PVC3-0001" in bin location "QRO-GEN-ZR1" falls into negative inventory
My function (SAP BO 9.1 PL11):
int lRetCode = -1;
SAPbobsCOM.PickLists oPick = vCmp.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oPickLists);
int sPL = 1502;
try
{
if (oPick.GetByKey(sPL))
{
oPick.Lines.SetCurrentLine(0);
oPick.Lines.PickedQuantity = 1;
//oPick.Lines.OrderEntry = 16436;
//oPick.Lines.OrderRowID = 4;
oPick.Lines.BatchNumbers.BatchNumber = "NACIONAL";
oPick.Lines.BatchNumbers.Quantity = 1;
oPick.Lines.BatchNumbers.Add();
oPick.Lines.BinAllocations.BinAbsEntry = 149;
oPick.Lines.BinAllocations.Quantity = 1;
oPick.Lines.BinAllocations.SerialAndBatchNumbersBaseLine = 0;
oPick.Lines.BinAllocations.BaseLineNumber = 0;
oPick.Lines.BinAllocations.Add();
lRetCode = oPick.Update();
if (lRetCode != 0)
{
string sErr = string.Empty;
vCmp.GetLastError(out lRetCode, out sErr);
return sErr;
// Console.WriteLine(sErr);
}
return"OK";
}
else
return"No se encuentra documento";
}
catch (Exception ex)
{
return ex.Message;
}
The problem is when I do the picking in different time for another sales order picking the same picking list.
In advance thanks and regards.