Entering content frameBackground documentation Calling the SAPforms Interface Directly Locate the document in its SAP Library structure

Instead of defining the interface selection and binding permanently using the SAPforms Designer, you can also save this in the following way.

Note

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 Microsoft Visual Basic classes that must be instantiated in the Microsoft Visual Basic program.

These objects must be instantiated in the Microsoft 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 SAP System.

Procedure

  1. In Microsoft Visual Basic, choose Project ® References...
  2. In the dialog box displayed, select the references that you need for your form.
  3. You execute 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.

  4. Enter the following source code in the Load method for your form:
  5. 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 source code uses what is called an "early binding". The term "late binding" refers to Source Code Inserted by the SAPforms Designer.

  6. To assign data from controls to a container element, enter the following source code:
  7. 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 pushbutton, since the SAPforms form does not contain any values beforehand.

  8. To transfer the data to the SAP System, enter the following line in the source code at the end of the Click event:

ObjSAPForm.Start

If you want to use the SAPforms form to process a work item, enter Execute (instead of Start).

Leaving content frame