Print sap business workflow - getting started

12
Developing a Simple Application Using SAP Business Workflow ©Copyright 2000 SAPTechnical.COM. All rights reserved. Developing a Simple Application Using SAP Business Workflow By

Transcript of Print sap business workflow - getting started

Page 1: Print   sap business workflow - getting started

Developing a Simple Application Using SAP Business Workflow

©Copyright 2000 SAPTechnical.COM. All rights reserved.

Developing a Simple Application Using

SAP Business Workflow

By

Page 2: Print   sap business workflow - getting started

Developing a Simple Application Using SAP Business Workflow

©Copyright 2000 SAPTechnical.COM. All rights reserved.

Developing a simple application using steps "User

Decision" and "Mail"

Prepared by Suresh Kumar Parvathaneni

Basic terminology used in the workflow:

The workflow definition is the set of rules that determine the path that the process takes.

For example, how a purchase requisition is processed, from the initial request to the

creation of the purchase order

A Workflow Instance, which is often simply referred to as the workflow, is a single

workflow run. For example, the processing of a single purchase requisition for

computers.

The Tasks are the steps in the process, which have to be performed either by people or

automatically by the software. For example, to check for the availability of the spare

computers in the company.

A Work item is the task instance that is performed as a single workflow step. For

example, check that there are no spare computers available in the company.

Agents are the people who process the tasks (via the work items). For example,

requisitioner and a member of the purchasing department.

Container is the place where all the data used in the workflow is collected.

Binding is the set of rules that define which data is passed to which part of the process.

Building a simple workflow application

The central tool for creating, displaying and processing a workflow is the workflow

builder (Transaction SWDD). Within the workflow builder you can create all components

of a workflow, including all the containers you need for getting the data from one step to

another.

Generally, most of the workflows are started by an event (for example, when a material is

created or when a new purchase requisition arrives). You define which data from this

event needs to be passed to the workflow via binding.

However you can also start any workflow directly. Let us create a simple workflow and

start the workflow directly, using the testing tools.

Call transaction SWDD. When the workflow builder is called for the first time, a newly

created initial workflow definition appears or else last created workflow appears. In such

Page 3: Print   sap business workflow - getting started

Developing a Simple Application Using SAP Business Workflow

©Copyright 2000 SAPTechnical.COM. All rights reserved.

cases you can opt to create a new workflow by pressing “Create New Workflow”(ctrl +

shft + F5). The following screen appears.

The initial workflow screen has the following parts:

a. The start of the workflow definition, indicated by .

b. The end of the workflow definition, indicated by . c. The area in which you insert the new workflow definition is indicated by

.

Now select the undefined step and select Create step or double click the undefined step. Now among the different steps chose the User Decision by double clicking on it.

Page 4: Print   sap business workflow - getting started

Developing a Simple Application Using SAP Business Workflow

©Copyright 2000 SAPTechnical.COM. All rights reserved.

Now enter the title for the user decision “ Please make a decision”. Also enter the decision texts as Approve and Reject. On pressing enter, the outcome values default to the Decision texts but you can specify your own names, if desired. Now we need to select the agent. Agent is the person to whom the work item needs to be sent.. Since this is just a beginning, we would hardcode the user name. Select the User from the drop down list and enter the user name to whom the work item needs to be sent. In general, this type of agent assignment is not done. Agents are generally assigned using the expression, agent assignment rule or organization object (job, position etc.).

Page 5: Print   sap business workflow - getting started

Developing a Simple Application Using SAP Business Workflow

©Copyright 2000 SAPTechnical.COM. All rights reserved.

Now select Transfer and to graphic button. Following screen appears:

Page 6: Print   sap business workflow - getting started

Developing a Simple Application Using SAP Business Workflow

©Copyright 2000 SAPTechnical.COM. All rights reserved.

Now we need to include a mail step to be sent to the requestor. Now select the line “Approve” and do a right click. Different options on shown on the context menu. Select Create.

Now enter the subject and the body of the message for the mail to be sent.

Page 7: Print   sap business workflow - getting started

Developing a Simple Application Using SAP Business Workflow

©Copyright 2000 SAPTechnical.COM. All rights reserved.

Do not change the recipients. Our mail is intended for the persons who triggered this workflow. &_WF_INITIATOR& contains the value who executed the workflow. Since this is a test object, we are using &_WF_INITIATOR&. But we wouldn’t be using this variable in real time scenarios. We would discuss about this in the coming documents.

Now select the step “Send Mail” from the list.

Page 8: Print   sap business workflow - getting started

Developing a Simple Application Using SAP Business Workflow

©Copyright 2000 SAPTechnical.COM. All rights reserved.

Now select Transfer and to graphic button.

A popup appears requesting for the abbreviation and the name for this task. Enter the

same and press enter.

Now enter the package as local object and press enter.

Follow the steps 5 through 9 for the step “Reject”. The following screen appears:

Page 9: Print   sap business workflow - getting started

Developing a Simple Application Using SAP Business Workflow

©Copyright 2000 SAPTechnical.COM. All rights reserved.

Press SAVE to save the workflow application. You need to enter an abbreviation and name for your workflow as shown below. You can change any of these at any later point. After saving, a number is assigned to your workflow starting with WS, as shown below.

To execute the workflow, activate it by choosing the activate button.

Test the workflow by choosing Test. The following screen appears.

Page 10: Print   sap business workflow - getting started

Developing a Simple Application Using SAP Business Workflow

©Copyright 2000 SAPTechnical.COM. All rights reserved.

Now choose Execute to start the workflow.

Now the recipient would receive a work item in his SAP® inbox (Transaction SBWP).

Page 11: Print   sap business workflow - getting started

Developing a Simple Application Using SAP Business Workflow

©Copyright 2000 SAPTechnical.COM. All rights reserved.

Now execute the work item by pressing “Execute”. The following screen appears:

Page 12: Print   sap business workflow - getting started

Developing a Simple Application Using SAP Business Workflow

©Copyright 2000 SAPTechnical.COM. All rights reserved.

Choose one among Approve or Reject as part of the user decision. He can select the third option to retain the work item in his inbox and make the decision later. Now suppose that the recipient has chosen one of the first options. Now a mail would be sent to the requestor with the status of his request.