cancel
Showing results for 
Search instead for 
Did you mean: 

OpenForm not working, Error message No Matching Records found

pmbienaime
Discoverer
0 Kudos

Hello,

I have an Excel application that I want to display the SAP object from a data table that I filled.

I'M using SAP B1 9.20.170 PL 07 and Microsoft Excel 2013.

In the code below, I replaced the variable with the real values.

49324 is an AR Invoice (OINV.DocNum) in my database. When I execute the code, my SAP client is opened.

After the OpenForm statement gets executed in Excel VBA (I put in breakpoints), I see in my SAP the following message "No Matching records found 'A/R Invoice' (OINV) (ODBC -2028) [Message 131-183]"

Any clues to what I am missing ?

Thank you.

  Dim oSboGuiApi As New SAPbouiCOM.SboGuiApi
  Dim oSBO_App As SAPbouiCOM.Application
  Dim oForm As SAPbouiCOM.Form
    
  oSboGuiApi.Connect ("0030002C0030002C00530041005000420044005F00440061007400650076002C0050004C006F006D0056004900490056")
  Set oSBO_App = oSboGuiApi.GetApplication(0)
    
  Set oForm = oSBO_App.OpenForm(SAPbouiCOM.BoFormObjectEnum.fo_Invoice, "", "49324")

Accepted Solutions (1)

Accepted Solutions (1)

former_member390407
Contributor
0 Kudos

Hi there,

Are you sure you have an invoice with DocEntry (please note that it is DocEntry not DocNum) 49324?

This code should work fine if you specify the correct object key.

If you want to open a blank form you can specify the empty string:

oSBO_App.OpenForm(SAPbouiCOM.BoFormObjectEnum.fo_Invoice, "", "")


pmbienaime
Discoverer
0 Kudos

You are right.

The key I needed to put was the DocEntry and not the DocNum.

Thank you and good day!

Answers (0)