Calling the SAPforms Interface Directly 
Instead of defining the interface selection and binding permanently using the
SAPforms Designer, you can also save this information using a different method.
Please note, however, that the SAPforms Designer is the simpler and faster method and is therefore recommended.
To understand this procedure, you should be familiar with the SAPforms components that are used here. These components correspond to Visual Basic classes that must be instantiated in the Visual Basic program.
These objects must be instantiated in the Visual Basic program and initialized accordingly. You must then open the corresponding structure. Finally, you must define the bindings and transfer the data to the R/3 System.
Procedure
On the dialog box displayed, select the references that you need for your form. You carry out this activity in the SAPforms Designer when you are maintaining the plug-ins. Make sure that you only choose one reference for each object type.

1 Private Sub Form_Load()
2 Set objSAPForm = New SAPForm
3 Set objSAPForm.SAPData = New SAPData
4
5 Set objSAPForm.SAPXmit = New SAPXmit
6 End Sub
This code uses a so-called "early binding". The term "late binding" refers to
code inserted by the SAPforms Designer.
4 objSAPForm.SAPData.ImportStructureFromFile ("[Filename]")
The object browser (View ® Object-Browser) shows the methods that match each object type.

ObjSAPForm.SAPData.Value ([ContainerElement]) = [FormControl]
[ContainerElement]
stands for the name of a container element. [FormControl] stands for the name of the form control or a concrete value (as a string).This assignment should be made in the Click event (
Private Sub cmdStart_Click() ) of the start or execute button, since the form does not contain any values beforehand.
ObjSAPForm.Start
If you want to use the form to process a work item, enter
Execute (instead of Start ).
Example: Creating a customer via an IDoc
This example (
General procedure:
If the IDoc is to be sent now, it must first be filled with data (header data, useful data).
It is important that this data is set in a certain sequence. When the fields in a segment are set, the actual instance of the segment is created and the sequence in which the IDoc is sent to the R/3 System is defined. The IDoc will encounter an error if this sequence does not correspond to the one in the IDoc definition. You can specify this sequence in the download file or by choosing the transaction WEDI in the R/3 System.
In our example, the segments must be populated in the following sequence:
For further information, refer to the VB code.