Defining and Generating a Binding 

Prerequisites

You have created a form with Visual Basic or MS Outlook. You have launched the SAPforms Designer as a Visual Basic add-in or via the Submit control and are in the main window of the SAPforms Designer. The form controls are shown in the table displayed in the bottom control.

The interface (container elements, function module parameters, or segment description of the IDoc) is displayed as a tree structure in the top control in the main window.

Procedure

Define a binding

Assign the individual structure elements to the fields in the current Visual Basic form ("binding definition"). This assignment is stored as part of the form and is used at runtime to transfer data from the form to the R/3 System.

There are two ways of defining a binding.

  1. Simply drag one leaf from the tree structure and drop it onto one table line ("drag & drop").
  2. You can link several data elements to the same form control using "drag and drop". This is useful, for example, if a value from the R/3 System is to be displayed more than once on your form.

    You can also use the "drag & drop" method to add a leaf from the tree structure to the table in the bottom control by simply dropping it on the SAP Data field column heading. Two form controls (SAPLabel, SAPField) are then also added to your Visual Basic form.

  3. Select a leaf and a table row and choose Binding ® To data element.

The name of the leaf is then entered in the row containing the control under the SAP Data Field column.

You can release a binding by selecting the required row in the table and choosing Binding ® Release. To release all of the bindings, choose Binding ® Release All.

If you used the SAP Table View Control or the MS FlexGrid Control to create the form because you want to display or populate multiple-line elements from the R/3 System, the columns in your table are displayed in the bottom control in the Designer.

The form is [Table name] [(Column number)]. You can ignore the line number when you are designing the form. It is adjusted dynamically at runtime of the form. Bindings for multiple-line elements are defined in the same way.

Generating a Binding

Once you have defined all the bindings, you must generate it.

  1. Choose File ® Generate.
  2. The binding is generated. If you do not use the SAPforms Designer as an Add In, continue with step 4.

  3. If you use the SAPforms Designer as an Add In (Visual Basic), the tab page Generate in the dialog box SAPforms Options is displayed.
  4. By selecting the Insert initialization code into Load()- method and button to trigger the insert action options on the Generate tab page, you can instruct the Designer to add buttons with assigned event procedures on your Visual Basic form.

    This is only recommended the first time you generate your form and if the form does not already have these buttons. Otherwise, you might receive an error when compiling the form because some of the declarations and event procedures are contained twice in the form. You must remove duplicate code from the form by hand.

  5. Choose OK.
  6. All of the necessary information is then entered in the TAG property of the form.

    You can undo the form generation by choosing Binding ® Reset. The entry in the TAG property is then also deleted.

    Once a form has been generated, you can edit it or generate it again at any time. You might need to do so if you have added an input field to your form, for example.

  7. Choose File ® Exit to exit the SAPforms Designer.

Result

Once you have generated the form successfully, you must recompile the Visual Basic project that contains the form (assuming that you are using Visual Basic). You can then make the resulting EXE file available where it is required.

The procedure is the same if you are using the stand-alone version of the SAPforms Designer.

For a more detailed description of this procedure, please refer to: