I am running a script from Excel and would like to loop through rows in a table in order to obtain values for each line in a table. Here is what I basically need to do:
Go to a page with a table in SAP GUI
Double click on a line, which brings me to a window with values that I need to copy and insert in a spreadsheet.
Loop through an entire table in the same fashion and repeat a procedure in SAP GUI.
The attached pictures show tables I am working with. I am not sure which of them are real tables that can be declared as Objects. I tried to run a code but it returns an error which concerns RowCount
:
The object does not support this property or method
Code:
Dim Table As Object
Dim rows As Long
Dim i As Long
Set Table = Session.FindById("wnd[0]/usr/cntlUSAGE_TREE_CONTAINER/shellcont/shell/shellcont[1]/shell[1]")
rows = Table.RowCount - 1
For i = 0 To rows
Session.FindById("wnd[0]/usr/cntlUSAGE_TREE_CONTAINER/shellcont/shell/shellcont[1]/shell").selectedNode = " i"
Session.FindById("wnd[0]/usr/cntlUSAGE_TREE_CONTAINER/shellcont/shell/shellcont[1]/shell").doubleClickNode " i"
Next i