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
Request clarification before answering.
| User | Count |
|---|---|
| 4 | |
| 4 | |
| 4 | |
| 3 | |
| 2 | |
| 2 | |
| 2 | |
| 2 | |
| 2 | |
| 2 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.