What is SAP Business Workflow?
SAP Business Workflow TCodes: SAP Workflow uses the existing transactions and functions of the R/3 System and does not change the functions. You can combine the existing functions of the R/3 System to form new business processes with SAP Business Workflow.
The workflow system takes over control of the business processes. If you are already using SAP Organizational Management, you can use the organizational structure created there to have the relevant agents carry out the individual activities. It is possible to have an activity carried out by a position. This ensures that the respective occupiers of the position can carry out the individual activities during execution of the workflow. This means that personnel changes in your organization are taken into account immediately in the execution of a workflow.
Simple Scenario :
Workflow is a process i.e for example if you want to apply for a leave in an oganisation, you will just login and send a request for number of days. In the back end process, i.e who should approve your leave and after approval one day from your total leaves is deducted or if you are not having leaving leaves it should go to finance dept so that loss of pay leave is given. All this is called work flow, as a developer we will configure this workflow.
In SAP system, you have built-in functions that defines different tasks to be performed in the workflows. These are related to creating new workflows, workflow tools, workflow diagnosis, performance, workitems and administration of workflows.
Few common T-codes and their description is mentioned in the following table −
Sr.No. | Transaction Code & Description |
---|---|
1 | PFACCreate and maintain Rules |
2 | PFOMMaintain assignment to SAP organizational objects |
3 | PFOSDisplay assignment to SAP organizational objects |
4 | PFSOOrganizational environment of a user |
5 | PFTCCreate and maintain tasks |
6 | PPOCWCreate organizational plan |
7 | PPOMWMaintain organizational plan |
8 | PPOSWDisplay organizational plan |
9 | SWDAWorkflow Builder (Calls the Workflow Builder in alphanumeric mode) |
10 | SWDDWorkflow Builder |
11 | SWDSWorkflow Builder (Selection) |
12 | SWDD_CONFIGWorkflow configuration |
13 | SBWPThe Business Workplace |
14 | SWDC_RUNTIMEWorkflow runtime administration data |
15 | SWNCONFIGExtended notifications for business workflow |
16 | SWDMBusiness Workflow Explorer |
17 | SWEINSTEvaluation and maintenance of instance linkages |
18 | SWEINSTVCEvaluation and maintenance of instance linkages |
19 | SWE2Evaluation and maintenance of type linkages |
20 | SWE3Evaluation and maintenance of instance linkages |
21 | SWE4Switch event trace on/off |
22 | SWELDisplay event trace |
23 | RSWELOGDDelete event trace |
24 | SWECLink change documents to events |
25 | SWEDAssign change document objects to object types |
26 | SWEQADM_1Event queue administration |
27 | SWEQBROWSERAdministration of event queue browser |
28 | SWETYPVEvaluation and maintenance of type linkages |
29 | SWI1Selection report for workitems |
30 | SWI2_FREQWorkitems per task |
31 | SWI2_DEADWorkitems with monitored deadlines |
32 | SWI2_DURAWorkitems by processing duration |
33 | SWI11Tasks in workflows |
34 | SWI13Task profile |
35 | SWI5Workload analysis |
36 | SWL1Settings for dynamic columns |
37 | SWLVMaintain workitem views |
38 | SWFVISUParameters for Workitem Visualization in the UWL |
39 | SWO1Business Object Builder |
40 | SWO6Customizing object types |
41 | SWR_WEBSERVERCustomizing Web server |
42 | SWU_CONT_PERSISTENCEAdministration of container persistence |
43 | SWU_EWCDWizard for event creation using change documents |
44 | SWU_EWLISWizard for event creation using the Logistics Information System |
45 | SWU_BTEWizard for event creation using Business Transaction Events |
46 | SWU0Event simulation |
47 | SWU2RFC monitor |
48 | SWU3Automatic Workflow Customizing |
49 | SWU4Consistency check for standard tasks |
50 | SWU5Consistency check for customer tasks |
51 | SWU6Consistency check for workflow tasks |
52 | SWU7Consistency check for workflow templates |
53 | SWU8Switch workflow trace on/off |
54 | SWU9Display workflow trace |
55 | SWU10Delete workflow trace |
56 | SWUDDiagnostic tools |
57 | SWUETrigger event |
58 | SWUIStart workflows/tasks |
59 | SWUSTesting workflows/tasks |
60 | SWXMLDisplay XML documents |
61 | SWUYWizard for linking messages to workflows |
62 | SWWCOND_INSERTSchedule background job for workitem deadline monitoring |
63 | SWWCLEAR_INSERTSchedule background job for clearing tasks |
64 | RSWWCONDExecute single background job for workitem deadline monitoring |
65 | RSWWCLEARExecute workitem clearing work once |
66 | WF_HANDCUSTWebFlow service handler maintenance |
67 | WF_EXTSRVMaintain Web Service Repository |
68 | WFWSImport WSDL files |
69 | SWIAWI Administration Report |
SWF_GP SAP TCode – Guided Procedures
SAP TCode (Transaction Code) – SWF_GP SAP Business Workflow TCodes
SAP Tcode | SWF_GP |
Description | Guided Procedures |
Package | SWF_GP_DEF |
Program Name | RSWF_GP_DISPLAY_DEPLOYED_GPS |
Screen Number | 1000 |
Transaction Type | R |
Module | Basis Components ► Business Management ► SAP Business Workflow ► Runtime |
The SAP TCode SWF_GP is used for the task : Guided Procedures. The TCode belongs to the SWF_GP_DEF package.
SBWP_GP SAP TCode – SAP Business Workplace for GP
SAP TCode (Transaction Code) – SBWP_GP
SAP Tcode | SBWP_GP |
Description | SAP Business Workplace for GP |
Package | SWF_GP_RUN |
Program Name | RSBWP_GP |
Screen Number | 1000 |
Transaction Type | T |
Module | Basis Components ► Business Management ► SAP Business Workflow ► Runtime |
The SAP TCode SBWP_GP is used for the task : SAP Business Workplace for GP. The TCode belongs to the SWF_GP_RUN package.
SAP Runtime Tcodes
Tcode | Description | Module |
---|---|---|
SWF_GP | Guided Procedures | BC-BMT-WFM-RUN |
SWF_DEBUG SAP TCode – Edit Workflow Breakpoints
SAP TCode (Transaction Code) – SWF_DEBUG
SAP Tcode | SWF_DEBUG |
Description | Edit Workflow Breakpoints |
Package | SWF_DEBUG |
Program Name | SAPLSWF_DEBUG_GUI |
Screen Number | 1100 |
Transaction Type | T |
Module | Basis Components ► Business Management ► SAP Business Workflow ► Runtime |
The SAP TCode SWF_DEBUG is used for the task : Edit Workflow Breakpoints. The TCode belongs to the SWF_DEBUG package.
SAP Runtime Tcodes
Tcode | Description | Module |
---|---|---|
SWF_GP | Guided Procedures | BC-BMT-WFM-RUN |
Business Workflow
Administration
Basic Settings
Notifications
SWNADMIN – Administration of Extended Notifications (Browser)
SWNCONFIG – Configuration of Extended Notifications
WebFlow Services
WF_HANDCUST – Customizing for Service Handler
Workflow Runtime
SWDC_RUNTIME – Maintain System Administrator for Runtime System
SWF_RFC_DEST – Configure Workflow RFC Destination
SWPA – Customizing Workflow Runtime
Web Server
SWR_WEBSERVER – Customizing Web Server
Event Manager
SWEQADM_1 – Administrator for Event Queue
Workflow Definition Time
SWDC_DEFINITION – Workflow Builder
Workflow Runtime
SWF_GMP – Administrator Overview
Work Item Deadline Monitoring
RSWEWWDHSHOW – Display Background Job
SWWB – Schedule Background Job
SWWDHEX_DELETE – Unschedule Background Job
SWWA – Configure and Schedule Background Job
RSWWDHEX – Execute Work Item Deadline Monitoring
SWWDHEX_DEBUG – Execute Work Item Deadline Monitoring (Debug)
SWWERRE_DEBUG – Execute Work Item Error Monitoring (Debug)
Work Item Rule Monitoring
SWW_DISPSWWCOND – Display Background Job
SWWCOND_INSERT – Schedule Background Job
SWWCOND_DELETE – Unschedule Background Job
RSWWCOND – Execute Work Item Rule Monitoring
RSWWCOND_MON – Monitoring – Rule Monitoring
Clearing Tasks
SWW_DISPSWWCLEAR – Display Background Job
SWWCLEAR_INSERT – Schedule Background Job
SWWCLEAR_DELETE – Unschedule Background Job
RSWWCLEAR – Execute Clearing Tasks
Reorganization
SWW_SARA – Archive Work Item
SWW_ARCHIV – Display Workflows from Archive
SWWL – Delete Work Item
SWWL_TOPLEVEL – Delete Top Level Work Items with Dependent Entries
SWWH – Delete Work Item History
Container Handling
SWU_CONT_PERSISTENCE – Administrate Container Persistence
Application Log
SWF_APPL_DISPLAY – Application Log: Display Logs
SLG2 – Application Log: Delete logs
Notifications
Delete Completed Notifications
SWNNOTIFDEL_DISPLAY – Display Background Job
SWNNOTIFDEL_INSERT – Schedule background job
SWNNOTIFDEL_DELETE – Unschedule background job
SWNNOTIFDEL – Execute Immediately
SWI2_ADM1 – Work items without agents
SWI2_ADM2 – Work Items with Deleted Users
SWI2_DEAD – Work Items with Monitored Deadlines
SWI2_DIAG – Diagnosis of Workflows with Errors
SWIE – Unlock Workflows
SWIA – Execute Work Item Without Agent Check
SWPR – Workflow Restart After Error
SWPC – Continue Workflows After System Crash
SWU_OBUF – Synchronize Runtime Buffer
SWU2 – Workflow RFC Monitor
SWI1_COND – Check Conditions for Work Items
SWI1_RULE – Execute Rules for Work Items
SWF_ADM_SUSPEND – Restart Suspended Workflow Callbacks
SWF_ADM_SWWWIDH – Restart Suspended Deadline Callbacks
Event Manager
SWETYPV – Type linkages
SWEINST – Instance linkages
Event Trace
SWEL – Display Event Trace
SWELS – Switch Event Trace On/Off
RSWELOGD – Delete Event Trace
SWEQADM – Event Queue
SAP Workflow FAQ Techniques
What differences are there between a work item and a notification mail?
a) The work item cannot be used to notify several users. Mails can be routed to several users, just like work items. When a mail is sent, and one recipient reads and deletes the mail, all other recipients will still have access to their own copy in their own inbox. However, when a work item is processed by one of the recipients it will automatically disappear from all the other inboxes. So you can see that a work item is unsuitable for notifying several users. It is also worth noting that a mail can be forwarded in many different ways (fax, internet…) whereas the work item cannot.
b) The work item holds up the workflow
When the workflow sends a mail (usually as a background step) it continues with the process immediately after transmitting the mail. When a work item is generated, the workflow will not continue until the work item has been processed. This slows down the process. Occasionally this is what is intended (using the work item as an approval step without the ability to reject) but
usually you will better off using mails for notifications.
Note: You can send business objects as references with the mail either as a business object reference attached to the mail or as an URL (ABAP required).
What is the difference between sending a mail to a recipient list compared to sending individual mails via a dynamic loop?
Performance. Sending 1 mail to 20 recipients will cost considerably less performance than sending 20 individual mails. If the mail is sent as a SAP Office mail (as opposed to e-mail, fax…) disk space will also be a factor because the SAP office mail will only exist once in the database, with references being created for each of the recipients.
The only time you need to consider individual mails with a dynamic loop is when the text of the mail varies from one recipient to another.
How do I send a standard text as an e-mail from workflow?
It is very easy sending standard text , which may include data from the workflow. You simply create a background step which sends the work item description. This may include variables which will be substituted when mail is sent.
In early releases you have to create your own task based on the method SELFITEM SendTaskDescription. In later releases a wizard is available for creating the step and in release 4.6 there is even a step type which does this all for you automatically.
Whichever path you take, there is very good online documentation describing exactly what has to be done.
How do I send a complex text from the workflow?
You may create mails using SAPscript. These mails can include conditions which are evaluated in order to determine which text blocks which are used in the mail. Workflow variables can be used in these conditions and workflow variables can be substituted into the body of the e-mail text.
How do I send really complex mails from the workflow?
If you this is not enough for you will probably want to write your own ABAP routines for generating the text and generating the attachments to go with the text.
Use the function group SO01 which contains functions of the form SO_*_API1 which are ideal for creating your own sophisticated messages. There are plenty of advantages of how these are used within the SAP system.
How do I send reports?
There are wizards (Release 3.1) which will create workflows for you to send reports to a distribution list. You can specify whether the results should be transmitted or evaluated at the time the recipient wishes to view the report. It is usually better to send the evaluation because this allows the recipient to see the results instantaneously, without having to wait for the
report to execute first.
Deadlines
How can I configure the workflow so that different types of messages are sent out to different people depending on how late the processing is?
Follow these steps:
1. Specify a deadline period for the step.
2. Specify a name for the event. This adds new branch from the step. More…
3. Add a new step to the branch which sends a mail message.
4. Add another step to the branch which sends out the second deadline warning (see mail steps above). Use deadlines in this step to configure an earliest start so that the second message is not sent until a further time has elapsed.
5. Repeat step 5 as often as you like.
How can I configure the workflow so that when the deadline is missed the workflow step is simply skipped?
This is tricky to explain but easy to implement once you know how.
Follow these steps (in later releases there is a wizard which takes you through the steps):
1. In the terminating events view of the workflow step activate the “obsolete” event and give it a name. More…
2. Specify a deadline period for the step.
3. Specify a name for the event. This adds new branch from the step. More…
4. Add a new step to the deadline path. This step must be of type “process control”.
5. Select the control “Make step obsolete” and use the search help to specify the workflow step that has the deadline. Only steps with obsolete paths defined will be displayed (see step 1).
How do I trigger a workflow with an e-mail?
You can customize the system to call a BOR method when an external mail (fax, e-mail…) arrives in the system. You BOR method should either trigger the e-meil directly or trigger an event. To customize this user exit use the transaction SCOT.
How can I make sure that user’s access their tasks via the workflow and not via the menu or launch pad?
The routing mechanism for work items uses roles and organizational assignments to determine who receives which work item. However the routing does not provide extra authorization checks based on the routing configuration. If you want to ensure that the tasks are executed within the workflow, and not via the standard transaction, service or MiniApp, then you will have to apply your own protection.
The simplest way of doing this is to remove the standard transaction from the user’s menu or Workplace role (but include it in the supervisor’s role, just in case).
If you want to allow the user to execute the task from the menu if and only if they have received the work item then you should replace the standard transaction with your own custom built transaction. Your own transaction simply calls the standard transaction but performs it’s own authorization check first, based on the routing mechanism used in the workflow.
Tip: Add a second (ored) authorization check to make sure that a supervisor can execute the transaction in an emergency.
New branch for deadline step
By specifying the event name for a missed deadline (of whatever type) you are indirectly telling the workflow system that you want to add flow logic to your workflow to meet this event.
Don’t be put off by he fact that the branch does not lead anywhere. This is because the branch is not an alternative to the other results of the step. It is followed in addition to the other paths. In other words the workflow processing specified for a missed deadline is followed without affecting the standard flow. The step with the missed deadline remains where it is and can still be processed as normal.