cancel
Showing results for 
Search instead for 
Did you mean: 
Subscribe

Hi,

I have been struggling with understanding how to loop through a table in SAP. Just to give some context, here is what I basically need to do:

1. Go to a page in SAP with a table

2. Double click on a line, which brings me to a window with values that I need to copy and insert it in a spreadsheet.

3. Loop through an entire table in the same fashion and repeat a procedure.

The object I am going through has the following code:

Session.FindById("wnd[0]/usr/cntlUSAGE_TREE_CONTAINER/shellcont/shell/shellcont[1]/shell").selectedNode = " 5" Session.FindById("wnd[0]/usr/cntlUSAGE_TREE_CONTAINER/shellcont/shell/shellcont[1]/shell").doubleClickNode " 5"

I am new to SAP and googled many instances already. I still have not figured out how to write the code in my case. Any recommendations will be appreciated.

My code returns error "The object does not support this property or method" (RowCount)

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

0 Likes

Accepted Solutions (0)

Answers (0)