Skip to Content

HOW TO DO INVENTORY TRANSFER IN DIAPI FOR MULTIPLE LINE ITEMS?

Dear Expert,

This is my code

  1. Dim oDoc As SAPbobsCOM.StockTransfer = oCompany.GetBusinessObject(BoObjectTypes.oStockTransfer)
  2. oDoc.DocDate = Date.Today()
  3. oDoc.FromWarehouse = "01"
  4. oDoc.Lines.ItemCode = "A0001"
  5. oDoc.Lines.WarehouseCode = "02"
  6. oDoc.Lines.Quantity = 10
  7. If oDoc.Add = 0 Then
  8. sbo_application.MessageBox("Stock transfer Issued")
  9. Else
  10. sbo_application.MessageBox(oCompany.GetLastErrorDescription)
  11. End If

Here i did Stock transfer for single item.I need to make it for multiple line items in grid.How can i did it in For loop? please share it soon

Thanks

Manikandan.D

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • Feb 14 at 09:33 AM

    Hi Manikandan. D,

    Use the following line in order to add another line item:

    oDoc.Lines.Add()

    You need to use above mentioned line after the following line:

    oDoc.Lines.Quantity = 10

    Hope it helps!

    Kind regards,

    ANKIT CHAUHAN

    SAP SME Support

    Add comment
    10|10000 characters needed characters exceeded