Skip to Content
avatar image
Former Member

Screen Code Generator

In the ScreenCode generator with version 6.5 I can build *.srl files.

The question is, Howcan I use this files in a Visual basic proyect, or how ca I use this files?

Add comment
10|10000 characters needed characters exceeded

  • Follow
  • Get RSS Feed

1 Answer

  • avatar image
    Former Member
    Jan 14, 2004 at 06:26 PM

    Hi,

    You can use this to load userdefined forms much faster than adding forms and elements "on the fly".

    Use the UI-API method : uiSBOApplication.LoadBatchActions(strXml as String)

    To do this you should use an XML-parser to retrive the xml-string. I use Microsoft XML-parser, v3.0.

    example (preconditions : create an menu-item):

    Private Sub m_conApp_MenuEvent(pVal As SAPbouiCOM.MenuEvent, BubbleEvent As Boolean)

    Dim oForm as new SAPbouiCOM.Form

    If pVal.BeforeAction = True Then

    Select Case pVal.MenuUID

    Case "YOUR_FORM_UID" 'uid-parameter in srf-file

    LoadFromXML "FILENAME.srf" ' see help-function below

    Set oForm = m_conApp.Forms.Item("YOUR_FORM_UID")

    oForm.Visible = True

    End Select

    End If

    End Sub

    '//**********************************************************************

    '// Loading form from resource-file (****.srf)

    '//**********************************************************************

    Private Sub LoadFromXML(FileName As String)

    Dim xmldoc As MSXML2.DOMDocument

    Dim xml_err As IXMLDOMParseError

    Set xmldoc = New MSXML2.DOMDocument

    xmldoc.async = False

    xmldoc.validateOnParse = True

    '// load the content of the XML File

    xmldoc.Load (App.Path + "Resources" + FileName)

    Set xml_err = xmldoc.parseError

    If (xml_err <> 0) Then

    debug.print "Failed loading xml-doc..."

    Else

    '// load the form to the SBO application in one batch

    uiSBOApplication.LoadBatchActions xmldoc.xml

    End If

    End Sub

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member James Kofalt

      Just to let you know, i

      If you have any problem in loading the srf. with the LoadBatchActions(strXml as String)

      it is beacuse we have a bug. A work around for this bug is:

      1.Open a nodepad of the srf.

      2. Do a enter

      3. Do a backspace.

      4. Saved it

      and then try to load it with the above method.

      Gali