Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

How to find invoice

Hi,

I want to find an invoice using DI-Api.

I use getbykey(invoicenumber) but there is no invoice found, but the invoice exists in SBO.

Does anyone have a working example?

replied

Hi,

Yes, example (in VB.NET):

Dim rs As SAPbobsCOM.Recordset

Dim query As String

Dim docnum As Integer

Try

query = "SELECT DocEntry FROM OINV WHERE DocNum = 20050001"

rs = oCmp.GetBusinessObject(SAPbobsCOM.BoObjectTypes.BoRecordset)

rs.DoQuery(query)

Console.WriteLine("aantal regels ", rs.RecordCount) If rs.RecordCount > 0 Then Console.WriteLine("DocEntry: ", rs.Fields.Item(0).Value)

End If

Catch e As Exception

Dim message As String = _

e.[GetType].ToString + ":" + vbCrLf + _

e.Message + vbCrLf + _

e.StackTrace

Console.Error.WriteLine(message)

MsgBox(message, MsgBoxStyle.Critical)

End Try

Regards,

Jacco

Message was edited by: J. Moolenaar

0 View this answer in context

Helpful Answer

by
Not what you were looking for? View more on this topic or Ask a question