cancel
Showing results for 
Search instead for 
Did you mean: 

Adding a variable in the sap script code

Former Member
0 Kudos

Hi All,

Below is a part of my excel macro:

For i = 0 To 6

session.findById("wnd[1]/usr/tabsTAB_STRIP/tabpSIVA/ssubSCREEN_HEADER:SAPLALDB:3010/tblSAPLALDBSINGLE/ctxtRSCSEL_255-SLOW_I[1,i]").Text = Plant(i)

Next

I am using a variable " i " instead of [1,0]").Text , [1,1]").Text  etc of the macro. But it is not working.

Can someone let me know what correction is

Accepted Solutions (1)

Accepted Solutions (1)

stefan_schnell
Active Contributor
0 Kudos

Hello Krishna,

please try

session.findById("wnd[1]/usr/tabsTAB_STRIP/tabpSIVA/ssubSCREEN_HEADER:SAPLALDB:3010/tblSAPLALDBSINGLE/ctxtRSCSEL_255-SLOW_I[1," & CStr(i) & "]").Text = Plant(i)


CStr converts i to a string and with the & you add it as string.


Let us know your results.


Cheers

Stefan

Former Member
0 Kudos

Thanks a lot Stefan ..it works

Sorry for the late reply.

Regards

Krishna Kumar

Answers (1)

Answers (1)

ujjalsaha
Explorer
0 Kudos

How do i convert below code in python, below code is not working

i=0

j=1

while i<534:

session.findById("wnd[1]/usr/tabsTAB_STRIP/tabpSIVA/ssubSCREEN_HEADER:SAPLALDB:3010/tblSAPLALDBSINGLE/ctxtRSCSEL_255-SLOW_I[j,i)]").text = k[i]

i=i+1