Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

Stop execution of item master

I want to make some fields mandatory in item master.

For this I am tracking the click event when the user clicks

on Update or Save button.I have displayed message

but I can not stop the execution of item master.

I want to stop its execution once the message

is displayed.After my message the item is getting updated

and message is displayed as

"Operation completed successfully"

I am using following code-

Private Sub SBO_Application_ItemEvent(ByVal FormUID As String, ByRef pVal As SAPbouiCOM.ItemEvent, ByRef BubbleEvent As Boolean) Handles SBO_Application.ItemEvent
        Dim btnSave As SAPbouiCOM.Button
        Dim txtUserText As SAPbouiCOM.EditText

        If pVal.EventType = SAPbouiCOM.BoEventTypes.et_CLICK And pVal.Action_Success = True And pVal.FormType = "150" And pVal.ItemUID = "1" Then
            objForm = SBO_Application.Forms.GetFormByTypeAndCount(150, 1)
            btnSave = objForm.Items.Item("1").Specific
            If btnSave.Caption = "Update" Then
                txtUserText = objForm.Items.Item("79").Specific
                If txtUserText.Value = "" Then
                    SBO_Application.StatusBar.SetText("Please enter User Text ", SAPbouiCOM.BoMessageTime.bmt_Short, SAPbouiCOM.BoStatusBarMessageType.smt_Error)
                End If
            End If
        End If
    End Sub

Former Member


Actually you don't need check the mandotary field and stop the execution in Update, the validation for mandotary field has better be done in event et_Validate.

'et_Validate handler of mandotary filed
If mandor_field= "" Then
     MessageBox("Enter the text for**")
     'Set the bubble event as false, thus the end user can leave the focus of the mandotary field
     BubbleEvent = False
End If

Kind Regards


0 View this answer in context
Not what you were looking for? View more on this topic or Ask a question