0

Need to insert variables to iterate over an SAP GUI table using a VBS script. The below error keeps coming up. What am I missing?

"list delimiter" or ")" missing

I have iterated over tables in SAP GUI in the past but I can't figure out what's different in the following code.

Dim Row_Numb
Dim i_col
Dim j_col
Dim k_col


Row_Numb = 0
i_col = 0
j_col = 1
k_col = 2
             
While items_in_class <> ""
      i_col = CStr(i_col)
      j_col = CStr(j_col)
      k_col = CStr(k_col)

'Original line from Script recording. This works
'Cells(6, 3).Value = SapSession.FindById("wnd[0]/usr/tabsTABSTR/tabpMERK/ssubSUB:SAPLCLMO:0130/tblSAPLCLMOMERKMAL/txtRMCLM-SMERKB[1,1]").Text

'Replacing [1,1] with variables Row_Num and variable to iterate. It doesn't work
Cells(6, 3).Value = SapSession.FindById("wnd[0]/usr/tabsTABSTR/tabpMERK/ssubSUB:SAPLCLMO:0130/tblSAPLCLMOMERKMAL/txtRMCLM-SMERKB["&Row_Numb&"."&i_col&"]").Text
Sandra Rossi
  • 11,934
  • 5
  • 22
  • 48
carlosdlcf
  • 25
  • 1
  • 7
  • 1
    Don't you see the difference between `txtRMCLM-SMERKB[1,1]` and `txtRMCLM-SMERKB[1.1]`? – Sandra Rossi Oct 31 '19 at 18:16
  • Is it VBA or VBScript? Can you please make sure that the posted code compiles? ([minimal reproducible example](https://stackoverflow.com/help/minimal-reproducible-example).) Thx. – Sandra Rossi Oct 31 '19 at 18:58
  • The issue was not the comma or the dot. At the end I had to use a workaround since the visible items in the table always reset to [0,0] regardless of how many entries there are. – carlosdlcf Nov 01 '19 at 03:02
  • Thank you for the feedback. As this question [does not contain a reproducible code and has been resolved in a manner unlikely to help future readers](https://stackoverflow.com/help/how-to-ask), you may eventually [delete it](https://stackoverflow.com/help/deleted-questions). – Sandra Rossi Nov 01 '19 at 08:51

0 Answers0