/scripts/ahub.form.attachments.js
0

How can I integrate variables in a SAP GUI ID?

Jun 15, 2017 at 07:35 AM

60

avatar image
Former Member

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
10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

1 Answer

Script Man Jun 15, 2017 at 08:00 AM
0

Hi Lars,

this topic was discussed several times in the forum.

for example: https://archive.sap.com/discussions/thread/3492959

Regards,

ScriptMan

Share
10 |10000 characters needed characters left characters exceeded
Skip to Content