Entering content frameProcedure documentation Getting Started Locate the document in its SAP Library structure

This unit provides a brief example of how you can design a Microsoft Visual Basic form for starting a workflow in the SAP System. This form starts a workflow that handles approval of a leave application. The form that we are about to design represents the leave application.

Prerequisites

Procedure

To familiarize yourself with Microsoft Visual Basic gradually, you should start with a simple Microsoft Visual Basic project that contains a form with controls and no additional Microsoft Visual Basic source code.

SAP Forms Designer will add all the definitions you need for starting a workflow with this SAPforms form. You do not need to write any line of source code for that.

  1. Start Visual Basic.
  2. Check whether the Add-Ins menu contains the SAPforms entry. If this is the case, skip the next step.
  3. Choose Add-Ins ® Add-In Manager and select the SAPforms entry.
  4. Caution

    In some cases, the SAPforms add-in might not be listed in the Add-Ins menu of Microsoft Visual Basic or in the Add-In Manager. This is the case, for example, if Microsoft Visual Basic is installed after you installed SAPforms. In this case do the following:

    a) Close Microsoft Visual Basic

    b) Open the MD DOS command prompt.

    c) Open the Bin directory under SAPforms

    d) Enter WDFDES.EXE /R..

    e) Start Microsoft Visual Basic again.

  5. Open the project Demo3a in the ...\SAPforms\Samples directory.
  6. Open the form frmTst3a.frm in the project window. This is an absence form that triggers a workflow in the SAP System.
  7. Choose Add-Ins ® SAPforms ® Designer.
  8. The SAPforms Designer is called. The screen essentially consists of two areas:

    The top area is still empty.

    In the bottom area you find a table that contains an element from the leave request form in every line.

  9. Choose Tools ® Options.
  10. The Options dialog box of the SAPforms Designer is then displayed.

  11. Select the tab page Plug-Ins.
  12. Enter the value SAP Forms Data Plug-In Demo in the field Active Plug-In frame. Use the F4 possible entries pushbutton for the input.
  13. In the frame SAP Transmit Plug-In the value for the SAP Forms Transmit Plug-In Demo is now entered automatically in the Active Plug-In field.

  14. Click OK to exit this dialog box.
  15. The main window of the SAPforms Designer is then displayed again.

  16. Open the SAP data structure by choosing File ® Demo Structure.
  17. The top screen area contains a tree structure of the demo data structure. Choose + to display the fields in the structure.

    Note

    Since you chose the SAPforms Data Plug-In Demo plug-in in step 8, a data structure stored for demonstration purposes is now displayed in the top control.

    If you had chosen the SAPforms Data Plug-In for Workflow Container plug-in in step 8, the structure displayed would comprise the contents of the workflow container.

  18. Define which form field is to be linked to which field in the SAP data structure ("Binding Definition".)
  19. Choose a data field in the structure tree of the top control and drag it to the line in the table that contains the required control. If the binding was successful, the name of the SAP data field that is now linked to the control in the form appears in the Data Element column.

  20. Choose File ® Generate to generate the binding.
  21. A dialog box with generation options is then displayed.

  22. Select Insert initialization code in Load()- method and button to trigger the insert action.
  23. Choose OK.
  24. Choose File ® Close to close the SAPforms Designer.
  25. You will then return to the Microsoft Visual Basic development environment.

  26. Choose Run ® Start to start the form directly from the Microsoft Visual Basic development environment.
  27. The runtime version of the form is displayed. The controls are empty initially.

  28. Enter your data in the fields.
  29. Click Submit to send the form.

Result

Normally this would start SAP Workflow.

Since you chose the SAPforms Data Plug-In Demo in step 8, the form is running in demo mode. This means that a window displaying the data that would normally be transferred to your R/3 System appears when you send the form.

If you had chosen the SAPforms Data Plug-In for Workflow Container in step 8, sending this form would have started a workflow. Since this would require extensive changes to settings in SAPforms and in the R/3 System, you should only use the Demo mode initially. The Workflow Examples demonstrate how a workflow is started.

Leaving content frame