on 04-19-2004 11:38 AM
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!
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.
User | Count |
---|---|
98 | |
11 | |
11 | |
6 | |
6 | |
4 | |
4 | |
3 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.