cancel
Showing results for 
Search instead for 
Did you mean: 

Error adding a inventory transfer with batchs

Former Member
0 Kudos

Hello,

I am trying to add an inventory transfer. This transfer consists on only one document row which quantity is 111 and item code is GUELV90. This item is batch managed and so, we have to tell SAP about the batchs involved in the transfer. The batch num is given in 3 times (though the batch num is the same, but it must be done this way, because the data will be load separately). First time: 1 unit, second time, 10 units and finally 100 units.

The transfer is added and when looking at it at SAP we have a strange situation: the transfer has 1 document row with quantity 111 (this is OK), but when looking the batch report of the transfer, only 11 units have been transfered!!!

I have made a lot of examples and I think that SAP only adds 2 batch quantity and the followings are ignored!!! I mean, for the same batch number the third and followings add() are ignored... This could be an DI-API error... ¿?

I wonder if any of you have dealed with this problem before,.... or if you can advise me someway...

Thank you in advance for any comment

(I use: SAP 2007A PL42)

(traspaso=transfer)

traspaso = oCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oStockTransfer)

traspaso.DocDate = Today().ToShortDateString()

traspaso.FromWarehouse = "01"

traspaso.Comments = "........"

traspaso.Lines.ItemCode = "GUELV90"

traspaso.Lines.Quantity = 111

traspaso.Lines.WarehouseCode = "FG01"

traspaso.Lines.BatchNumbers.Add()

traspaso.Lines.BatchNumbers.BatchNumber = "V90004"

traspaso.Lines.BatchNumbers.Quantity = 1

traspaso.Lines.BatchNumbers.Add()

traspaso.Lines.BatchNumbers.BatchNumber = "V90004"

traspaso.Lines.BatchNumbers.Quantity = 10

traspaso.Lines.BatchNumbers.Add() 'This one is ignored!!! Why?

traspaso.Lines.BatchNumbers.BatchNumber = "V90004"

traspaso.Lines.BatchNumbers.Quantity = 100

traspaso.Lines.Add()

traspaso.Add()

Vanessa

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Vanessa,

remove the traspaso.Lines.Add() code at the end. if this is just one item then that line will be automatically added. and it is understandable that you have hardcoded the example to put here on the forum. you will be having a loop where you have to put condition before writing that line,

See if it works.

thanks,

Binita

Former Member
0 Kudos

Hello Binita,

Thank you for your quick answer

I did remove the line code you mentioned. Unfortunately, nothing changes The quantity at row level is 111, but for the batches is 11!!

Regards,

Vanessa