on 11-16-2017 2:13 PM
Hello,
I have the following code that I am using to transfer goods from one warehouse to another. Some items are batched.
How do I get to set batch numbers to auto-select in the same way you have the option of pressing the "auto select" button when on the B1 client?
Any help appreciated.
SAPbobsCOM.StockTransfer sboSTs = SboConnection.Company.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oStockTransfer);
// Set properties of the Inventory Transfer object
// Add the header
sboSTs.DocDate = DateTime.Now;
sboSTs.TaxDate = DateTime.Now;
sboSTs.FromWarehouse = "01";
sboSTs.ToWarehouse = "06";
sboSTs.JournalMemo = jobNumber;
// Add the lines
dictionary.ToList().ForEach(x =>
{
sboSTs.Lines.ItemCode = (x.Value.First().Profile.Replace("*", "X") + "-" + x.Value.First().Grade);
sboSTs.Lines.FromWarehouseCode = "01";
sboSTs.Lines.WarehouseCode = "06";
sboSTs.Lines.Quantity = x.Value.Sum(s => Convert.ToDouble(s.Quantity));
sboSTs.Lines.ProjectCode = jobNumber;
sboSTs.Lines.BatchNumbers.Quantity = x.Value.Sum(s => Convert.ToDouble(s.Quantity));
sboSTs.Lines.Add();
});
Kinyanjui
Hi,
I think you can not assign batch number automatically through DI API. You will have to look them up in the OBTQ and set them according to quantity.
Also have a look at this: https://archive.sap.com/discussions/thread/2104024
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
100 | |
12 | |
11 | |
6 | |
6 | |
4 | |
3 | |
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.