Skip to Content

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

Event for loading form

I am updating the form of item master.For this I have added a new button.On the click event of this event my new form opens.I want to load this new button every time I open item master.I tried on the form load event of item master but it did not worked.The code is as,

 Private Sub SBO_Application_ItemEvent(ByVal FormUID As String, ByRef pVal As SAPbouiCOM.ItemEvent, ByRef BubbleEvent As Boolean) Handles SBO_Application.ItemEvent
If pVal.EventType = SAPbouiCOM.BoEventTypes.et_FORM_LOAD And pVal.FormType = "150" Then

EditForm(pVal.FormTypeEx, pVal.FormTypeCount)
                   End If
End Sub

 Private Sub EditForm(ByVal intType As Integer, ByVal intCount As Integer)
        Dim objNewItem As SAPbouiCOM.Item
        Dim objButton As SAPbouiCOM.Button

        objForm = SBO_Application.Forms.GetFormByTypeAndCount(intType, intCount)
        'objForm = SBO_Application.Forms.ActiveForm
        objNewItem = objForm.Items.Add("btnIISP", SAPbouiCOM.BoFormItemTypes.it_BUTTON)
        objNewItem.Left = 900
        objNewItem.Width = 100
        objNewItem.Top = 568
        objNewItem.Width = 100
        objNewItem.Height = 20
        objNewItem.Description = "IISP"
        objButton = objForm.Items.Item("btnIISP").Specific
        objButton.Caption = "Inspection Details"
    End Sub

Former Member
Not what you were looking for? View more on this topic or Ask a question