cancel
Showing results for 
Search instead for 
Did you mean: 

Inventory Transfer record not getting added

ramco1917
Participant
0 Kudos
128

Hi

  I have below code but record not getting added.

Getting error - 1470000838 - Invalid "SerialAndBatchNumbersBaseLine"; specify a valid "SerialAndBatchNumbersBaseLine"

oTfr = oCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oStockTransfer);

//oGrpo.GetByKey(Convert.ToInt32(DocEntry));
//oPOrder.GetByKey(sOrder)

oTfr.FromWarehouse = "PM";
oTfr.ToWarehouse = "PM1H";
oTfr.DocDate = DateTime.Now;
oTfr.DocObjectCode = SAPbobsCOM.BoObjectTypes.oStockTransfer;

oTfr.Lines.ItemCode = "RM10000020US";
oTfr.Lines.Quantity = 5;
oTfr.Lines.WarehouseCode = "PM1H";
oTfr.Lines.BinAllocations.SetCurrentLine(0);
oTfr.Lines.BinAllocations.BinActionType = SAPbobsCOM.BinActionTypeEnum.batFromWarehouse; oTfr.Lines.BinAllocations.BinAbsEntry = 2;
oTfr.Lines.BinAllocations.Quantity = 5;
oTfr.Lines.BinAllocations.Add();
oTfr.Lines.BinAllocations.SetCurrentLine(1);
oTfr.Lines.BinAllocations.BinActionType = SAPbobsCOM.BinActionTypeEnum.batToWarehouse; oTfr.Lines.BinAllocations.BinAbsEntry = 100;
oTfr.Lines.BinAllocations.Quantity = 5;
oTfr.Lines.BinAllocations.Add();
oTfr.Lines.Add();

Thanks

Accepted Solutions (0)

Answers (2)

Answers (2)

jitin_chawla
Product and Topic Expert
Product and Topic Expert

Hi,

Check SAP Note 1937920 - How to import serial/batch with Binlocation using DTW. The same records the reported message which you are getting.

Kindly check and see if that helps.

Kr,

Jitin

Johan_Hakkesteegt
Active Contributor
0 Kudos

Hi,

A basic premise in B1 is that the first line is already there. I know it is a little counter intuitive, but adding a line actualy creates a new one, that the system then expects you to fill in.

Please drop the last line: oTfr.Lines.BinAllocations.Add();

Regards,

Johan