Hello everyone,
Not able to put value ZP05 and amount from excel sheet
below is the code
Not able to put value ZP05 and amount from excel sheet
below is the code
Code:
session.findById("wnd[0]/usr/tabsTAXI_TABSTRIP_HEAD/tabpT\07/ssubSUBSCREEN_BODY:SAPLV69A:6201/tblSAPLV69ATCTRL_KONDITIONEN").verticalScrollbar.Position = 0
jcount = 0
porgvalue = ""
nn = 1
For k = 0 To 1000
Err.Clear
session.findById("wnd[0]/usr/tabsTAXI_TABSTRIP_HEAD/tabpT\07/ssubSUBSCREEN_BODY:SAPLV69A:6201/tblSAPLV69ATCTRL_KONDITIONEN/txtKOMV-KBETR[1," & jcount & "]").SetFocus
If (Err.Number = 0) Then
porgvalue = session.findById("wnd[0]/usr/tabsTAXI_TABSTRIP_HEAD/tabpT\07/ssubSUBSCREEN_BODY:SAPLV69A:6201/tblSAPLV69ATCTRL_KONDITIONEN/txtKOMV-KBETR[1," & jcount & "]").Text
If (porgvalue = "") Then
session.findById("wnd[0]/usr/tabsTAXI_TABSTRIP_HEAD/tabpT\07/ssubSUBSCREEN_BODY:SAPLV69A:6201/tblSAPLV69ATCTRL_KONDITIONEN/ctxtKOMV-KSCHL[0," & jcount & "]").Text = "zp05"
session.findById("wnd[0]/usr/tabsTAXI_TABSTRIP_HEAD/tabpT\07/ssubSUBSCREEN_BODY:SAPLV69A:6201/tblSAPLV69ATCTRL_KONDITIONEN/txtKOMV-KBETR[2," & jcount & "]").Text = combinevalue
jcount = 0
Exit For
ElseIf (porgvalue Like "*_*") Then
session.findById("wnd[0]/usr/tabsTAXI_TABSTRIP_HEAD/tabpT\07/ssubSUBSCREEN_BODY:SAPLV69A:6201/tblSAPLV69ATCTRL_KONDITIONEN").verticalScrollbar.Position = 0
jcount = 0
Exit For
Else
GoTo dbjdown3
End If
ElseIf (Err.Number <> 0) Then
session.findById("wnd[0]/usr/tabsTAXI_TABSTRIP_HEAD/tabpT\07/ssubSUBSCREEN_BODY:SAPLV69A:6201/tblSAPLV69ATCTRL_KONDITIONEN").verticalScrollbar.Position = xnn * nn
jcount = 0
nn = (nn + 1)
GoTo dbjdown31
End If
dbjdown3:
jcount = (jcount + 1)
dbjdown31:
Next k
Err.Clear
session.findById("wnd[0]/usr/tabsTAXI_TABSTRIP_HEAD/tabpT\07/ssubSUBSCREEN_BODY:SAPLV69A:6201/btnBT_KONX").press
session.findById("wnd[1]/usr/lbl[1,4]").SetFocus
session.findById("wnd[1]").sendVKey 2
If (Err.Number <> 0) Then
dbws.Range("F" & i).Value = "Failed"
dbws.Range("F" & i).Interior.Color = RGB(255, 204, 204)
GoTo dbxdown
End If
session.findById("wnd[0]/usr/tabsTAXI_TABSTRIP_HEAD/tabpT\07/ssubSUBSCREEN_BODY:SAPLV69A:6201/tblSAPLV69ATCTRL_KONDITIONEN").verticalScrollbar.Position = 0
'''validate Net Value whether matching with Amount?
xporgvalue = ""
xporgvalue = session.findById("wnd[0]/usr/tabsTAXI_TABSTRIP_HEAD/tabpT\07/ssubSUBSCREEN_BODY:SAPLV69A:6201/txtKOMP-NETWR").Text
If (VBA.Round(CDbl(xporgvalue), 2) <> VBA.Round(CDbl(combinevalue & " "), 2)) Then
jcount = 0
porgvalue = ""
nn = 1
session.findById("wnd[0]/usr/tabsTAXI_TABSTRIP_HEAD/tabpT\07/ssubSUBSCREEN_BODY:SAPLV69A:6201/tblSAPLV69ATCTRL_KONDITIONEN").verticalScrollbar.Position = 0
For k = 0 To 1000
Err.Clear
session.findById("wnd[0]/usr/tabsTAXI_TABSTRIP_HEAD/tabpT\07/ssubSUBSCREEN_BODY:SAPLV69A:6201/tblSAPLV69ATCTRL_KONDITIONEN/txtKOMV-KBETR[1," & jcount & "]").SetFocus 'description column (grid object)
If (Err.Number = 0) Then
porgvalue = session.findById("wnd[0]/usr/tabsTAXI_TABSTRIP_HEAD/tabpT\07/ssubSUBSCREEN_BODY:SAPLV69A:6201/tblSAPLV69ATCTRL_KONDITIONEN/ctxtKOMV-KSCHL[0," & jcount & "]").Text
If (VBA.LCase(porgvalue) = "zp05") Then
session.findById("wnd[0]/usr/tabsTAXI_TABSTRIP_HEAD/tabpT\07/ssubSUBSCREEN_BODY:SAPLV69A:6201/tblSAPLV69ATCTRL_KONDITIONEN").getAbsoluteRow(k).Selected = True
session.findById("wnd[0]/usr/tabsTAXI_TABSTRIP_HEAD/tabpT\07/ssubSUBSCREEN_BODY:SAPLV69A:6201/btnBT_KOLO").press
jcount = 0
Exit For
ElseIf (porgvalue Like "*_*") Then
session.findById("wnd[0]/usr/tabsTAXI_TABSTRIP_HEAD/tabpT\07/ssubSUBSCREEN_BODY:SAPLV69A:6201/tblSAPLV69ATCTRL_KONDITIONEN").verticalScrollbar.Position = 0
jcount = 0
Exit For
Else
GoTo dbjdown4
End If
ElseIf (Err.Number <> 0) Then
session.findById("wnd[0]/usr/tabsTAXI_TABSTRIP_HEAD/tabpT\07/ssubSUBSCREEN_BODY:SAPLV69A:6201/tblSAPLV69ATCTRL_KONDITIONEN").verticalScrollbar.Position = xnn * nn
jcount = 0
nn = (nn + 1)
GoTo dbjdown41
End If
dbjdown4:
jcount = (jcount + 1)
dbjdown41:
Next k
Err.Clear
session.findById("wnd[0]/usr/tabsTAXI_TABSTRIP_HEAD/tabpT\07/ssubSUBSCREEN_BODY:SAPLV69A:6201/tblSAPLV69ATCTRL_KONDITIONEN").verticalScrollbar.Position = 0
If (Err.Number <> 0) Then
dbws.Range("F" & i).Value = "Failed"
dbws.Range("F" & i).Interior.Color = RGB(255, 204, 204)
GoTo dbxdown
End If
jcount = 0
porgvalue = ""
For k = 0 To 1000
Err.Clear
session.findById("wnd[0]/usr/tabsTAXI_TABSTRIP_HEAD/tabpT\07/ssubSUBSCREEN_BODY:SAPLV69A:6201/tblSAPLV69ATCTRL_KONDITIONEN/txtKOMV-KBETR[1," & jcount & "]").SetFocus
If (Err.Number = 0) Then
porgvalue = session.findById("wnd[0]/usr/tabsTAXI_TABSTRIP_HEAD/tabpT\07/ssubSUBSCREEN_BODY:SAPLV69A:6201/tblSAPLV69ATCTRL_KONDITIONEN/txtKOMV-KBETR[1," & jcount & "]").Text
If (porgvalue = "") Then
session.findById("wnd[0]/usr/tabsTAXI_TABSTRIP_HEAD/tabpT\07/ssubSUBSCREEN_BODY:SAPLV69A:6201/tblSAPLV69ATCTRL_KONDITIONEN/ctxtKOMV-KSCHL[0," & jcount & "]").Text = "zp05"
session.findById("wnd[0]/usr/tabsTAXI_TABSTRIP_HEAD/tabpT\07/ssubSUBSCREEN_BODY:SAPLV69A:6201/tblSAPLV69ATCTRL_KONDITIONEN/txtKOMV-KBETR[2," & jcount & "]").Text = combinevalue
jcount = 0
Exit For
ElseIf (porgvalue Like "*_*") Then
session.findById("wnd[0]").sendVKey 81 'pageup
jcount = 0
Exit For
Else
GoTo dbjdown5
End If
ElseIf (Err.Number <> 0) Then
session.findById("wnd[0]").sendVKey 82 'pagedown
jcount = 0
GoTo dbjdown5
End If
dbjdown5:
jcount = (jcount + 1)
Next k
session.findById("wnd[0]/usr/tabsTAXI_TABSTRIP_HEAD/tabpT\07/ssubSUBSCREEN_BODY:SAPLV69A:6201/btnBT_KONX").press
session.findById("wnd[1]/usr/lbl[1,5]").SetFocus
session.findById("wnd[1]/tbar[0]/btn[0]").press 'option C i selected
End If
Last edited by a moderator: