Skip to Content
Former Member
Jul 12, 2012 at 04:59 AM

Error: LoadBatchActions(formXML) is success but Form never exist


Hello All,

I have a problem when trying to load a form from an .SRF file. SAP shows us that the error message is "Form - Invalid Form". When loading the SRF, SAP shows no error that's why I assume the SRF has the right format (line 11 code below). But when I try to find the form and assigned the form unto a "oForm" variable, the program throws an exception that shows an exception as I mention before (line 12). The formUID is "STEM_PBTH" is exacly the same as defined in the SRF file. You can find the SRF in the attachment.

Public Sub Show()        Dim formXML As String        Dim formName As String        formName = "STEM_PBTH"        Try            Me.oForm = SBO_Application.Forms.Item(formName)        Catch ex As Exception            Try                SwissAddonFramework.Messaging.Debug.WriteMessage(ex.Message, SwissAddonFramework.Messaging.Debug.DebugLevel.Always)                formXML = LoadFromXML("ProjectBudgetingTemplate.srf")                SBO_Application.LoadBatchActions(formXML)                oForm = SBO_Application.Forms.Item(formName)                InitComponent(Me.oForm)            Catch e As Exception                Debug.Print(e.ToString)                Debug.Print(e.Message)            End Try        End Try    End Sub

Here is the error code:

System.Runtime.InteropServices.COMException (0xFFFFF43C): Form - Invalid Form   at SAPbouiCOM.FormsClass.Item(Object Index)   at ProjectBudgeting.ProjectBudgetingTemplate.Show() in D:\PROJECTS\SSP\ProjectBudgeting\Project\ProjectBudgetingTemplate.vb:line 51

And the XML code is in the attachment.

Can anyone suggest any solution for this problem? Thank you.