Quantcast
Channel: SCN: Message List
Viewing all articles
Browse latest Browse all 3585

DI API: Picking list with different sales orders, error when pick up at different times.

$
0
0

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.

 

img001.jpg

img002.jpg

img003.jpg

In advance thanks and regards.


Viewing all articles
Browse latest Browse all 3585

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>