'***************************** ******************************
'SAPGuiEdit Customize Field Validation Code -
'Name :
fieldValidation()
'Purpose : To validate a text
field
'Author : MindLess
'Input : Edit Box name, label text, error
level
'
: expectedVal special cases:
'
: "<no_validation>" if validation is not required for the
componenet
'
: "<blank>" if it is required to check blank
value i.e. expected value is blank.
' : "<any_value>" to check any value except blank
'Output : Temp results stored in buffer
excel file
'Return : NA
'Assumptions : None
'Note : None
'***************************** ****************************** ****************************** *************************
sub
fieldValidation(boxname, expectedVal,errorLevel)
If expectedVal = "<no_validation>"
Then
Exit Sub
End If
'on error resume next
Dim
sessionDesc,winDesc,childDesc, winDescModal,obj,window, blnEdtPresent,val,field,i
Set sessionDesc =
description.Create()
sessionDesc("type").value =
"GuiSession"
Set winDesc =
description.Create()
winDesc("type").value =
"GuiMainWindow"
Set winDescModal =
description.Create()
winDescModal("type").value =
"GuiModalWindow"
Set edt =
description.Create()
edt("type").value =
"Gui.*TextField"
edt("name").value = boxname
blnEdtPresent = false
If
SAPGuiSession(sessionDesc). SAPGuiWindow(winDesc).Exist(2)
Then
End If
set obj =
window.SAPGuiEdit(edt)
If obj.exist(2) Then
val=
obj.getroproperty("text")
field =
obj.getroproperty(" DefaultTooltip")
If val<>"" Then
End If
''***********to validate with blank and
any value ************
'***************************** ****************************** ****************************** *********************
End If
End if
Set sessionDesc= nothing
Set winDesc = nothing
Set obj = nothing
Set window = nothing
Set winDescModal = nothing
end sub