on 05-14-2013 2:38 PM
I am writing an application that uses the DI API to create an inventory transfer between warehouse AND bin locations (new to version 9.0) in SAP B1 9.0 PL01. I am struggling with adding the bin locations to the inventory transfer object. I receive the following error:
-5002-1470000465 - You cannot allocate bin locations in document row 1
Can someone please show me where I am going wrong with this? Here is my code:
SAPbobsCOM.StockTransfer transfer = (SAPbobsCOM.StockTransfer)sapCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oStockTransfer);
transfer.DocDate = DateTime.Now;
transfer.FromWarehouse = fromWhs;
transfer.ToWarehouse = toWhs;
transfer.Lines.SetCurrentLine(0);
transfer.Lines.ItemCode = itemCode;
transfer.Lines.FromWarehouseCode = fromWhs;
transfer.Lines.WarehouseCode = toWhs;
transfer.Lines.Quantity = quantity;
if (batchCtl)
{
transfer.Lines.BatchNumbers.SetCurrentLine(0);
transfer.Lines.BatchNumbers.BatchNumber = userLotNumber;
transfer.Lines.BatchNumbers.Quantity = quantity;
transfer.Lines.BatchNumbers.Add();
}
else
{
if (serialCtl)
{
transfer.Lines.SerialNumbers.SetCurrentLine(0);
transfer.Lines.SerialNumbers.ManufacturerSerialNumber = userLotNumber;
transfer.Lines.SerialNumbers.Quantity = quantity;
transfer.Lines.SerialNumbers.Add();
}
}
transfer.Lines.BinAllocations.SetCurrentLine(0);
transfer.Lines.BinAllocations.BinActionType = SAPbobsCOM.BinActionTypeEnum.batFromWarehouse;
transfer.Lines.BinAllocations.BinAbsEntry = fromLocation;
transfer.Lines.BinAllocations.Quantity = quantity;
transfer.Lines.BinAllocations.Add();
transfer.Lines.BinAllocations.SetCurrentLine(1);
transfer.Lines.BinAllocations.BinActionType = SAPbobsCOM.BinActionTypeEnum.batToWarehouse;
transfer.Lines.BinAllocations.BinAbsEntry = toLocation;
transfer.Lines.BinAllocations.Quantity = quantity;
transfer.Lines.BinAllocations.Add();
int returnCode = transfer.Add();
Thank you in advance
Hello,
I was solve this issue.
Change:
transfer.Lines.BinAllocations.BinActionType = SAPbobsCOM.BinActionTypeEnum.batFromWarehouse;
With
transfer.Lines.BinAllocations.BinActionType = 2
Regards,
Leonardo San Martín.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello
Please note the description from the Overview for this SCN Space:
Official SAP Help Portal Community. Find comments on SAP product documentation (such as SAP Application Help, also known as SAP Library), and read best practices shared by the community.
Based do the above, I believe you posted your query into the incorrect SCN Space. Please use the Forum Finder for the New SCN document to find your product and post into that SCN Space.
With best regards,
- Ludek
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
108 | |
12 | |
11 | |
6 | |
6 | |
4 | |
4 | |
3 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.