1. Difference between Rule and Role Rule A Rule is a general way to 'define' your agents.
A rule is maintained with Transaction code PFAC and is used to programmatically define the agents. For example, if you want a work item to go to all managers who worked for the company for 5 years or more, then you would have to create a rule that handles this custom scenario. Typically this is done by creating a custom function module that performs your selection logic and passes the results back to the rule. You can define a container element that contains the object of Organizational Management at runtime or a rule for dynamic agent determination.
Role A Role is a general way to 'assign' your agents.
A role is maintained with Transaction code PFCG and is usually assigned to a User (someone with a valid login). For example, you can have the role of ABAP_DEVELOPER and assign this role to all users who are developers. This is a good method to use if you want ALL developers to receive a workflow work item.
You can specify not only a system user, but also a role or an object of Organizational Management such as a position, a Job, an organizational unit or a work center.
2. Difference between BAPI and BOR.
3 .How to assign general task? what is the use of general task?. In the agent Assignment attributes we will assign a general task Use of General Task:- you determine that all users can perform this task (in workflow).
General Forwarding Allowed
This indicator determines that work items assigned to this task can be forwarded to all users, even if the task has not been assigned to the user.
General Forwarding Not Allowed
This indicator enables you to determine that work items for this task can only be forwarded to users who are agents for the task. If this indicator is not set, a work item for this task can be forwarded to all users.
Forwarding Not Allowed
Classification of task
Tasks can be classified into various different classes. Tasks are classified as 1.subject matter, 2 personal, 3. disciplinary or are not assigned to any class at all.
Task Properities. Agent Assignment Background Assignment Task Complete Confirm End of processing
what is mean by agent assignment? Indicator denoting that the referenced single-step task has possible agents assigned to it.
Possible agent:- User who is authorized organizationally to start a task and execute the relevant work item.
List of Agen types:1. 2. 3. 4. 5. 6. 7. 8. 9. Expression. Rule Organizational Unit. Job Position Workcenter User Workflow Initiator Superior of workflow Initiator
Define Substitutions and different types of Substitutions?
Substitutes are essential so that a users work items can be seen and executed by a defined replacement user. This ensures that work is not left unattended if someone is out of the office unexpectedly. Below are details of the different kinds of substitutes
Passive Substitution If Passive substitution is used then the substitute (User B) only sees the work items of User A. User A sets up the substitution but does not activate it, then User B can Adopt the substitution if User A is out of the office unexpectedly. (As of NW04s SP04 a new setting in customizing enables you to define which work items a substitute sees when they adopt a substitution (passive substitution). If the setting is set, the substitute sees both their own work items and those of the absent user. If the setting is not set (default setting), the substitute only sees the worklist of the absent user. Active Substitution Active substitution (for example, for absence due to vacations): In this case, the items belonging to the absent person are automatically assigned to the substitutes inbox (in addition to his own work items). If active substitution is used then the substitute will see their own as well as the agent they are substituting for. Active substitution is where User A is going on vacation and specifies User B as their substitute and activates the substitution.
Positional or Personal substitution
When you specify Positional substitution you can only see work items of a user that have been assigned to that position. When you use Personal substitution (Direct substitution) you can view your own work items plus all the work items of the other user (Whether they are assigned to a position or not).
Dynamic parallel processing in SAP Workflow
Sometimes we need to process a dialog step (activity) several times in parallel and we may not be aware of how many times exactly this step has to be processed. Consider this scenario: For a sales order, we need to check the available quantity of the line items (materials). For each value of this list, a particular function has to be performed. So we need to create different work items for each material. This is called dynamic parallel processing, since the number of line items is known only during runtime. To achieve this, follow these steps: 1. We need to define a multiline container for the material. 2. Go to "Others" tab of the dialog step (activity) 3. Enter this workflow container element on this tab. Restriction : The multiline element should not contain more than 99 values. At runtime, the workflow system generates from the step as many parallel work items as there are values in the multiline container element at that time. The number of values need not be known at definition time. If the table is empty, this step is ignored.
Define Binding? Binding editor is used to define binding between elements of different containers Points to be noted while defining binding between elements of different containers,
Elements should belong to same data type. Binding can be defined between compatible data types.
What is mean by Workflow Container. 5 different containers in workflow:
1. 2. 3. 4. 5. Workflow container Task container Method container Rule container Event container
Workflow container: a. b.
Binding can be defined from Workflow to Event Container. Binding can be defined from Workflow to Task Container.
Binding can be defined from Workflow to Rule Container. Binding can be defined from Event container to Workflow Container. Binding can be defined from Event container to Task container.
a. b. c.
Binding can be defined from Task to Workflow container. Binding can be defined from Task to Rule container. Binding can be defined from Task to Method container.
Method Container: Binding can be defined from Method to Task container and method container. Rule Container: Binding can be defined from Rule container to Workflow container.
1 If an error occurs during rule resolution. • In SAP Business Workflow. Therefore. Only if errors are found. • If a rule is used in a workflow to determine the responsible agent. Any errors and warnings discovered are displayed in the message area of the Workflow Builder. setting the termination indicator for the rule resolution determines how the workflow will continue: Flag is selected . you select . • Each rule has just one rule container. the rule parameters constitute "input" for rule resolution. is the workflow definition not activated.the workflow assumes an Error status and a notification is sent to the workflow administrator. The rule parameters determine which information is required for the rule resolution to be executed at runtime. • At runtime. The workflow definition is first subjected to a syntax check. If no errors are found (no red traffic lights in the message area). context-specific information that forms the basis of rule resolution.
1 2 A rule container is defined for each rule. Indicator is not activated .How to customizing the business object?
How to activate the workflow builder?
To set the workflow definition to status active. the workflow definition is saved and activated. the rule parameters contain the current.
Define Rule and its types?
The rule container contains a rule’s parameters.the workflow forwards this work item to ALL possible agents. binding feeds the rule parameters with values from the workflow container. the system fills the rule container from the task container using binding.
Use The following types of Rules can be resolved: Agent determination rules
. the result of rule resolution is stored in the container element _RULE_RESULT and can be transferred to the workflow container by binding. If a task contains default rules.
If there is no error in the workitem 1. give the work item id and then execute.go to tcode SWUS_WITH_REFERENCE
2. WebFlow Rules WebFlow rules are used within a workflow in the basic data and in the Web activity step type. determine the responsible agents of a work item who have certain characteristics. but the old workflow is still in the same status. And the new status will come as status in the execution output:-
Here give the workflow instance (ID) of old workflow and execute. so you need to logically delete the old workflow. You can do it via two ways:1. Using a WebFlow rule you can individually execute the following parts of a Web activity: 1 2 3 4 5 Determination of URL Preparation of the XML document Determination of the authentication data Execution of the send procedure Determination of transfer format
How to restart the workflow? Go T-code SWPR Tick the check box restart immediately.Agent determination rule is used in SAP Business Workflow for example. SWW_WI_ADMIN_CANCEL execute the function module. Even the new workflow has been created.
Check the workflow logs of the old workflow. double click on the first line in workflow logs:-
. which will now show the status “Logically Deleted”:-
2. Go to transaction SWI1. enter workflow instance (ID) of old workflow and execute:-
In the output. select your work item line and click on log button:-
In the logs.
Then on the next screen. click on Change option in Edit menu:-
On the next screen. click on “Execute” button for “Logically Delete” option:-
which will now show the status “Logically Deleted”:-
Related T-codes in workflow
Path from area menu SAP Business Workflow (Development) Wizard for event creation Workflow Information System Definition tools → Event creation → Set up with wizard Reporting → Workflow Information System Event Creation
Workflow Information System (WIS)
.Below pop-up will appear. confirm it:-
The work flow gets deleted:-
Check the old work flow logs.
(WIS) OOAW PFAC PFAC_CHG Evaluation paths Maintain standard role Change roles Definition tools → Standard roles → Change Definition tools → Standard roles → Delete Definition tools → Standard roles → Display Definition tools → Standard roles → Create Definition tools → SAP org. objects → Display assignments Making Links in PD Organizational Management Role Definition
Maintain assignment to SAP organizational objects Display assignment to SAP organizational objects Organizational environment of a user Maintain customer task General task maintenance Change tasks
PFSO PFT PFTC PFTC_CHG
Creation and Processing of Tasks Definition tools → Tasks/Task groups → Change Definition tools → Tasks/Task groups → Copy Definition tools → Tasks/Task groups → Delete Definition tools → Tasks/Task groups → Display Definition tools → Tasks/Task groups → Create
. objects → Create assignments Definition tools → SAP org.
part of ongoing settings Definition tools → Business Workflow Explorer Utilities → Events → Type linkages Utilities → Events → Instance linkages Utilities → Events → Event log → On/off Definition tools → Event creation → Change documents → Linkage Definition tools → Event creation → Change documents → Define workflow properties Utilities → Events → Event log → Display Definition tools → Wizards → Workflow
Simplified Definition of Standard Tasks
Enterprise-Specific Organizational Plan
(Ongoing) Settings Workflow Editor Administration Data Maintenance Functions of Business Workflow Explorer Type Linkage Table Maintenance Instance Linkage Evaluation Event Log Creation of Events When Change Documents Are Written
SWE2 SWE3 SWE4 SWEC
Assignment of change document objects to object types
Maintenance of Workflow-Relevant Settings for Change Documents
Display event log Workflow Wizard Explorer
Event Log Workflow Wizard Explorer
.PFTR PFTS PFWF PFWS PPOC
Standard task for transaction Standard task Maintain workflow task (customer) Maintain workflow template Create organizational plan Maintain organizational plan Display organizational plan Ongoing settings Workflow editor administration data Business Workflow Explorer Display and maintain event type linkage Display instance linkages Switch event log on/off Link change documents to events Definition tools → Organizational plan → Create Definition tools → Organizational plan → Change Definition tools → Organizational plan → Display Administration → Settings Customizing.
part of ongoing settings
Area Menu SAP Business Workflow (Development)
SWLP SWLV SWLW
Views Area Menu SAP Business Workflow (Organization) Business Object Builder
Adapting Object Types on a Customer-Specific
.Wizard Explorer SWF4 Workflow Wizard Repository Selection report for workflows Work item analysis Workflow outbox Task analysis Workload analysis Object links Workflow resubmission folder Error overview Definition tools → Wizards → Workflow Wizard Repository Utilities → Work item selection Reporting → Work item analysis Runtime tools → Workflow outbox Reporting → Task analysis Reporting → Workload analysis Runtime tools → Object links From integrated inbox or workflow outbox Part of administration of workflow runtime system (transaction SWUF) Customizing. part of ongoing settings Utilities → Consistency check → Organizational assignment Workflow Wizard Repository Selection Report for Finding Work Items Work Item Analysis Workflow Outbox Task Analysis Workload Analysis Object Links Workflow Resubmission Folder Error Selection
SWI1 SWI2 SWI3 SWI4 SWI5 SWI6 SWI7 SWI8
Settings for dynamic columns Check tasks for agents
Defining Dynamic Columns for Integrated Inbox Display Organizational Assignment
Workbench for Workflow 4. choose Customizing.0 Business Object Builder Customizing object types Definition tools → Business Object Builder From Business Object Builder.0 Copy plan version Maintain work item views Workbench for Workflow 3.
List of Problems and Solutions Creation of an Event for Test Purposes Administration of Workflow Runtime System Definition of a Start Transaction for a Workflow Starting a Task in Dialog
Starting a Task in Dialog
. choose Office → Start workflow SWUS Start tasks Runtime tools → Start
Basis Simulation: Event Creation RFC Monitor Auto-Customizing and Consistency Check for Customizing Consistency Check for Tasks
Consistency check for customer tasks
Consistency check for workflow tasks
Consistency check for workflow templates
SWU8 SWU9 SWUD SWUE SWUF
Switch technical trace on/off Display technical trace Diagnostic tools Trigger event Runtime system administration Workflow start transactions Start workflows
Error Diagnosis .Settings → Delegate → System-wide SWU0 SWU2 SWU3 Event simulation RFC monitor Customizing consistency check Consistency check for standard tasks Utilities → Events → Simulate event Utilities → Workflow RFC monitor Utilities → Customizing Utilities → Consistency check → Task → Standard task Utilities → Consistency check → Task → Customer task Utilities → Consistency check → Task → Workflow task Utilities → Consistency check → Task → Workflow template Utilities → Technical trace → On/off Utilities → Technical trace → Display Utilities → Diagnosis Utilities → Events → Generate event Administration → Runtime system Definition tools → Workflow start transactions From the R/3 initial screen.
requested item must have started end. and latest end to monitor the progress by this date. Processing is not possible before this date. The system triggers the actions described below if the work item has not been processed by these dates.
.workflow SWUY Wizard for message linkage to workflow Definition tools → Wizards → Create "Call workflow from message" Starting a Task From Message Long Text
SWX1 SWX2 SWX3 SWX4 SWXF
Create notification of absence Change notification of absence Display notification of absence Approve notification of absence Form applications: Access point Environment → Demo examples → Fill out form Demo Example: Processing a Notification of Absence
Dead line monitoring:
The runtime system allows the deadlines to be monitored for the execution of work items and the overall workflow. Dead lines can be set and monitored for the below steps in workflow activity. of the work item and compares these dates with the current dates that result from processing the work item. user decision and wait step.
Requested start The requested start is a technical setting and is implemented by the workflow system. Latest start Start by Processing of the work The system uses the latest start.
The creation date/time of the workflow containing the work item.Requested end
Processing of the work item should have been completed by this date. This reference point can be
• • •
The creation date/time of the work item.
If a deadline is exceeded. Notification of the deadline agent or the steps following a deadline event are therefore carried out asynchronously and do not complete the original activity/user decision. A date that is derived from the context of the application when the specific workflow instance is executed.
The deadlines are always set relative to a reference point. This date is defined via an expression containing a reference to the workflow container. the activity/user decision involved has not yet been completed.
Workflow Steps: 1) Activity 2) Web Activity(not frequently used) 3) Send Mail 4) Form 5) User decision 6) Document from template 7) Condition 8) Multiple conditions 9) Event Creator 10) Wait 11) Container Operation 12) Process Control 13) Loop (until)
. Processing of the work item must have been completed by this date.
This will clear the air that Workflows are generally used for sending mails. Flow based on Conditions.
. Filling up Forms etc. Uploading Documents. Basically like the Flow of Work. Workflows can handle a lot many affairs.14) Fork 15) Ad Hoc Anchor 16) Block 17) Local Workflow
Brief Overview of Workflow Step-Types
This WIKI will help the readers to know more about the Step-Types that are used in Workflows and a wide Implementation of these Step-Types. Various Functionalities can be Implemented like.
Container Operation is a Step-Type that is used for calculations with the help of Workflow Containers. Apart from sending mails. Flow based on Conditional Events. Workflows can work like Algorithms in the background as well as Foreground to make the task appear in a Flow. Flow based on calculations.
This Step-Type is used to derive various Arithmetic calculations from the Workflow Elements. we should give an Arithmetic Condition. for example:C = A + B (where all these 3 should be WF Containers) Result Element = Source1 [(Operator)] Source2
. based on whose result the WF moves further. To implement this Step-Type.
The various Arithmetic functions available are: Multiplication Addition Subtraction Division One should create 3 WF Containers.
Note: Here the Source and the Target Elements should be the Workflow Containers. Multiple Conditions can be implemented in 2 ways:Case Switch
. The Outcome of this Step-Type would be Numeric/Decimal always with 1 value. These WF Containers can have Dynamic values as well as Hard-Coded values from the WF Container.
Multiple Conditions is a case that is implemented where we have to check so many conditions at 1 time. This Arithmetic Operations take place between the values of the Workflow Containers.
.If the condition is like this:If name = 'ABC' Do this. * Else if name = 'XYZ' Do this. * * Else if name = 'PQR' Do this. The values that we pass to this WF Container Element using Binding are the Actual Values that we look for Comparison. * * Else Do this In this example ()name should always be defined as the Workflow Container Element.
Loop is a condition that is used when one has to check for a particular Condition being FALSE or TRUE. Here we can put any Condition involving 1 or more than 1 Container Elements.Number of Values for Comparison = Number of Branches from the Multiple Condition Step-Type
There are 3 conditions to check the name. so now we have 3 branches that will separately process each of the Condition being implemented.
.If the Condition gets satisfied.
Process Control is a very important Step-Type. The Loop Terminates and Moves on to the Next Element in the WF's. since it performs a lot of Functions. the Loop Continues or else if the Condition goes False.
Cancel Work item
The process control step should be located in the branch of a parallel section. Press F4 to find all possible entries for the node numbers. we must enter its node number in the 'workflow step' field.
.Now let us look at each of the Functions individually. To uniquely identify the work item to be canceled.
all work items of the workflow are set to the status logically deleted. to the status completed and continue processing in the branch processing obsolete.
Using this function.The work item selected is set to the status logically deleted at the time of step execution. In order to uniquely identify the work item to be cancelled. If the step Process control is located in a workflow that is used as a sub workflow. We can then set the work item that has exceeded its deadline.
. It terminates. when process control is located in the branch of a modeled deadline monitoring. The workflow is not continued after this work-item. the branch of the calling workflow that contains the sub workflow is stopped. we must enter its node number in the field workflow step.
Set Work-Item to Obsolete
Use this Function. Press F4 to find all possible entries for the node numbers.
the calling workflow is continued.
Using this function.The work item selected is set to the statuscompletedat the time of step execution. workflow work items are set to the status completed. all work items of the workflow are set to the statuslogically deleted. the calling workflow as well as all the work items in it is set to the statuslogically deleted.
Cancel Workflow (Including all Callers)
Using this function.Thewholeworkflow is stopped using this function. If the step process control is located in a workflow that is used as a sub workflow. For Details of Sub-Workflow or Local Workflow. If the step Process control is in a workflow that is to be used as a sub workflow.
A correlation enables us to identify objects that belong together.
. Specify how the value of the correlation is to be determined:
BasisElement: If we have defined the binding in the definition of the correlation.Choose the event that the correlation is to be activated for.
In the fieldCorrelation Instance. choose the container element for the correlation object. If we have defined a correlation by using the correlation editor (Environment->Development->Correlation Editor). and the correlation to be activated. It can then be used in a wait step. we can activate it here. Binding: Choose this entry if we want to define a binding between the Workflow container and the correlation container. we can specify a container element that references the corresponding basis element from the correlation definition.
The correlation object shows the value of the correlation. We define local events in the version-dependent basic data of the Workflow.
. The containerelement for the correlation object must have the predefined data type CL_SWF_MOD_CORRELATION. A local event can be the following:
An exception that is triggered by a step of typeProcess Control. You define the exception handler in the block.
Give a name to the Local Event created.
Here we can trigger local events of typeException.
We can define a local event or an exception in the version-specific basic data of the Workflow. here the name is'New LocalEvent'. We define the exception handler in the block.
Wait Step-Type is used when we need to wait for either an Event to happen or a Condition to get satisfied. You can use a local event to start a local Workflow.
. a step of typeWait for Eventcan wait for a local event. Let us see these individually. so that we can proceed further with the Workflow.
C: Wait for Condition
The wait step is complete once the specified condition has been fulfilled. There are 4 conditions on which WAIT works:-
C: Wait for Condition L: Wait for Local Event W: Wait for Event by Using Workflow Wait for Event. Furthermore.•
A local event that is triggered by an event controller or an event.
L: Wait for Local Event
This step enables us to stop the execution of this branch of our Workflow until a local event has arrived.The object for which an event must occur must be in a container element of the workflow container.
Wait for Event
With this step. We only have to define a binding if we want to use the data of the event in the workflow. we stop the execution of this branch of our workflow until a defined event for a particular object occurs.
. Enter the desired container element and select an associated event.
it completes all wait steps that are waiting for this event. as soon as it is active.
W: Wait for Event by Using Workflow
When waiting for an event using Workflow.We should not use this step type in a fork to wait for an event that is triggered in another branch of the same fork. the event is initially received by the Workflow and transferred to the next step.If the event arrives.
This Step-Type is generally used when we need parallel processing which may or may not be based on any condition. the event completes the oldest wait step.When waiting using Workflow.
. an event can complete a maximum of one wait step. Specifying a Condition is not mandatory for a FORK to work. If more than one wait step is active.
start or continue another workflow. For this event Creator Step.The number of Parallel Branches specifies that these many are the ways for parallel processing.
This Event Creator step type is used when we have to implement a BO Event or a local Event after the WF has started. Enter the required container element and choose an event. the event must be defined for the BOR object type or class and a container element must exist in the workflow container.
. Do the necessary Binding. We can use this event to. which refers to this BOR object type or class.
This template can reference elements from the Workflow container.
Document from Template
The step type 'Document from Template' enables us to create documents in Workflow with different PC applications.
After Implementing This Step-Type. the next step would continue only when this Event is created in the Application. We can display and edit templates created in this way throughout the Workflow. WF won't continue from here. Until and unless. you can implement a Local Workflow to Start based on this Event Triggering Condition.After this Event Creator. These documents are based on a template that we create with the PC application when we define the Workflow. The Different PC Applications are:-
. this Event is satisfied.
How to create a Document Template? Choose this Step-Type.One must have saved the Workflow to be able to create a template.
. the template is opened in the relevant PC application and can be completed there.The receiver of the Workflow must have installed the PC application locally on their PC to be able to execute the work item. The document is then saved in a container element in the Workflow container. When the Workflow is executed.
Select one of the Options. Click on 'CREATE'.A workflow Container named WF_DOCUMENT_001 automatically gets created.
Select to assign a name for the document template and SAVE the Document template.After Selecting a PC Application. The system fields and the container elements of the workflow container are offered for selection in the navigation area. Now Execute the Workflow and it gives us the Option to select from the various Templates Created. The Container Fields that we have inserted in our Template gets replaced by the Run-time Values. They can be transferred into the template by double-clicking.
.Select the Document that you created and find the runtime values.
Additional pushbuttons are generated for the approval actions. How to create and use a FORM? Create a WF Container – the Type of which you need the FORM to be. We can use a wizard to generate the form we need and we can edit the generated form and make our individual settings. Depending on the action chosen.
We can use a form to display or edit data of a container element of the workflow container that refers to a structure. Select the FORM Step-Type there. As well as the form. the workflow toolbox is automatically available in execution. We can use all the fields in the structure in the form. the form is displayed in either display or edit mode when executed.
.Click on CREATE.
.Click on CONTINUE.
.Click on CONTINUE.
. Form Created Successfully.
The FORM Format.Click on COMPLETE.
.Now Execute the WF.
The FORM opens up for you to fill. Just Fill the FORM and Press SAVE AND EXIT Button.
In a local Workflow we can model a part of the Workflow that is started by a local event.After you press the SAVE AND EXIT Button.
.CRM_ORDERADM_I in this case. the data gets saved in the required table from which the WF Container was made: .
. called as Local Containers.In this Local Workflow we should create our own Workflow Container Elements. These additional container elements are then available to all steps that belong to this local Workflow and can be filled from the Workflow container by either an initial value or a binding.
We only need to define a binding if we want to use the event data in a Workflow.
The Local Workflow Looks like this:-
. and Click Create. We must set the import indicator for local container elements that are filled by a binding from the Workflow container to ensure that the binding can be traced. so that this should act as a Sub-Workflow for the original WF in which this Local Workflow was created. Within this Local Workflow you can still create some more WF Steps. Select the Send-Mail and enter the values. Create a Send-mail Step in this Local Workflow:Right Click on the Down Arrow for Local Exception.
This Local Workflow will trigger for the Specified Event happening after the start of the original Workflow. In the Event Creator Step-Type.TRIGGER LOCAL EVENT. Use the Local Workflow as the Event Creator: .Implement this Local Workflow after the Event Create Step-Type and see the Effect.