Skip to Content
May 07, 2016 at 06:50 AM

Working with XML


Hi, everybody

I am developing a quite big add-on using VB.NET and SDK

I started learning SDK using the samples given in SDK Help, and I develop everything entirely in code, because I have not learned other techniques.

All dimensions and positions are specified in code. I am not using any visual tool (Screen Painter, B1DE, SAP B1 Studio..)

I notice that my form is rather slow to load. Not a big problem, but if it loads faster, users will be more happy.

I have studied the "Working with XML" example in DI sample, and notice it loads very fast (but it's a small file. Mine is much bigger).

I am thinking of converting all my forms into XML, but would like some advice before jumping ahead.

My Questions:

  • Does an XML form indeed load faster than the equivalent form specified in code?

  • Is it possible to adopt the approach I am thinking of: loading the XML file and adding the necessary SDK code?

  • I don't use simple fixed dimensions because this gives rise to distorted screens when screen resolution changes.

What I do is to calculate screen resolution using these codes:

Public VirtualScreenWidth As Double = System.Windows.Forms.SystemInformation.VirtualScreen.Width

Public VirtualScreenHeight As Double = System.Windows.Forms.SystemInformation.VirtualScreen.Height

Then I express all my dimensions and positions in terms of these variables. ex:

oItem = FormSelx.Items.Add("O_ToOt", SAPbouiCOM.BoFormItemTypes.it_OPTION_BUTTON)

oItem.TextStyle = SAPbouiCOM.BoFontStyle.fs_Bold

oItem.Left = 0.5 * VirtualScreenWidth

oItem.Top = 0.59 * VirtualScreenHeight

Can a form be saved as XML even if dimensions are expressed parametrized as above?



Just as a test, I modified the XML file to incorporate a formula (125*2 instead of 250)

<item uid="EditText1" type="16" left="157" tab_order="0" width="125 * 2"

But it does not work.

My only hope is that it will work if the XML file is generated by SDK, not just edited .. but maybe I am dreaming!🤪


  • Will it still be possible to create the .ard file as usual?

  • Any advice that can help me steer my project successfully?

Any advice will be most welcome. I never worked with XML before.