on 06-15-2017 8:35 AM
Hello Community!
I want to integrate a loop in a scripting. Please find an example below.
How can I insert the variables (in example "i") in the string of the scripting??
thank you in advance!
' actual code:
Cells(1, 2).Value = oSession.FindById("wnd[0]/usr/tblSAPLCPDITCTRL_1400/ctxtPLPOD-ARBPL[2,0]").Text
Cells(1, 3).Value = oSession.FindById("wnd[0]/usr/tblSAPLCPDITCTRL_1400/ctxtPLPOD-STEUS[5,0]").Text
Cells(1, 4).Value = oSession.FindById("wnd[0]/usr/tblSAPLCPDITCTRL_1400/txtPLPOD-LTXA1[6,0]").Text
Cells(1, 5).Value = oSession.FindById("wnd[0]/usr/tblSAPLCPDITCTRL_1400/txtPLPOD-VGW02[14,0]").Text
Cells(2, 2).Value = oSession.FindById("wnd[0]/usr/tblSAPLCPDITCTRL_1400/ctxtPLPOD-ARBPL[2,1]").Text
Cells(2, 3).Value = oSession.FindById("wnd[0]/usr/tblSAPLCPDITCTRL_1400/ctxtPLPOD-STEUS[5,1]").Text
Cells(2, 4).Value = oSession.FindById("wnd[0]/usr/tblSAPLCPDITCTRL_1400/txtPLPOD-LTXA1[6,1]").Text
Cells(2, 5).Value = oSession.FindById("wnd[0]/usr/tblSAPLCPDITCTRL_1400/txtPLPOD-VGW02[14,1]").Text
'...
'target:
Dim i As Integer
For i = 1 To 10
Cells(i, 2).Value = oSession.FindById("wnd[0]/usr/tblSAPLCPDITCTRL_1400/ctxtPLPOD-ARBPL[2,i]").Text
Cells(i, 3).Value = oSession.FindById("wnd[0]/usr/tblSAPLCPDITCTRL_1400/ctxtPLPOD-STEUS[5,i]").Text
Cells(i, 4).Value = oSession.FindById("wnd[0]/usr/tblSAPLCPDITCTRL_1400/txtPLPOD-LTXA1[6,i]").Text
Cells(i, 5).Value = oSession.FindById("wnd[0]/usr/tblSAPLCPDITCTRL_1400/txtPLPOD-VGW02[14,i]").Text
Next i
Hi Lars,
this topic was discussed several times in the forum.
for example: https://archive.sap.com/discussions/thread/3492959
Regards,
ScriptMan
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
84 | |
10 | |
9 | |
8 | |
6 | |
6 | |
6 | |
5 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.