04-03-2013 7:25 PM
Hi,
I have a problem with check box which is not always available.
When this check box is present it should be unchecked and then should be pressed ENTER. This will unlock some additional fields which subsequently will be edited.
session.findById("wnd[0]/usr/tabsTAXI_TABSTRIP/tabpT\05/ssubSUBSCREEN_BODY:SAPLV60F:4203/chkRV60F-KFREL").selected = false
session.findById("wnd[0]").sendVKey 0
Then is the script which edit available fields
s=0
Do
If session.findById("wnd[0]/usr/tabsTAXI_TABSTRIP/tabpT\05/ssubSUBSCREEN_BODY:SAPLV60F:4203/tblSAPLV60FTCTRL_FPLAN_TEILFA/ctxtFPLT-FKSAF[10,0]").text="A" Then _
session.findById("wnd[0]/usr/tabsTAXI_TABSTRIP/tabpT\05/ssubSUBSCREEN_BODY:SAPLV60F:4203/tblSAPLV60FTCTRL_FPLAN_TEILFA/ctxtFPLT-AFDAT[0,0]").text= sht.cells(i,11).Text
session.findById("wnd[0]").sendVKey 0
s=s+1
session.findById("wnd[0]/usr/tabsTAXI_TABSTRIP/tabpT\05/ssubSUBSCREEN_BODY:SAPLV60F:4203/tblSAPLV60FTCTRL_FPLAN_TEILFA").verticalScrollbar.position = s
Loop Until session.findById("wnd[0]/usr/tabsTAXI_TABSTRIP/tabpT\05/ssubSUBSCREEN_BODY:SAPLV60F:4203/tblSAPLV60FTCTRL_FPLAN_TEILFA/ctxtFPLT-FKSAF[10,1]").text=""
I need to modify the script to skip first two rows( checkbox and "Enter") when chech box does not exist and to continue from s=0.
I will be very thankful if you advise me how to solve this problem.
Regards,
Guero
04-03-2013 10:48 PM
Hi Guero,
You could try this:
. . .
on error resume next
session.findById("wnd[0]/usr/tabsTAXI_TABSTRIP/tabpT\05/ssubSUBSCREEN_BODY:SAPLV60F:4203/chkRV60F-KFREL").selected = false
if err.number = 0 then session.findById("wnd[0]").sendVKey 0
on error goto 0
. . .
Regards,
ScriptMan
04-03-2013 10:48 PM
Hi Guero,
You could try this:
. . .
on error resume next
session.findById("wnd[0]/usr/tabsTAXI_TABSTRIP/tabpT\05/ssubSUBSCREEN_BODY:SAPLV60F:4203/chkRV60F-KFREL").selected = false
if err.number = 0 then session.findById("wnd[0]").sendVKey 0
on error goto 0
. . .
Regards,
ScriptMan
04-07-2013 5:19 PM
Hi ScriptMan,
It works perfect.Thank you!
As I am new with scripting I thought that the script after on error resume next is performed only in case of error but it seems its not true.
Regards,
Guero