Skip to Content

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

how to open multiple form?

I created a PR form under AP, and it loaded successfully for the first click.

However, how to code it in C# to be able to pop up another PR form? Just like SAP System form, it popups another form when the menu is clicked.

Thank you for your kind attention.

Ken

replied

Hello,

You need to create a CreateForm function, and call this function you want to create your form. The only magic here is to create a dynamic form UID, you can't hard code the formUID. see the sample code as below. Hope it helps.

Public Sub CreateForm()
        Dim oFormCreationParams As SAPbouiCOM.FormCreationParams
        oFormCreationParams = oApp.CreateObject(SAPbouiCOM.BoCreatableObjectType.cot_FormCreationParams)

        oFormCreationParams.FormType = "CMC_H"
        'Create a dynamicl form UID accoding the ticks of the current time
        Dim ticks As String = Date.Now.Ticks.ToString()
        ticks = ticks.Substring(ticks.Length - 8)
        oFormCreationParams.UniqueID = "CMC_H" + ticks.ToString
        oFormCreationParams.BorderStyle = SAPbouiCOM.BoFormBorderStyle.fbs_Fixed

        Dim oForm As SAPbouiCOM.Form
        oForm = oApp.Forms.AddEx(oFormCreationParams)
        oForm.Title = "Hello World."
        oForm.Visible = True
End Sub

Kind Regards

-Yatsea

0 View this answer in context

Helpful Answer

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