SAP Workflow Customization Settings

40
Developing a simple application using steps "User Decision" and "Mail" 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,

Transcript of SAP Workflow Customization Settings

Page 1: SAP Workflow Customization Settings

Developing a simple application using steps "User Decision" and "Mail"

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 cases you can opt to create a

Page 2: SAP Workflow Customization Settings

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 3: SAP Workflow Customization Settings

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 4: SAP Workflow Customization Settings

 

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

Page 5: SAP Workflow Customization Settings

 

      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.

Page 6: SAP Workflow Customization Settings

 

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

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

Page 7: SAP Workflow Customization Settings

 

       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 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 8: SAP Workflow Customization Settings

 

  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 9: SAP Workflow Customization Settings

Now choose Execute to start the workflow.

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

Page 10: SAP Workflow Customization Settings

 

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

Page 11: SAP Workflow Customization Settings

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.

Page 12: SAP Workflow Customization Settings

Including custom text in the step "User Decision"

Whenever we create a step “User Decision” (For creation of User Decision step, click here) and provide with our own options like approve or reject, the work item would appear as follows: 

 

As marked in green in the above screenshot, the description available in the work item is a default one provided by SAP. In case we need to add our own text, do the following:

1.      Identify the task being used in the step “User Decision”.

In the step “User Decision”, click on the tab “Control”:

Page 13: SAP Workflow Customization Settings

 

In the tab “Control”, the standard task that is being used is displayed. In this case, the standard task that is being used is “TS00008267”. 

 

2.      Go to transaction PFTC_COP to copy the standard task. Select “Standard task” in the task type and enter the task number (without the prefix “TS”) in the “Task”.

Page 14: SAP Workflow Customization Settings

 

Click on “Copy task”. 

3.      Enter the abbreviation and the name as required.

Click on “Copy Task”. 

4.      Enter the package name as required.

5.      A new task would be created. Please note the task number that is created now.

6.      To change the task description, you can use the transaction PFTC.

7.      Now go back to workflow definition, transaction SWDD.

8.      Click on “User decision” and then click on the tab “Control”.

9.      Here replace the standard task number with the custom task created above.

10.  Do the agent assignment and generate the same. 

It is always advisable not to change any of the standard texts. The change would reflect in all the workflow definitions the task is being used.

Page 15: SAP Workflow Customization Settings

Creating a Container element

This document details about creation of a container element in workflow and using it in the step "Mail".

Pre-requisites:

It is assumed that the reader of this Tutorial is aware of creating a workflow definition with the step “Mail”. If not, please go through the document on creating the same available, by clicking here. 

Steps: 

1.      Create a workflow definition using the transaction SWDD.

 

2.      Let’s create a container element for Carrier id. Click on the “Workflow Container” on the left side of the screen (as shown in the screenshot below):

Page 16: SAP Workflow Customization Settings

 

3.      Now double-click on “Double-Click to Create”

 

4.      Enter the details pertaining to CARRID here.

Page 17: SAP Workflow Customization Settings

 

5.      Click on tab “Properties” and select “Import”.

Page 18: SAP Workflow Customization Settings

 

6.      Click on “Confirm (Enter)”.

7.      Now the element created could be seen on the left side, below the “Workflow Container”.

1.      Create a “Mail” step by double-clicking on “Undefined” step in the workflow.

Page 19: SAP Workflow Customization Settings

 

2.      Enter the recipient details in the “Recipients” box.

3.      In the subject line, enter “Carrid value entered is:” and click on “Insert Expression”.

 

Page 20: SAP Workflow Customization Settings

4.      Select the element “Carrid” from the list.

 

 

5.      Similarly enter the content in the “Body” area.

 

6.      Save and activate the application. 

Testing the Workflow application: 

7.      Test the workflow by clicking F8.

Page 21: SAP Workflow Customization Settings

 

8.      Enter the value of the Carrid as shown above and press execute.

