Workflow Examples 

The directory ...\SAPforms\Samples contains two examples ( APPROVE.VBP , CUSTOMER.VBP ) of approval workflows that illustrate the functions for starting workflows and processing work items.

These workflows cover the scenarios: Process notification of absence ( WS 30000161 ) and Example workflow for customer creation ( WS 20000084 ).

Also compare the documentation to workflow WS 30000161 Demo Example:

Edit Absence Notification as Form.

Scenarios

In both scenarios, an employee starts a form as an EXE file on a local PC. He or she completes the form and sends it to the R/3 System by clicking the Submit button. This example is designed for communication via RFC. In other words, an online connection to the R/3 System is required.

Example: Scenario WS 20000084 (Simplified)

The employee receives the message "Your request has been submitted successfully" . The corresponding workflow is then started in the R/3 System. The employee responsible for approving the notification then receives a work item in his or her Workflow inbox. If he or she chooses Execute, the work item starts the form again. This time, however, only values are displayed. The form now also contains a Reject and an Accept button. Depending on the superior’s decision, the employee receives a rejection or an approval in his or her workflow inbox.

For the scenario example workflow for creating customers ( WS 20000084 ) to function, the file CUSTOMER.TXT must also be located in the directory, in which the executable EXE -file (the form) is located, as the form reads initial values from this file. The file is stored in the directory ...SAPforms\Forms.

It concerns the data for state, reference customer sales organization, division and distribution channel ("*"). Except for state this data is system-specific and must be determined separately. In order for the example to work, you must maintain the appropriate data for your system in the file CUSTOMER.TXT. See also: Determining a Reference Customer.

Process Flow

To use these examples, you need to carry out the following steps:

  1. Start Visual Basic and load the file APPROVE.VBP or CUSTOMER.VBP from the ...\SAPforms\Samples directory.
  2. Start the SAPforms Designer as a Visual Basic add-in.

The structure of the workflow WS 30000161 or WS 20000084 is displayed in the top control. The bottom control lists the form controls in a table. The binding is already defined and generated.

The additions to the VB code required for this scenario have already been integrated and commented. These are, for example, the program lines ( Private Sub Form_Load () ) that ensure that a Reject and Accept button is added to the form when it is processed as a work item. The result of this query must also be processed ( Private Sub cmdAccept_Click(), Private Sub cmdReject_Click() ). A certain value, therefore, is assigned to the container element CheckResult ( APPROVE.VBP ) and ProcessingState ( CUSTOMER.VBP ) and is interrogated later in the workflow.

  1. Compile the APPROVE.EXE or CUSTOMER.EXE file and save it in the ...\SAPforms\Forms directory.
  2. Close Visual Basic and maintain an organizational plan in your R/3 System. Assign agents to the tasks.
  3. Start the APPROVE.EXE or CUSTOMER.EXE file.

One of the scenarios described above is then started.