on 01-20-2013 12:19 AM
Hi,
Can you tell me if the bellow is possible to be performed or there is no such functionality VBS & SAP?
And if yes how should looks like the script?
n = session.findById("wnd[0]/usr/tabsTABSTRIP_2000/tabpFRML/ssubSUBSCR_2000:SAPLCOVG:2052/tblSAPLCOVGTCTRL_2052/txtAFVGD-PREIS[12,0]").value
m = sht.cells(i,1).Value
If n<=m than n=0,01
Else
n=n-m
End If
' and this result to be returned as value in
session.findById("wnd[0]/usr/tabsTABSTRIP_2000/tabpFRML/ssubSUBSCR_2000:SAPLCOVG:2052/tblSAPLCOVGTCTRL_2052/txtAFVGD-PREIS[12,0]").text=n
BR,
Guerolito
Hi Guerolito.
I would try it like this:
n = session.findById("wnd[0]/usr/tabsTABSTRIP_2000/tabpFRML/ssubSUBSCR_2000:SAPLCOVG:2052/tblSAPLCOVGTCTRL_2052/txtAFVGD-PREIS[12,0]").text
m = sht.cells(i,1).Value
If n<=m than n=0,01
Else
n=n-m
End If
' and this result to be returned as value in
session.findById("wnd[0]/usr/tabsTABSTRIP_2000/tabpFRML/ssubSUBSCR_2000:SAPLCOVG:2052/tblSAPLCOVGTCTRL_2052/txtAFVGD-PREIS[12,0]").text=cstr(n)
Regards,
ScriptMan
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
It seems that the error was caused by "," in 0,01.
When I replaced 0,01 with 1 the problem disappeared.
Finally I decide to "use" 0,01 from excel file.
And the code bellow:
n = session.findById("wnd[0]/usr/tabsTABSTRIP_2000/tabpFRML/ssubSUBSCR_2000:SAPLCOVG:2052/tblSAPLCOVGTCTRL_2052/txtAFVGD-PREIS[12,0]").text
m = sht.cells(2,2).Value
k = sht.cells(1,1).Value ' = 0,01
If n>m then n=n-m else n=k End if
session.findById("wnd[0]/usr/tabsTABSTRIP_2000/tabpFRML/ssubSUBSCR_2000:SAPLCOVG:2052/tblSAPLCOVGTCTRL_2052/txtAFVGD-PREIS[12,0]").text=cstr(n)
Regards,
Guerolito
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.