Extract a table from SAP

Hi!
I wanted to extract a specific field in a table from SAP.

However, when testing with more examples I realized that the table can change, as it may have fewer or higher number of columns.

So, I am trying to extract the SAP table as a table and put into a collection in Blue Prism by using the code stage.

Can anyone help me with this?

Dim SapGuiAuto As Object
Dim Session As Object
Dim Application As Object
Dim Connection As Object
Dim Grid As Object

SapGuiAuto = GetObject("SAPGUI")
Application = SapGuiAuto.GetScriptingEngine
Connection = Application.Children(0)
Session = Connection.Children(0)
Grid = session.findById("wnd[0]/usr/subSUB0:SAPLMEGUI:0010/subSUB2:SAPLMEVIEWS:1100/subSUB2:SAPLMEVIEWS:1200/subSUB1:SAPLMEGUI:1211/tblSAPLMEGUITC_1211/btnMEPO1211-STATUSICON[0,0]")

'Get Table Properties (Row and Column counts)
Rows = Grid.RowCount
Columns = Grid.ColumnCount

'Position on a specific Row
Grid.currentCellRow = RowIndex

'Get the desired value
getSAPfield = Grid.getCellValue(RowIndex, "LOC")


With this code, I am getting the error
Description: Compiler error at line 7: 'GetObject' is not declared. It may be inaccessible due to its protection level.
 
Top