Skip to Content
author's profile photo Former Member
Former Member

UI: show form created with Screen Painter (.srf)

Hello

I have created a form in the Screen Painter - can somebody please post the code needed for using this form in an add-on application??

This is what i've got - and it's not working: ( i have connected to SAP BO already)

-


Dim XMLDoc1 As New MSXML2.DOMDocument

XMLDoc1.load("VareAddOn.srf")

SBO_Application.LoadBatchActions(XMLDoc1.xml)

Dim oForm As SAPbouiCOM.Form

oForm = SBO_Application.Forms.Item("frmVareOpslag")

oForm.Visible = True

-


VareAddOn.srf is the form i created in screen painter, and frmVareOpslag is the UID for the form.

I get an error when i run the project (a NullReferenceException). Please help!

Add a comment
10|10000 characters needed characters exceeded

Related questions

1 Answer

  • author's profile photo Former Member
    Former Member
    Posted on Apr 19, 2004 at 12:00 PM

    Hi Henrik,

    I had problems at first because in the SRF file there is always the following line at the beginning of the file (the XML object doesn't seem to like it for some reason):

    <?xml version="1.0" encoding="UTF-16"?>

    I usually copy the SRF file to an XML file and delete the line above. My code is as follows.... (fmDiscount is my FormUID)

    Set oXMLForm = New MSXML.DOMDocument

    oXMLForm.Load ("itemdisc.xml")

    SBO_Application.LoadBatchActions oXMLForm.xml

    Set oDiscForm = SBO_Application.Forms.Item("fmDiscount")

    Hope this helps....

    Daniel

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member

      Another method to fix an .srf is to open it in Notepad and then save it again. This is a Unicode file, and Notepad adds some codes at the beginning that some programs require for reading Unicode.

      I simply associate the file type .srf with Notepad, so that I can double-click it from explorer to open it and then I save it as .xml.

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.