我是 SAP 业务的新手。我对 sap business 一种屏幕画家表格有疑问。我想验证表单以避免空值。我写了这段代码:
If pVal.FormUID = "TRADING" And pVal.ItemUID = "1" And pVal.Before_Action = True And pVal.InnerEvent = False And pVal.EventType = SAPbouiCOM.BoEventTypes.et_ITEM_PRESSED And (pVal.FormMode = SAPbouiCOM.BoFormMode.fm_ADD_MODE Or pVal.FormMode = SAPbouiCOM.BoFormMode.fm_UPDATE_MODE) Then
oEdit = oForm.Items.Item("10").Specific
If oEdit.String = "" Then
SBO_Application.StatusBar.SetText("Select Buyer Code", SAPbouiCOM.BoMessageTime.bmt_Short, SAPbouiCOM.BoStatusBarMessageType.smt_Error)
BubbleEvent = False
Exit Sub
End If
End If
当我按下添加按钮时它工作正常,但如果我按下表单右上角的关闭按钮,它会显示保存数据的确认。如果我按“是”,它仍然允许插入空值。
我该如何解决这个问题?