Skip to Content

OpenForm not working, Error message No Matching Records found

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")
Add comment
10|10000 characters needed characters exceeded

  • Follow
  • Get RSS Feed

1 Answer

  • Best Answer
    Aug 13, 2018 at 08:39 AM

    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, "", "")


    Add comment
    10|10000 characters needed characters exceeded