on 02-25-2016 7:45 AM
Hello Folks,
i would like to ask for your help in fixing this code.
i have recorded step is sap and i got this code:
session.findById("wnd[0]/usr/tblSAPLZZVWPM79_CANCWO2TCTRL_ZZVWPM79_CANCWO2/txtZZVWPM79_CANCWO2-IWERK[0,0]").Text = "TEST1"
Now, what i want is replace the value of "0,0" into an integer since i have multiple lines to set-up. i have now below code but it is not running.
sub TEST()
Dim a As Integer
Dim b As Integer
a = 0
b = 0
session.findById("wnd[0]/usr/tblSAPLZZVWPM79_CANCWO2TCTRL_ZZVWPM79_CANCWO2/txtZZVWPM79_CANCWO2-IWERK[a,b]").Text = "TEST1"
a = i + 1
b = z + 1
Loop
end sub
Please help!
Thanks,
Michael
Hi Michael,
like Holger wrote to use variables you should change your code:
sub TEST()
Dim a As Integer
Dim b As Integer
a = 0 'Column
b = 0 'Row
Do
session.findById("wnd[0]/usr/tblSAPLZZVWPM79_CANCWO2TCTRL_ZZVWPM79_CANCWO2/txtZZVWPM79_CANCWO2-IWERK[a," & b &"]").Text = "TEST1"
'a = a + 1
b = b + 1
Loop Until b = 4
end sub
This code will fill in the first 4 rows in column 0 (the first column) with the same value TEST1.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello.
Are you sure you want to move both coordinates?
The column mostly will be fixed value. So you just Need to make row variable dynamic (in your case 'a').
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Michael,
You can try the following:
session.findById("wnd[0]/usr/tblSAPLZZVWPM79_CANCWO2TCTRL_ZZVWPM79_CANCWO2/txtZZVWPM79_CANCWO2-IWERK[" & cstr(a) & "," & cstr(b) & "]").Text = "TEST1"
Regards,
ScriptMan
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.