9.      A mail would be sent to the recipient mentioned earlier with the carrid value entered.

Page 22: SAP Workflow Customization Settings

SAP Workflow Customization Settings (How to do)

This document details the basic workflow customization that needs to be done in any SAP system before activating the workflow definitions.

Go to transaction SWU3. <For this demo, we have used an ECC 6.0 IDES system>

The description or the help for each of the above steps are available on the right side of the screen.

Configure RFC Destination

This can be done automatically or manually. If done automatically, as mentioned on the right side frame, the logical RFC destination WORKFLOW_LOCAL_XXX is created (if not available). XXX is the client number. Also the user WF-BATCH is also created if not already available.

The advantage of executing the above step manually is we can maintain another user and password as required.

Select the step “Configure RFC destination” and click on F9.

If you happen to get the following popup, click on Yes.  

Page 23: SAP Workflow Customization Settings

Once the RFC destination, you can see the Green Tick mark beside “Configure RFC Destination” (as shown in the screenshot below)

Maintain Workflow System Administrator

Since the system being used for this demo is an IDES system, some user is maintained as workflow administrator. You can change this to the desired User using this step.

Select “Maintain Workflow System Administrator” and click on F8.

Page 24: SAP Workflow Customization Settings

Now you can change the Userid to the desired one.

The steps “Maintain Active Plan Version”, “Classify Decision Task as General”, “Document Generation/Form Integration”, and “Maintain Time Units” are already in Green. If not in Green, select the corresponding step and click on F9. The automatic configuration would be done.

Schedule Background Job for Missed Deadlines

This is the job which checks if any work item has

Select this step and click on F8.

There are chances that you might encounter the following error:

To resolve this, you need to maintain the default printer in your user profile of WF-BATCH or change the printer to a valid one. Go to SWU1 and enter WF-BATCH. Navigate to tab “Defaults”.

Page 25: SAP Workflow Customization Settings

In the above screenshot, the output device is maintained as LP01 which is not valid. Here I am modifying the same to LOCL. Also the check box “Output immediately” is marked ‘X’.

Page 26: SAP Workflow Customization Settings

Save your entries.

Now let us go back to transaction SWU3 and the step “Schedule Background Job for Missed Deadlines”. Click on F8.

You would get the following screen:

Page 27: SAP Workflow Customization Settings

Depending on the business requirements, we can change the interval to the desired level. However 3 minutes is the minimum duration the system accepts.

Click on “Save and Schedule”. You would get the prompt for the customization request.

Now similarly schedule the jobs – “Work items with errors” and “Condition evaluation”.

For the step “Schedule Background job for Event Queue”, click on F9 (Automatic execution).

See the screenshot below:

Now we can observe the green tick mark beside “Maintain Runtime Environment”.  

Page 28: SAP Workflow Customization Settings

Now let’s move to “Maintain Definition Environment”

Maintain Prefix Numbers

All the objects related to workflow (standard task, workflow tasks and others) are assigned a eight digit number. The prefix number is used for the first 3 digits and the rest five is automatically assigned by the system (starting with 00001).

Select “Maintain Prefix Numbers” and click on F8.

Page 29: SAP Workflow Customization Settings

Click on Display<->Change.

Click on create.

Page 30: SAP Workflow Customization Settings

Enter a prefix number which is not allocated to any other client in the system.

Save your entries.

Now you can observe the green tick mark beside “Maintain prefix numbers”.

Page 31: SAP Workflow Customization Settings

If you do not intend to work with HCM related workflows, the next step “Check Entries from HR Control Tables” is not mandatory.

To maintain this step, please visit http://www.saptechnical.com/Tips/Workflow/Customization/HRTables.htm.

After completion of the above step, we can now observe that the steps regarding “Maintain Runtime Environment” and “Maintain Definition Environment” are in green now.

Page 32: SAP Workflow Customization Settings

Unless you plan to use the Guided Procedures, the above configuration should be fine to work with the workflows in SAP R/3.

