
Source Code Inserted by the SAPforms Designer
If you have decided to insert source code when the form is generated, the
SAPforms Designer generates the following source code:
Dim objSAPForm As Object
This line declares a global
SAPForm object which acts as an anchor to all other SAPforms objects during the lifetime of the form.
Private Sub Form_Load()
Set objSAPForm = CreateObject("SAPformsFVB4.SAPForm")
objForm.Init Me, Command
End Sub
This object is instantiated by the corresponding class in the Load event of the SAPforms form and is then initialized.
The Init method receives the parameter
Me , representing a Microsoft Visual Basic form object, and Command representing the command line parameters. These parameters are filled when the application is started.The Init method creates one entry in the Controls list of the SAPForm object from each control in the Microsoft Visual Basic form object. It also analyzes the Tag property of the SAPforms form and reconstructs the SAPData object and the SAPXmit object from its contents. After the Init call, these objects can be accessed using the SAPData and SAPXmit property of the SAPForm object.
The Command parameter is used to decide whether the SAPforms form is invoked to process a work item or to start a workflow. If a work item is to be executed, the SAPforms form must be started indirectly by the SAPforms Helper, which itself is activated when an R3F mail attachment is started, for example.
In some cases, it can be more advantageous to replace the source code generated in the Load event with your own source code, especially if the logic around the Command parameter is not suitable for your purposes.

Private Sub cmdStart_Click()
' Submit via selected Transmit object
objSAPForm.Start
End Sub
This source code is generated in the "Click" event of the Send pushbutton. It activates the Start method of the
SAPForm object which fills the elements of the SAPData object from the form controls, writes data to an appropriate file, and sends the file to the SAP System. To do so, it uses the SAPXmit object.
The generated source code does not contain any