cancel
Showing results for 
Search instead for 
Did you mean: 

Load Form Screen Printer in C#

Former Member
0 Kudos

Hi all,

How load a form created in screen printer in language c# ?

Exemple:

I use this function to load a form in SAP business one with language VB:

Private Sub LoadForm()

Dim oxmldoc As New Xml.XmlDocument

oxmldoc.Load("Form Name.srf")

SBO_Application.LoadBatchActions(oxmldoc.InnerXml)

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

oForm.Visible = True

End Sub

But, in C# this code not is valid.

Im need a code valid in C#.

Somebody could help?

Accepted Solutions (0)

Answers (1)

Answers (1)

Nussi
Active Contributor
0 Kudos

Welcome Fabio

i use this c# procedure to load a XML:


    private static void LoadFromXML(string FileName)
    {
        System.Xml.XmlDocument oXmlDoc = null; 
 
        try
        {
            oXmlDoc = new System.Xml.XmlDocument();
 
            // load the content of the XML File
            string sPath = null;
            sPath = System.IO.Directory.GetParent(Application.ExecutablePath).ToString();
 
            oXmlDoc.Load(sPath + "\\" + FileName);
 
            // load the form to the SBO application in one batch
            string sXML = oXmlDoc.InnerXml.ToString();
 
            globals.SBO_Application.LoadBatchActions(ref sXML);
        }
        catch (Exception er)
        {
 
        }
        finally
        {
            oXmlDoc = null;
            GC.Collect();
        }
 
    }

lg David

Former Member
0 Kudos

Hi David Nussböck,

My problem is resolved.

Thank you very much for you attention,

Fabio.