Now to test the workflow configuration, click on “Start verification Workflow (F5)”. We would get the following popup message:

Now go to your SAP Inbox to check the work item (Transaction SBWP)

Page 33: SAP Workflow Customization Settings

Execute the work item.

We can choose one of the two options to test the workflow configuration. Let us chose the first one.

You would now receive two emails in your SAP inbox:

This completes the workflow configuration. 

Page 34: SAP Workflow Customization Settings

Useful Transactions in SAP Workflow

Transaction Code Description

OOAW Evaluation paths

PFAC_CHG Change roles

PFAC_DEL Delete roles

PFAC_DIS Display roles

PFAC_INS Create roles

PFOM Maintain assignment to SAP organizational objects

PFOS Display assignment to SAP organizational objects

PFSO Organizational environment of a user

PFTC_CHG Change tasks

PFTC_COP Copy tasks

PFTC_DEL Delete tasks

PFTC_DIS Display tasks

PFTC_INS Create tasks

PPOCW Create organizational plan

PPOMW Maintain organizational plan

PPOSW Display organizational plan

SWDA Workflow Builder (Calls the Workflow Builder in alphanumeric mode)

SWDD Workflow Builder

SWDS Workflow Builder (Selection)

SWDD_CONFIG Workflow configuration

Page 35: SAP Workflow Customization Settings

SBWP The Business Workplace

SWDC_DEFINITION Workflow Builder administration data

SWDC_RUNTIME Workflow runtime administration data

SWNCONFIG Extended notifications for business workflow

SWDM Business Workflow Explorer

SWEINST Evaluation and maintenance of instance linkages

SWEINSTVC Evaluation and maintenance of instance linkages

SWE2 Evaluation and maintenance of type linkages

SWE3 Evaluation and maintenance of instance linkages

SWE4 Switch event trace on/off

SWEL Display event trace

RSWELOGD Delete event trace

SWEC Link change documents to events

SWED Assign change document objects to object types

SWEQADM_1 Event queue administration

SWEQBROWSER Administration of event queue browser

SWETYPV Evaluation and maintenance of type linkages

SWI1 Selection report for work items

SWI2_FREQ Work items per task

SWI2_DEAD Work items with monitored deadlines

SWI2_DURA Work items by processing duration

SWI11 Tasks in workflows

Page 36: SAP Workflow Customization Settings

SWI13 Task profile

SWI5 Workload analysis

SWL1 Settings for dynamic columns

SWLV Maintain work item views

SWFVISU Parameters for Work Item Visualization in the UWL

SWO1 Business Object Builder

SWO6 Customizing object types

SWR_WEBSERVER Customizing Web server

SWU_CONT_PERSISTENCE Administration of container persistence

SWU_EWCD Wizard for event creation using change documents

SWU_EWLIS Wizard for event creation using the Logistics Information System

SWU_BTE Wizard for event creation using Business Transaction Events

SWU0 Event simulation

SWU2 RFC monitor

SWU3 Automatic Workflow Customizing

SWU4 Consistency check for standard tasks

SWU5 Consistency check for customer tasks

SWU6 Consistency check for workflow tasks

SWU7 Consistency check for workflow templates

SWU8 Switch workflow trace on/off

SWU9 Display workflow trace

SWU10 Delete workflow trace

Page 37: SAP Workflow Customization Settings

SWUD Diagnostic tools

SWUE Trigger event

SWUI Start workflows/tasks

SWUS Testing workflows/tasks

SWXML Display XML documents

SWUY Wizard for linking messages to workflows

SWWCOND_INSERT Schedule background job for work item deadline monitoring

SWWCLEAR_INSERT Schedule background job for clearing tasks

RSWWCOND Execute single background job for work item deadline monitoring

RSWWCLEAR Execute work item clearing work once

WF_HANDCUST WebFlow service handler maintenance

WF_EXTSRV Maintain Web Service Repository

WFWS Import WSDL files