Entering content frameProcedure documentation Defining and Generating a Binding Locate the document in its SAP Library structure

Prerequisites

You have created a form with Microsoft Visual Basic or Microsoft Outlook. You have launched the SAPforms Designer as a Microsoft Visual Basic add-in or using 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 element) is displayed as a tree structure in the top control in the main window.

Procedure

Define Binding

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

There are two ways of defining a binding.

  1. Enter the binding using Drag&Drop.
  2. You can link several data elements with the same form control using Drag&Drop. This is useful, for example, if a value from the SAP System is to be displayed more than once on your form.

    You can also use Drag&Drop 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 SAPforms 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 SAP System, the columns in your table are displayed in the bottom control in the SAPform 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 SAPforms form. Bindings for multiple-line elements are defined in the same way.

Generate 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, exit it by choosing File ® Close. If you use the SAPforms Designer as an Add In (Microsoft Visual Basic), the tab page Generate is displayed in the dialog box SAPforms Options.

  3. If you select Insert initialization code in Load()- method and Button to trigger the insert action, event procedures are inserted in the SAPforms form pushbuttons.
  4. Caution

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

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

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

    Note

    Once a SAPform 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 SAPform form, for example.

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

Result

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

Note

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

For more information, see the following detailed procedures.

Leaving content frame