Entering content frameThis graphic is explained in the accompanying text Workflow Examples Locate the document in its SAP Library structure

The directory ...\SAPforms\Samples contains two application examples (APPROVE.VBP, CUSTOMER.VBP) for approval workflows that illustrate the functions workflow start and work item execution.

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

Note

For more information on workflow WS30000161, see Demo: Edit Absence Notification as SAPforms Form.

Scenarios

In both scenarios, an employee starts a SAPforms form as an EXE file on a local PC. He or she completes the SAPforms form and chooses Submit to send it to an SAP System. This example is designed for communication using RFC. In other words, an online connection to the SAP System is required.

Example: Scenario WS 20000084 (Simplified)

This graphic is explained in the accompanying text

The employee receives the message "Your request has been submitted successfully" . The corresponding workflow is then started in the SAP 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 SAPforms form again. This time, however, only values are displayed. The SAPforms form now also contains a Reject and an Accept pushbutton. Depending on the superior’s decision, the employee receives a rejection or an approval in his or her workflow inbox.

Caution

For the scenario Example workflow for creating customers ( WS20000084 ) to function, the file CUSTOMER.TXT must also be located in the directory, in which the executable EXE -file (the SAPforms form) is located, as the SAPforms 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. For the example to work, you must maintain the appropriate data for your system in the CUSTOMER.TXT file . For more information, see Determining a Reference Customer.

Process Flow

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

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

The container elements for workflow WS30000161 or WS20000084 are displayed as a SAP structure in the upper part of the screen. You can see the form controls in the table displayed in the bottom screen area. The binding is already defined and generated.

Note

The additions to the Microsoft Visual Basic source 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 pushbutton is added to the SAPforms 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 Microsoft Visual Basic and create an organizational plan in your SAP System. Assign agents to the tasks.
  3. Start the APPROVE.EXE or CUSTOMER.EXE file.

One of the scenarios described above is then started.

Leaving content frame