SAP workFlow handbooks

December 6, 2017 | Author: George Mukiri | Category: Object (Computer Science), Hierarchy, Databases, Data Type, Parameter (Computer Programming)
Share Embed Donate


Short Description

SAP workFlow handbooks...

Description

1

WORKFLOW It is the automation of business procedures during which documents, information or tasks are passed from one participant to another in a way that is governed by rules or procedures.

ADVANTAGES OF USING WORKFLOW a. Duration of the process is reduced dramatically. b. The process definition becomes transparent i.e. everyone knows what they are doing and why. c. Each process instance is transparent. During the process run and afterwards you can track who did what, when. d. The process is under control. We can change the definition on the fly to improve it or react to sudden changes in the environment.

STEP TYPES ACTIVITY

Execution of a task. This task can be a single-step task or a Multistep task

WEB ACTIVITY

The selected container elements are posted using the http protocol in an XML or SOAP message. This step can also wait for a message reply.

DOCUMENT FROM TEMPLATE

Step type in a workflow definition for creating documents on the basis of user-defined templates at runtime. The documents can be created with programs that are installed on the local PC and are OLE-compatible, 32-bit, Windows applications (for example Microsoft Word 97).

LOOP (UNTIL)

Repeated processing of steps within the workflow definition. UNTIL and WHILE are available as loop types.

LOOP (WHILE)

Step type in a workflow definition for processing a sequence of steps repeatedly at runtime as long as the comparisons defined in the step definition apply. To make the decision, the workflow system checks the value of a basis of comparison (= expression from the workflow container) against the defined comparison values. The first check is made before the loop is processed.

SEND MAIL

The text entered in this step type is sent as an E-Mail. The task required and the necessary bindings are automatically created by the workflow system.

CONDITION

Step type in a workflow definition to execute one of two defined paths in the definition. ("Two-way fork"). The Workflow system decides on the path on the basis of the defined conditions and information contained in the Workflow container as values. You define conditions using the conditions editor, which allows you to define complex and multilevel conditions.

MULTIPLE CONDITION

Step type in a workflow definition to process one of more defined branches of the workflow definition at runtime. This is based on information from the context of the workflow or the objects processed. The value of the basis of comparison (expression from 2

workflow container) is checked against the comparison values defined. EVENT CREATOR

Step type in a workflow definition to create an event at runtime

WAIT FOR EVENT

The system waits for a specified event. The workitem is only completed if the expected event occurs. Data from the event container can be sent to the workflow container using a binding.

CONTAINER OPERATION

Step type in a workflow definition for performing elementary arithmetic operations or value assignments on individual elements of the workflow container at runtime.

FORK

Arrangement of independent steps in their own individual parallel processing branches. You can specify that only a proportion of the parallel processing branches has to be processed in order to continue the workflow afterwards. Parallel processing can be ended by the specification of a minimum number of branches to be processed or by the definition of a termination condition.

UNDEFINED

Step type without functionality which can be inserted as a placeholder in a workflow definition. Undefined steps are always followed by an undefined event. Together they form a unit and therefore ensure the consistency of a workflow definition. The initial representation of a workflow definition contains an undefined step and an undefined event. Undefined steps can also be inserted whenever individual steps are required in a generated block but still need to be specified according to particular rules

PROCESS CONTROL

The functions Cancel work item or Set work item to obsolete are applied to other Work items of the current workflow. It will be useful to cancel any previous work item.

USER DECISION

In User Decision Title (Max. 80 Chars). 4 User parameters from workflow container can be substituted. [Substitution by position]. Ex : Title : Leave Approval Done by &Workflow Version& Sales Order Number &Customer No& P1 : &Wf_Initiator& P2 : &WF_Version& P3 : &Sales.Salesdocument& P4 : &Sales.OrderingParty. Customer No& Result : Title : Leave Approval done by US KAAV02 workflow Version0000 Sales Order No. 7343 Customer No. 470.

AD HOC ANCHOR

U specify workflows that can replace this step. At runtime, an authorized user can select one of the specified workflows. The steps of this workflow then dynamically replace the Ad Hoc Anchor.

SUB WORKFLOW

An activity that refers to another workflow rather than a task. A binding from the workflow container interfaces with the sub-workflow container.

3

MACROS (INCLUDE ) For Declaring Purpose: BEGIN_DATA END_DATA

> >

For Attributes: GET_PROPERTY CHANGING CONTAINER Start of a virtual attribute implementation GET_TABLE_PROPERTY Start of the database attribute implementation END_PROPERTY. End of an attribute implementation. For Method: BEGIN_METHOD CHANGING CONTAINER Start of a method implementation END_METHOD End of a method implementation For Object Key SWC_SET_OBJECTKEY . Sets the object key of the current object. Usually only instance independent methods use this to return a reference to an object instance of the current object.

MACROS FOR METHOD EXCEPTIONS EXIT_OBJECT_NOT_FOUND EXIT_CANCELLLED

Tells workflow that an object does not exist. Tells workflow that the user cancelled execution Of a method EXIT_RETURN Tells workflow that an error has occurred. EXIT_NOT_IMPLEMENTED Tells workflow that a method is not implemented. EXIT_PARAMETER_NOT_FOUND Tells workflow that a mandatory parameter of a Method is missing.

MACROS TO PROCESS A CONTAINER SWC_CONTAINER Declares a container SWC_CREATE_CONTAINER Initializes a container. The macros SWC_RELEASE_CONTAINER and SWC_CLEAR_CONTAINER have the same functions.

MACROS TO PROCESS ELEMENTS FROM THE CONTAINER SWC_GET_ELEMENT Read Single value element from the CONTAINER INTO A VARIABLE. SWC_SET_ELEMENT Write single value element from a VARIABLE TO THE CONTAINER. SWC_GET_TABLE Read Multiline element from the container into an internal table. SWC_SET_TABLE Write Multiline element from an internal table to the container. SWC_COPY_ELEMENT < Source Cont.Ele.> 4

Copies a container element from a source container to a target container. SWC_DELETE_ELEMENT Deletes a container element.

MACROS FOR CALLING OBJECT METHODS SWC_CALL_METHOD Calls the method of an object. All parameters are passed to / from the method as contents of the container.

MACROS FOR PROCESSING OBJECT REFERENCE SWC_CREATE_OBJECT Create an object reference from an object type and object key. SWC_REFRESH_OBJECT Invalidates the object reference buffer so that all attributes will be recalculated when they are next called. SWC_GET_OBJECT_KEY Returns the object key of an object reference. programming. SWC_GET_OBJECT_TYPE Returns the object type of an object reference. programming.

Used in generic object

Used in a generic object

MACROS FOR DELEGATION

SWE_SET_DELEGATION To delegate. FUNCTION MODULES       

RH_ACT_LEADING_POSITION RH_GET_LEADING_POSITION RH_GET_ACTORS (SUPERIORS) RH_GET_ADDRESS SWX_GET_MANAGER - Gives the Superior(output from FM)of the user (input to FM). RH_GET_STRUCTURE SWD_WFD_REPLICATE_FROM_9999 (When Standard Wf is not there. Execute this Function Module with IM_TASK = Workflow Number)

ORG. ENVIRONMENT RH_WF_OM_INDICES_TIMESTAMP_RFS RH_TASK_INBOX_VIEW_REFRESH RH_TASH_AGENTS_INDEX_REFRESH

Resets the timestamp on all HR buffers Refreshes the buffer for the current user only Refreshed the buffer for a particular task ID only

WORKFLOW CONTAINER ELEMENTS (DEFAULT) _Adhoc Objects _Attach Objects _WF_Initiator

Adhoc Objects of workflow Instance Attachments of workflow instance Initiator of workflow instance 5

_Wf_priority _Wi_group_id _Workitem _Wf_version

Priority of workflow instance Grouping characteristics for workflow instance Workflow Instance Definition version of this workflow instance

EVENT CONTAINER ELEMENTS (DEFAULT) _EVT_OBJECT Object _EVT_OBJTYPE Object Type _EVT_NAME Event of an Object _EVT_OBJKEY Key Element _EVT_RECEVIER_ID _EVT_CREATION_DATE _EVT_CREATION_TIME

EVENT TRIGGERING FUNCTION MODULE SWE_EVENT_CREATE or SAP_WAPI_CREATE_EVENT(External Commit)

(1). The ID of the event, (2). The ID of the triggering object type (3). The object type-specific key  passed as import parameters (4) the event container  a table parameter. Special cases, use: SWE_EVENT_CREATE_IN_UPD_TASK or SWE_EVENT_CREATE_FOR_UPD_TASK SWW_WI_START_SIMPLE this function module is used to trigger workflow without BOR by passing the WF NO directly.

SWEC - Change documents When change documents written

are

Status changes of objects which are logged as change documents are reported automatically as events as well. (W)

BSVW- General Status Mgt. Event creation upon status changes

The system automatically creates an event for objects that use general status management when an object status changes. Table: CDHDR

Message control Event creation as message type SWUY, SE91

Events can be created via a connection to Message Control. For this, you must create a separate output type and declare 9 (workflow event) as transmission medium.

AWUW - Logistics Info. System (LIS) When an exception situation occurs (LIS exception)

The occurrence of an exception situation defined within the LIS as an exception is to cause an event to be created. (W)

SWU_EWBTE Transaction Events

It is not related to Business Object Events. They triggered from Financial Applications, such as G/L accounting and accounts receivable / payable accounting in R/3. and are used to notify other parts of the system of operations being performed in financial accounting, such as a document being created.

Business

6

SWEHR1/2/3 - HR Master Data When HR master data changes

Must carry out the following Personnel Management Customizing activities: IMG under Personnel Management Global Settings in Personnel Management Business Workflow Events.

7

WORKFLOW AFFECTED TABLES TADIR

-

TDEVC TOJTT TOJTB TOJTD T7791

-

Directory of Repository Objects (All WF can be viewed here by giving PgID - R3TR and Obj - PDWS) Development Class Objects Text Basic Data Business Object Repository: Basic Data (Object Definition) Customizing Object Types (Delegation) Assignment to SAP Organizational Object Type

BDCP CDHDR CDPOS SWECDOBJ SWECDVALUE SWWWIAGENTSWDSHEADER SWD_WFCONTSWWBINDEF SWWUSERWI SWWWIAGENTSWFAWRKITM DM40L SWW_OUTBOX SWW_CONT SWW_CONTOB SWWLOGHIST SWWORGTASK SWWUSERWI SWWWIHEAD SWWWIRET SWWWIDEADL SWEINSTCOU SWZAI SWZAIENTRY SWPSTEPLOG

Change Pointer Change Document Header Change Document Items Events for Change Document Field (Values) for Event Linkage Agents for Execution of a Work Item WF. Definition Basic Data (To find WF created Date) WF. Definition Container Obsolete - Workflow Runtime(Save Binding Definitions) Current work items assigned for a user. Agents for Execution of a work Item. WF. Work Item for Reporting (Structure) DM Data Model -Lists Workflows in outbox together with status -Container Contents for Work Item Data Container -Container Cont. for Work Item Data Container (Only Objects) -History of a work item -Assignment of WIs to Org.Units and Tasks -Current Work Items Assigned to a User -Header Table for all Work Item Types (To find WI created Date) Workflow Runtime: Return Values of Method Call Workflow Runtime: Deadline Data for Work Items Instance Linkage Event – Receiver Header Table for all Properties of a Work Queue Object Table for Work Queues (Entries) Workflow: Instance Data of Steps of a Workflow Execution

HRUS_D2 SWDSCONT

User Substituted by User WF Definition (You can delete a Work Flow here but not a good Practice)

REPORTS     

RSWWWIDE – Delete work items (SWWL) RHSOBJCH - fix PD Control Tables RSWUWFML/ RSWUWFML2 - sends an e-mail to an external Internet address to notify the user of new work items. RSWNSENDMAIL1 – Send E-Mail to external Id with Subject and Content RSWELOGD - Delete Event Trace

8

WORKFLOW TRANSACTIONS



AWUV Wizard for event creation Def.tools  Event creation  Set up with wizard MCA1 Workflow Info. System Reporting  Workflow Information System (WIS) OOAW Evaluation paths SWLV View for maintaining Views PFAC Maintain standard roles PFOM Maintain assignment to SAP organizational objects Definition tools  SAP org. objects  Create assignments PFOS Display assignment to SAP organizational objects Definition tools  SAP org. objects  Display assignments PFSO Organizational environment of a user

     

PFT Maintain customer task PFTC General task maintenance PFTC_DEL Tcode to delete Task/Workflow PFTC_INS, PFTC_CHG, PFTC_DIS, PFTC_COP – Task (Std. WF) PFAC_INS, PFAC_CHG, PFAC_DIS, PFAC_DEL – Role Resolution PPOCW – Create Organizational Plan

   

PFTR Standard task for transaction PFTS Standard task PFWF Maintain workflow task (customer) PFWS Maintain workflow template

      

PPOC Create organizational plan Def. tools  Organizational plan  Create PPOCM Create PPOWM Create for Workflow PPOME Change PPOSE Display PPOM Maintain organizational plan Def. tools  Organizational plan  Change PPOS Display organizational plan Def. tools  Organizational plan  Display EXPERT MODE FOR ORGANIZATIONAL UNIT CREATION  PO10 Org. Unit  PO01 Work Centre  PO03 Job  PO13 Position  PFCT Task Catalog  PP01 General Plan Data.  SWF4 Work flow wizard repository  SWDA Alphanumeric Workflow Builder  SWDC Workflow editor administration data  SWDM Business Workflow Explorer Def. tools  Business Workflow Explorer  SWDD Workflow Builder  SWDB WF Builder Create  SWDS WF Builder Selection  SWDD_CONFIG WF Builder Configuration  SWE2 Event type linkage Utilities  Events  Type linkages  SWE3 Type Instance linkages Utilities  Events  Instance linkages  SWE4 Switch event log on/off Utilities  Events  Event/log  On/Off  SWEC Link change documents to events Definition tools  Event creation  Change documents  Linkage  SWED Assignment of change document objects to object types Definition tools   Event creation  Change documents  Define workflow properties  SWEL Display event log Utilities  Events  Event log  Display       

9

               

SWELS Switch Event Trace On/Off SWF3 Workflow Wizard Explorer SWF4 Workflow Wizard Repository SWI1 Selection report for workflows Utilities  Work item selection SWI2 Work item analysis Reporting  Work item analysis SWI2_DURA To find duration of work item. SWI3 Workflow outbox Runtime tools  Workflow outbox SWI4 Task analysis Reporting  Task analysis SWI5 Workload analysis Reporting  Workload analysis SWI6 Object links Runtime tools  Object links SWI7 Workflow resubmission folder From Integrated Inbox or Workflow Outbox SWI8 Error overview Part of administration of workflow runtime system (transaction SWUF) SWL1 Settings for dynamic columns Customizing, part of ongoing settings SWLC Check tasks for agents SWLD Workbench for Workflow 4.0 SWLP Copy plan version

  

SWLV SW01 SW06

Maintain work item views Customizing, part of ongoing settings Business Object Builder Definition tools  Business Object Builder Customizing object types – Delegation / SWE_SET_DELEGATION

                                

SWU0 SWU2 SWU3 SWU4 SWU5 SWU6 SWU7 SWU8 SWU9 SWUD SWUE SWUF SWUI SWUS SWUY SWUP SWUR SWUT SWUU SWUV SWUW SWUX SWUY SWU10 SWUA SWUB SWUC SWUD SWUE SWUG SWUI SWUK SWUL

Event simulation Utilities  Events  Simulate event RFC monitor Utilities  Workflow RFC monitor Customizing consistency check Utilities  Customizing Consistency check for standard tasks Consistency check for customer tasks Consistency check for workflow tasks Consistency check for workflow templates Switch technical trace on/off Display technical trace Diagnostic tools To trigger manually Runtime system administration Administration  Runtime system Start workflows Test Work flow Wizard for message linkage to workflow Switch SAP Forms Trance On / Off Send Mails for workitems Namespace for Form Transactions SAP Forms : Diagnosis Send E-Mail Notifications Number Range Maint. SWW_WIID. SAP Forms Administration Work Flow Message Linkage – Delete Workflow Trace Start verification workflow Maintain WF RFC Destination Customizing Decision Task Workflow Diagnosis Trigger an Event Generate workflow start transaction Start Workflow Mapping from Type E-Mail address Customizing : Process Administration 10



SWUN

                   

SWX1 SWX2 SWX3 SWX4 SWXF

Number Range Maintenance : Form Absenc Create notification of absence Change notification of absence Display notification of absence Approve notification of absence Form applications: out form

SWL1 Dynamic Columns SWPC Continue Workflow After error SWPR Restart After Error SWB_COND Initial Condition SWI2_DIAG Diagnosis of Errors SW12_FREQ – Workitem analysis SWI1_RULE – Execute Agent rules for workflow BSVW – Event creation during status change SCDO – Change document object overview SWXML – Display Web Flow XML Documents SWR_WEBSERVER – Specify ITS Web Server for Web Flow SWUU – SAP Forms Diagnosis SWI30 – Unlock Workflow SWI5 – Workload analysis

11

AGENTS E

Agents are the people who may execute a workflow task • “Possible Agents” are P those users who are authorized to start and execute a task, but may not be the “selected agents” • “Responsible Agents” R are the people you want to execute a specific workitem • “Excluded Agents” are A people you do NOT want to execute the workitem, even though they are a possible or a responsible agent. For example, a person who is responsible for approving travel expenses should probably not be allowed to approve their own travel expenses •

Difference between Database Field Attribute and Virtual Attribute: Virtual Attribute

Database Field Attribute

1. No field content in the database corresponds to this attribute 2. Its value is established by evaluating what may be complex database contents at runtime. 3. It generally applies that multi-line attributes

1.Reference is made to a database field as the source of the required information 2. An attribute whose source is a database field can either return the database field contents or an object reference, which is automatically generated from the field content.

12

APPROVAL PROCEDURE 

Hierarchical Approval



Dynamic Hierarchical Approval



Extended Hierarchical Approval



Parallel Approval



Circular Approval



Dynamic Circular



Parallel Circular



Dynamic Parallel Circular

HIERARCHICAL APPROVAL workflow, the first agent must agree, before the second agent can decide. Since the workflow can be terminated by any agent, it is very important that the hierarchy be respected (lower positions first, higher positions last). EXTENDED HIERARCHICAL APPROVAL workflow is similar to a hierarchical Approval workflow, except that several users are involved at each approval level. Only some of them are authorized to actually approve or reject the object at each level. The other users are only authorized to propose that the object be approved or rejected. DYNAMIC HIERARCHICAL APPROVAL WORKFLOW, the object type to be approved and the approval task are determined at definition time. However, the depth, and the number of approving users are determined dynamically at run time. Once a recipient does not approve the object, the recipients higher in the hierarchy do not receive the object for approval. PARALLEL APPROVAL WORKFLOW implements majority decisions of the form n from m. If the necessary number of n agreements required for an approval or rejection is reached, then the object is considered approved or rejected respectively. CIRCULAR APPROVAL WORKFLOW can be used to send a circular (MS word document etc.) sequentially to several users (or positions, jobs, or organizations) who can view it and make comments if necessary. All the recipients of the circular are defined in the workflow definition. DYNAMIC CIRCULAR WORKFLOW is similar to a circular approval workflow, except that the users who are to view the circular, are defined dynamically at runtime, rather than in the workflow definition. PARALLEL CIRCULAR APPROVAL WORKFLOW is used to send a circular to several users. The recipients of the circular could be either defined in the workflow definition, or dynamically, at runtime. DYNAMIC PARALLEL CIRCULAR APPROVAL WORKFLOW is used to send a circular to multiple users at the same time, for their information and approval. The list of recipients is not defined in the definition of the workflow. The list comes as a dialog box when the workflow is initiated, and the user dynamically selects the recipients.

13

BINDING Binding involves the specification of assignment rules as to how the data is to be exchanged between two containers. At runtime, these binding definitions are executed, making workflow execution possible. The following are the possible binding definitions:

  

Workflow container to Task container. Workflow container to Event container. Workflow container to Rule container.

  

Task container to Workflow container. Task container to Rule container. Task container to Method container.

 

Event container to Workflow container. Event container to Task container.



Method container to Task container.

TYPES OF WORKFLOW CONTAINER o o o o o

Event Container – Always output Workflow Container – import can be given Task Container – o/p Method Container – i/p from workflow container & o/p through Task Container Rule Container – i/p container

RULE BASED PROPOSAL FOR BINDING DEFINITIONS The workflow system automatically makes proposals for the following binding definitions.  Workflow container to task container.  Task container to workflow container  Task container to method container  Method container to task container. WORK ITEM A work item is an object that represents a task or action in the workflow system at runtime. The following are the types of work items: P - Workitem that represents a Remote Work Item N – Notification Items W – Runtime representation of single step tasks that require user interaction. D – Notification of missed deadlines. A – List of objects to be processed once, and together, in a limited time frame. F – Runtime representation of a multi-step task. B – Runtime representation of a multi-step task that runs in the background. E – Runtime representation of a wait step in the workflow definition. C – Is required as a special development in the EDI environment. R – Workitem that represents a Remote Work Item 14

TASKS The following are the types of tasks: Standard task – Client independent task (single-step task(TS)). Customer task – Client dependent Task (single-step task (T)). Workflow task – Multi-step task (WS). Workflow template – As a framework for defining a workflow. Task group (TG) – are defined, to group standard tasks and workflow templates that are logically related. You can also collect other task groups within a task group, hence making hierarchies of task groups. A standard task or workflow template can be used in several task groups.

DIAGNOSIS WORKFLOW - SWUD    

VERIFY WORKFLOW CUSTOMIZING A customizing check is the first in the list simply because incomplete customizing is the most frequent source of problems in an unfamiliar system. PROBLEM : TASK DOES NOT START. When the workflow does not start or cannot be found, then you should call this option to track down why this is happening. PROBLEM : WORKFLOW IS HANGING When the workflow starts but stops before completion either with an error or simply by falling to start the next step in the workflow. TEST ENVIRONMENT When you are developing a workflow and want to access the complete suite of test tools from one place then this is the option for you. You will see a list of all components Sub-Workflows, Tasks, Business Objects, Delegated Business Objects

SECONDARY DIAGNOSIS TRANSACTIONS SWU3 : Verify Workflow Customizing. In this transaction the most important basic customizing for workflow is checked. If you find any errors here. SWEL : Event Log. Note: Before you can use the event log, you must make sure it is activated. You check this in transaction SWELS. If you are not sure whether or not it is active, just deactivate and activate the event log once. SWE2 : Event type linkage A workflow is usually started or triggered by an EVENT so it is important to make sure that an event occurrs. In the event log you can see the event and its business object type. If an event has been successfully created, it is important to check if there is a receiver type for this event. The receiver type is the workflow that has been triggered by the event. The coupling between an event and the receiver can be maintained in trans. SWE2. SWU0 : Event simulation If you have found NO receiver type in the event log, then you should check transaction SWU0, Simulate Events. In this transaction you can simulate an event. The system will check all workflows that could be triggered by the event and tells you whether or not they were triggered. Information is displayed for the workflows that were not triggered successfully. SWI1 : Work item list 15

If a workflow was been correctly triggered and started at least one WORK ITEM should be created. You can view the work items in transaction SWI1, Work Item Selection. The easiest way for the selection is just to go into this transaction after you have checked the event log. By default all the work items of the last hour will be displayed. You will find in this transaction the work item number, the status of the work item and the workflow task that has created the work item. Furthermore, (in the technical workitem display) you can have a look at the container by selecting a work item and using the menu GOTO -> CONTAINER. To display the work item details double click on the item. From the details you can see the selected/ possible/excluded agents for this work item by using the menu GOTO -> AGENT -> SELECTED/POSSIBLE/EXCLUDED AGENTS. When the status of the work item shows an error you should have a look at the workflow log using the menu EDIT -> DISPLAY WORKFLOW LOG. Here you can see errors that have occurred. PFTC/SWDD : Task editor/Workflow Builder If you want to have a look at the definition of the workflow you can use transaction PFTC, Maintain Tasks. The button WORKFLOW BUILDER brings you to a graphical display of the workflow structure, which is fairly easy to read and understand. On the tabstrip TRIGGERING EVENTS you can check if the triggering is activated or not and deactivate/activate it by clicking on the icon in front of the event. OOCU : Customizing overview To check if the relevant tasks are activated and users are assigned, you can use transaction OOCU; Task Customizing Overview. In this transaction all the tasks are sorted by the application components and are thus easy to find. Note that if you have almost no entries in this transaction, you should execute the report RS_APPL_REFRESH in transaction SE38. SWUE/SWUS : Event/workflow trigger If you have activated a user exit, e.g. for the role determination, and you have problems with that, you most probably have to debug the workflow. This can be done using the transaction SWUS or SWUE. With SWUE you can create an event. After you entered object type and event you have to fill the event parameters and the key for a specific object. If you want to debug the workflow you have to set the flag TRIGGER RECIEVER FM SYNCHR. If you have set a break point in your user exit or in any other function module of the workflow the system will stop at this break point and you can start analyzing. The second possibility to debug a workflow is to use the transaction SWUS, the workflow test environment. In this transaction you have to enter the workflow task and fill the input data. Please use the F4-help to fill the input data. Here again you have to set a break point in your user exit or in any other function module of the workflow and then the system will stop there. Summary of the manual alternative to SWUD Now that you have a better understanding of how to use these transactions, you can follow the steps below to quickly analyze your workflow problems: 1. Go to transaction SWU3 and check if everything is okay. If it is not, please fix it before you proceed. 2. Go to transaction SWEL and check if an event is created. If not, check in transaction SWELS if the event log is activated.  If you see an event but no workflow is triggered, proceed with step 3.  If you see an event and a workflow is triggered, but the status of the triggering shows an error, proceed with step 3.  If you see an event and a workflow is triggered and there is no error, proceed with step 4.  If the event log is activated and you do not get any event, open up a message using the component of the application to which the business 16

object type belongs. From release 20C for creation of shopping carts the architecture of workflows changed and no events are visible! 3. Go to transaction SWU0 and simulate the event. Is the workflow that you expect to be triggered visible in the simulation?  If it is not, then check the workflow definition in PFTC. The event must be defined as triggering event.  If it is, but the event linkage is not activated, go to transaction OOCU and activated it.  If it is visible, but it is not activated, go to transaction PFTC and activate it. 4. Go to transaction SWI1. Search for the work item that belongs to the workflow. Check the status of the work item.

17

BUSINESS OBJECTS BUSINESS OBJECT

DESCRIPTION

GENERAL DECISION SOFM SW

TRANSACTION

CHANGE DOCUMENT

For User Decision Office Document (For attachment )

PURCHASE RELATED

BUS2010 BUS2011 BUS2012 BUS2105 LFA1 BUS1001 BUS2013 BUS2014 BUS2081 BUS2081

RFQ VENDOR QUOTATION PURCHASING ORDER PURCHASE REQUISITION VENDOR MASTER MATERIAL MASTER SCHEDULING AGREEMENT PURCHASE CONTRACT INCOMING INVOICE PARKING

SALES RELATED BUS2030 BUS2032 LIKP BUS1065 BUS0012 BUS2094

CUSTOMER INQUIRY SALES ORDER OUTBOUND DELIVERY(SHIP) HR Master data Cost Center CREDIT MEMO

Engg. Change Mgt. ECM

Engg. Change Master

ME41 ME47 ME21 ME51 MK01 MM01 ME31L ME31K MIRO MIR7

EINKBELEG EINKBELEG EINKBELEG BANF KRED MATERIAL EINKBELEG EINKBELEG

VA11 VA01 VL01 PA30 KS12 FB75

VERKBELEG VERKBELEG LIEFERUNG -- NO --KOSTL LIEFERUNG

CC01/CC31

AENNR

MAJOR PURCHASING RELATED BUSINESS OBJECTS         

BUS2009 Request for quotation BUS2011 Vendor quotation BUS2012 Purchase Order BUS2013 Purch.scheduling agreement BUS2013002 Purchase scheduling agreement release BUS2014 Purchase contract BUS2052 Outline purchase agreement BUS2105 Purchase requisition BUS3030 Rebate arrangement: Purchasing

MAJOR SERVICE MANAGEMENT RELATED BUSINESS OBJECTS     

BUS1005 BUS2080 BUS2088 BUS2091 BUS2129

Service Service Service Service Service

notification order entry sheet order confirmation

MASTER DATA   

BUS1006 BUS1178 BUS2300

Business Partner Product Product Catalogue 18

WORKFLOW - FAQS Can we define methods without function module?

Yes, using Macros

What do you mean by role resolution

Finding the responsible agents and assigning task to him

How will Exception?

EXIT_RETURN

u

raise

the

How will u create a method in Workflow?

Basic Organization Plan

1.Using Macro BEGIN_METHOD CHANGING CONTAINER END_METHOD. 2.Create method-using API Organizational Unit – Each unit represent a group of people such as a team, section, department, work area, laboratory. Jobs – Each job describes a functional role within the organization. Positions – each position represent the headcount placement User – Each user is the actual user Id of a person in your organization. Task – Description of an activity in organizational management which is Performed with in the organizational unit Task group - is a hierarchical combination of tasks that are related logically

How does triggering events work?

local

What are the types of data u can create for attribute?

This step enables you to trigger a local event. A local event can, for example, start a local Workflow. You define local events in the version-dependent basic data of the Workflow.  Interfaces  Key fields  Attributes  Methods  Events ABAP dictionary – reference table/reference field Object type – Inverse attribute

What is meant by a Singlestep task?

Its defines an activity that can be executed within a workflow or Independently and no agents are assigned to a single-step task.

What is a workflow template?

Sequence of activity together forms a workflow template

What are the five attributes used in business object?

How does u link workflow and task? What is a required field for an event and workflow binding?

SWE2. Object key.

19

What is the function module for triggering the event?

SWE_EVENT_CREATE, SAP_WAPI_ CREATE_EVENT.

What is the trans. to create the event?

SWUE

What is Async. and synchronous method?

ASYNCHRONOUS METHOD has a terminating events and it is executed by a dialog step. SYNCHRONOUS METHOD may have terminating events and it is Executed by background processing. It should be a background task

What should be the type of task to be a synchronous task? What is workflow versioning?

Modifying a workflow without changing an active version.

What is CHECK function module?

It is a transaction which used to prevent a linkage being triggered when an event occurs

What is meant by event queue?

Events which are in queue are called an event queue. This is achieved by TRFC for starting the receivers not being called immediately Workflow container

Which container operation can be modified? What does a check box “Step not in workflow log” do? What happens when it is checked and when it is not checked? What is the difference b/w regular workflow and release strategy workflow?

If it is checked the graphics will not be displayed in the business Workflow log and if it not checked it will be displayed.

How is the release strategy workflow controlled?

Using transaction ME28.

What are the difference b/w a rule and a role?

Rule (PFAC) assigns agents at Run time based on Organization, Responsibilities and Function Modules.

Multi step task

How do you trigger a workflow

A release strategy workflow is exclusively for purchase order and purchase requisition and other than this other workflows is regular workflow

Role (PFCG) assigns agents at Static Mode and gives the authority check A multi task is a formal framework for a workflow definition. When you create a workflow directly in the in the workflow builder, the multi step task is created by the system. It can be divided in workflow template and workflow tasks. Single Step Tasks:  Standard task (task type TS)  Customer task (task type T) Multi Step Tasks:  Workflow template (task type WS)  Workflow task (task type WF) Task group (task type TG) Manually Calling a Start Transaction Calling a Form Transaction 20

Binding

First Ref : Binding takes place before execution ( WF - > Task ) Sec. Ref : Binding takes place after execution ( Task -> WF )

Work Item

1. READY : Usually applies to work items. The work items has been created and is activated but has not been executed yet. It is sitting in a user’s inbox but they have not opened it yet. 2. SELECTED : Appears in the work item displays as in process. Usually applies to work items. The work item has been opened or reserved by a user but has not yet been executed. 3. COMMITTED: Appears in the work item display as executed. Usually applies to work items. The work item has been executed, but is waiting for the user to mainly confirm the end of processing. Via a set to done option. 4. COMPLETED : The workflow or work item is completed. No further changes can be made once completed. 5. WAITING 6. STARTED 7. ERROR 8. CANCELLED 9. CHECKED 10.EXCPCAUGHT – EXCEPTION CAUGHT 11. EXCPHANDLR – EXCEPTION BEING HANDLED It assumes process control for the duration of its execution and report backs to the calling component after its execution. Background processing Return Parameters, One Result, Exceptions It does not report back directly to the calling component after its execution. Dialog Step No return Parameters, One Result & Exceptions

Synchronous Method

Asynchronous Method

Synchronous Method

Asynchronous Method

It reports back to the calling component

It does not reports back directly to the calling component after its execution

Back ground processing

Dialog step

Return parameters, one result, Exceptions.

Terminating event is necessary

Release strategy

Exclusive for Purchase Order, Purchase Requisition

Possible Errors

1. AGENT DETERMINATION ERROR – Wrong Agent / No Agent was found for a dialog workitem. 2. BUFFERING ERROR – SWU_OBUF – These usually manifest themselves as an inability to access workitems despite the maintenance of the agent determination and security being up to date. 3. WORK ITEM ERROR – These are usually caused by incorrectly modeled workflow or rushed transport. For Ex. The workflow does not take into account incomplete data extracted from legacy systems or exceptions in object methods are not trapped 4. EVENT LINKAGE ERROR – These are usually caused by changes in the application customizing or incorrectly modeled workflow. 21

Condition Based Starting W/F

How will u delete a work item, which is in the inbox? How can I pass parameters from an ABAP program to the workflow container? How to Trigger another workflow from a workflow in process? How can you make event linkage?

The workflow didn’t start at all because the triggering event was not raised or failed to start the workflow (or) then workflow hangs in the middle of the process waiting on a terminating event that never happens.  Check Function Module  Event Creator give condition (avoid WF Triggering)  SWB_COND => Maintain WF start conditions. There assign the values based on the business object and event we used. It’s not available in release prior to Release 4.6C.  Use SWWL transaction  Use RSWWWIDE Standard Report  Use Process Control Step in Workflow template  Use SWUF (Workflow Admin) SWW_WI_START_SIMPLE is the Function Module used for triggering workflow from ABAP. (Try also SWW_WI_CREATE_VIA_EVENT) In an Activity, just call the workflow, as u calls the task…   

SWEC SWE2 SWB_COND

OBJECT TYPES : T7780 US O S AG AC A P C F K KU P TG TR U UG WA WE WF WI T / TS

User Organization Unit Position Role Rule Work Center Applicant Job Location Cost Center Customer Person Task Group Transaction Company User Group Work Area Workflow Event Workflow Task Workitem Task

22

ACTIVITY

ADVANCE WITH IMMEDIATE DIALOG

AFTER METHOD

AGENT

APPROVAL TASK

ASYNCHRONOUS METHOD

ATTACHMENT

ATTRIBUTE

BACKGROUND WORK ITEM

Step type in a workflow definition for executing a task at runtime. The task can be a single-step task (customer task/standard task) or a multistep task (workflow task/workflow template). At runtime, an activity is represented by a work item of one of the following types:  DIALOG WORK ITEM (TYPE W)  BACKGROUND WORK ITEM (TYPE B)  WORKFLOW WORK ITEM (TYPE F) Execution property of the workflow system. A work item for which this indicator is set is executed immediately, if the actual agent of the preceding dialog work item is also a recipient of this work item. This user does not have to call their Business Workplace to execute the work item. Method that is executed after the task's method, synchronously and on the same screen, during execution of a dialog or background work item. The method can be any object method in the Business Object Repository. It does not have to refer to the same object as the task's method. If the work item is executed several times (say, for example, the terminating event has not yet occurred), the after method is also executed several times. Umbrella term for a system user who participates actively in SAP Business Workflow and executes work items. There are various types of agent:  CURRENT AGENT  RECIPIENT  RESPONSIBLE AGENT  EXCLUDED AGENT  POSSIBLE AGENT Single-step task that executes an approval method with a result. The result must be able to assume at least two values, one of which stands for approval and the other for rejection of the object to be processed. For an extended approval, the approval method must be able to assume two more values, one for proposed approval and the other for proposed rejection. Method that does not report back directly to the calling component (in this case the work item manager) after its execution. It does not return any result, any parameters or any exceptions. (Except System Error & Application Error) At least one terminating event must be defined for a single-step task described with an asynchronous object method. An asynchronous method must enter its results itself. Import parameters can be passed to it only. At runtime, the relevant work item is only completed if one of the defined terminating events occurs. Additional information for a work item, which can be entered by the current agent of the work item. Attachments are displayed to the agents of the subsequent steps of a workflow in read-only form. Attachments can be SAPscript editor texts or PC application documents. Object type component: Property or characteristic of an object. The attributes of an object are defined and implemented as part of the object type definition in the Business Object Repository. Value of ABAP Dictionary field  OBJECT REFERENCE  VALUE CALCULATED AT RUNTIME  OBJECT STATUS IN STATUS MANAGEMENT Work item representing a single-step task whose execution does not require any dialog and can therefore be controlled by the system. Work items of type B are not displayed in the Business Workplace, but can be found using the selection report for work items of all types. 23

BEFORE METHOD

BINDING BUSINESS WORKFLOW EXPLORER

CHECK FUNCTION MODULE

COMPOSITION

CONTAINER

CONTAINER DEFINITION

Method that is executed before the task's method, synchronously and on the same screen, during execution of a dialog or background work item. The method can be any object method in the Business Object Repository. It does not have to refer to the same object as the task's method and it cannot create the object. If the work item is executed several times, (say, for example, the terminating event has not yet occurred), the before method is also executed several times. Assignment of values to a container element at runtime. The assignment rules to be observed are first defined in the binding definition. Tool for:  DISPLAYING ALL TASKS ASSIGNED TO A SELECTED SEARCH RANGE  EDITING THESE TASKS  CREATING NEW TASKS The search range can be restricted according to the following criteria:  APPLICATION COMPONENTS  TASK GROUPS  LOCAL TASKS  SAP PHONE TASKS  TASKS LAST PROCESSED  TASKS ASSIGNED TO PARTICULAR TASK GROUPS Function module called SYNCHRONOUSLY IN THE LUW of the event receiver by the event manager directly before the actual receiver function module is called if: An event receiver was established, and The name of a check function module is specified. The check function module has the same interface as the receiver function module. This means that the content of the event container can be checked and the calling of the receiver function module prevented. If the check function module terminates with an exception, the receiver function module is not called and the linkage between the event and the receiver not created. There is a template check function module called SWE_CD_TEMPLATE_CHECK_FB in the function group SWE_TEMPLATE. "Is part of" relationship between object types. The superordinate object type in this relationship is known as the "aggregate type". In the composition, the "part" object type's key is an extended version of the key of the aggregate type, and the object type has a completely different functionality from that of the aggregate type. Example The object type order item "is part of" the object type order. The object type order is then the aggregate type of the object type order item. Basic common data structure of the various definition and execution components of SAP Business Workflow. Containers have container elements for holding the following:  VALUES (CONSTANTS)  STRUCTURES  OBJECT REFERENCES The container elements can be used to control the execution of work items and workflows. General information about the structure of the data to be stored in a container. A container definition specifies the elements included in a container and the properties of those elements (ID, name, data type). A container is always defined when working with one of the definition tools (OBJECT TYPE DEF., ROLE DEF., TASK DEF., AND WORKFLOW DEF.). 24

CONTAINER ELEMENT CONTAINER OPERATION CREATION DATE/TIME CUSTOMER TASK

DATA REFERENCE

TYPE

DATABASE ATTRIBUTE

FIELD

DEADLINE MONITORING

DECISION TASK

DEFAULT ATTRIBUTE

Entry in a container. It is defined by specifying the following:  ID  NAME  DATA TYPE REFERENCE Step type in a workflow definition for performing elementary arithmetic operations or value assignments on individual elements of the workflow container at runtime. Point in time at which a work item was first created with the status ready or waiting. The latter applies if a "requested start" was declared for the work item. A single-step task created by a customer to meet their specific requirements. The following apply to customer tasks:  OBJECT TYPE T IN ORGANIZATIONAL MANAGEMENT  CLIENT-SPECIFIC  VALIDITY PERIOD  PLAN VERSION-SPECIFIC Description of the data type of the value that can be assigned to a variable (for example attribute or container element) at runtime. The data type reference is created during definition and enables the system to perform checks at definition time. A data type reference may be:  VIA FIELD REFERENCE TO AN ABAP DICT. TABLE OR STRUCTURE & FIELD.  VIA STRUCTURE REFERENCE TO AN ABAP DICTIONARY STRUCTURE OR TABLE.  VIA REFERENCE TO AN OBJECT TYPE. When this type of attribute is defined, reference is made to a database field as the source of the required information. An attribute whose source is a database field can either return the database field contents or an object reference, which is automatically generated from the field content. Functions in the workflow runtime system, which monitor start and end deadlines for the processing of selected work items. The monitoring of the requested start ensures that the work item appears in a Business Workplace at a defined point in time, and not before.  MISSED DEADLINE NOTIFICATION Recipients of a missed deadline message are notified with a missed deadline work item in their Business Workplaces.  MODELLED DEADLINE MONITORING The reaction is modelled in the workflow definition. Single-step task with which the workflow system executes a user decision in the workflow. The method "process" of object type "DECISION" is always executed with a decision task. Decision tasks can differ in the following ways:  TEXTUAL CONTENT (TASK DESCRIPTION, NOTIFICATIONS)  ASSIGNMENT OF POSSIBLE AGENTS The decision task TS00008267 (generic decision task) supplied by SAP is used as standard in the user decision. You can specify another decision task when defining the user decision. Attribute or key field of an object, which is entered in the basic data of the object type on the tab page Defaults. The value of the default attribute is displayed when an object is to be described in greater detail. This applies, for example, if a list of objects is displayed. The default attribute of an object can also be used as a sort key in the Business Workplace. Often the default attribute is a key field of the object. If no default attribute is defined for object type, the key fields of the object are displayed. 25

DEFAULT METHOD

DEFAULT ROLE

DELEGATION TYPE (SWO6)

DIALOG ITEM

WORK

DOCUMENT

DOCUMENT TEMPLATE

FROM

END ENTITY TYPE EVALUATION PATH

EVENT

Method of an object type, which is entered in the basic data of the object type on the tab page Defaults. The default method is often a method for displaying the object. The default method can de executed by double-clicking on an entry in a list, for example. Every object type has a default method. The method Display is proposed for new object types. Agent information specified when a single-step task is defined in addition to the assignment of the possible agents. If the single-step task is included as an activity in a workflow definition and responsible agents are defined there, the default role is not evaluated. Object type whose definition is considered at runtime instead of the definition of another object type, although this other object type is specified in all definition components (for example task and workflow definition, linkage tables). In all definition tools you can still refer to the original object type, but the system uses the definition of the delegation type for every access. The delegation type must always be a subtype of the object type it is to replace. The delegation type can have different or additional methods, attributes and events. A delegation type is always defined for an object type on a system-wide and cross-client basis. Type W work item that represents a single-step task at runtime, which requires dialog with the user. Dialog work items are usually displayed in the Business Workplace. When a dialog work item is executed, the object method underlying the singlestep task is called. Dialog work item execution can be deadline-monitored. Collective term for all types of information generated from an application program. The folowing are examples of documents:  SAPSCRIPT TEXT IN RAW FORMAT  MICROSOFT WORD TEXT IN DOC FORMAT  MICROSOFT POWERPOINT PRESENTATION IN PPT FORMAT Step type in a workflow definition for creating documents on the basis of userdefined templates at runtime. The documents can be created with programs that are installed on the local PC and are OLE-compatible, 32-bit, Windows applications (for example Microsoft Word 97). Date/time of end of processing of a work item. The processing of a work item is terminated if it assumes the status logically deleted or the status completed. Each object type can be assigned to an entity type, which further classifies the object type in the company environment. An evaluation path describes a relationship chain that exists in a hierarchical structure between particular objects. For example, the evaluation path ORGEH describes the relationship chain Organizational unit > Position > Person. Evaluation paths are used for the selection of objects in evaluations. After you have specified an evaluation path, the system evaluates the structure along this evaluation path and only takes into account the objects found via the specified evaluation path. Status change of an object which is "published" throughout the system. Examples: "invoice entered", "purchase order released". The list of possible events is defined with the relevant object type in the Business Object Builder. This list can be extended according to customer requirements using the delegation concept. You have to ensure that the events added are actually created. 26

EVENT CONTAINER

EVENT CREATION

EVENT MANAGER

EVENT PARAMETER

EVENT RECEIVER

EXCEPTION

EXCLUDED AGENT

EXPRESSION

Each event carries information from its creation context in its event container. This information is available to the receiver of the event and can be used for event-driven control and communication mechanisms. An event may start, terminate or continue tasks and workflows. Container that contains the event parameters of an event. The event must be defined as an object type component in the Business Object Repository (BOR). Event containers can have bindings with workflow containers or task containers. Program or environment in which an event is created. The creation of an event can be implemented in various ways:  DIRECTLY FROM AN APPLICATION PROGRAM  AFTER A CHANGE THAT IS LOGGED BY A CHANGE DOCUMENT BEING WRITTEN  AFTER A (SYSTEM OR USER) STATUS CHANGE  AS A SEPARATE OUTPUT TYPE WITHIN MESSAGE CONTROL The last three creation mechanisms listed can also be used by customers. This means events can be created flexibly and on a customer-specific basis even where the option has not been provided by SAP in the standard version. An event can only be created if it is defined as a component of an object type in the Business Object Repository. All the programs and tools provided by the workflow system for event handling. This term includes:  THE DEFINITION COMPONENTS (FOR CREATING CREATOR-RECEIVER LINKAGES)  THE RUNTIME COMPONENTS (FOR TRIGGERING AN EVENT INSTANCE, EVALUATING THE EVENT INSTANCE WITH REGARD TO EXISTING LINKAGES, MANAGING THE ASSIGNMENT OF CREATORS TO RECEIVERS, AND FOR THE ACTUAL DATA TRANSFER) Runtime-specific information from the event creation context. Event parameters are defined as elements of the event container and are passed to the event receivers via binding. The following event parameters are automatically contained in the event container:  THE REFERENCE TO THE OBJECT WHOSE CHANGE OF STATE IS DESCRIBED BY THE EVENT.  THE USER NAME OF THE PARTY WHO TRIGGERED THE EVENT CREATION. Application or system program in which an event is evaluated. The event receiver is started by the asynchronous call to a receiver function module, which is entered in the linkage table. The event manager evaluates the linkage table and then calls up the receiver function module. Object type component: Error which may occur during method execution and indicates whether a method was successful. Exception categories:  APPLICATION AND SYSTEM ERROR  TEMPORARY ERROR Temporary errors can occur when system resources are not available. So it might make sense to call the method up again later. You can account for application or system errors in Workflow by defining steps to be carried out when an exception occurs. User who is excluded from processing a work item. Excluded agents can be established at runtime so that information from the workflow execution environment (agents of previous steps for example) or from the context of the processed application objects can be taken into account. Umbrella term for constant, variable and system field. In the context of an expression the following terms have the following 27

FORM TASK

GENERAL TASK

IMPLEMENTATION PROGRAM

INHERITANCE

INSTANCE LINKAGE

INTERFACE

meanings:  CONSTANT Fixed value or fixed object reference  VARIABLE  CONTAINER ELEMENT OR  ATTRIBUTE REFERENCED INDIRECTLY VIA A CONTAINER ELEMENT  SYSTEM FIELD Field from table SYST Expressions are used, for example, to describe the source or destination of data to be transferred in a binding definition. Single-step task executed with the method Process of object type FORM. The various form tasks differ in the following aspects:  TASK CONTAINER  TASK DESCRIPTION  AGENT ASSIGNMENT If a form task is executed as a step within a workflow, the recipients of this step see a work item in their Business Workplaces. If the relevant system settings have been made, a mail is also sent to their Internet addresses. This mail contains the data from the task container as an R3F attachment. Indicator for a single-step task or a multistep task. Tasks with this indicator can be executed or started by any user. The following apply to a work item of this type:  RECIPIENTS ARE ALL USERS, PROVIDING NO RESTRICTION HAS BEEN IMPOSED BY DEFINING RESPONSIBLE AGENTS.  IT CAN BE FORWARDED TO ANY USER BY ITS RECIPIENT. It can be executed by any employee who finds it using work item selection or the workflow log. ABAP program containing the implementation of methods and attributes of the object type. When the attributes, methods and events are defined, the interface of the object type is described, and all essential information about the object type is documented. Every object type requires one program, containing the following:  THE CALL TO THE UNDERLYING ABAP FUNCTION AND THE PROVISION OF PARAMETERS IN THE FORM OF SUBROUTINES FOR EACH METHOD DEFINED.  INDIVIDUAL READ ACCESS FOR EACH ATTRIBUTE. This collection of subroutines is then accessed by the function modules of the runtime environment to call methods and read attribute values. The implementation program is partly created automatically by the system from the definition information. Some post processing is required, however. Relationship between object types allowing common attributes and methods to be passed on automatically from super types to subtypes. With inheritance the subtype usually has the same key fields as its super type but greater functionality. Assignment of a specific receiver instance to a particular combination of EVENT, OBJECT TYPE, AND OBJECT KEY. The instance linkage is entered in the instance linkage table. The The instance linkage table is one of the two linkage tables for the EVENT-RECEIVER LINKAGE (the other table is THE TYPE LINKAGE TABLE). If events are used in SAP Business Workflow (as triggering and terminating events, in wait steps), the entries required in the linkage tables are made by the workflow system. Collection of attribute, method and event definitions for an object type, which are used in a common context. 28

INTERFACE TYPE

KEY FIELD

LATEST END LATEST END LATEST START LINKAGE TABLE

LOOP MESSAGE RECIPIENT COMPLETION

FOR

MESSAGE RECIPIENT FOR MISSED DEADLINE METHOD

Object types can support interfaces. This option ensures that the attributes, methods and events in the interface are implemented correctly in the object type. Interfaces are defined in the Business Object Builder. No practical standard implementation can be specified for abstract interfaces. With object types that support abstract interfaces, the inherited attributes and methods must be redefined and implemented. Combination of ATTRIBUTE, METHOD, AND EVENT DEFINITIONS which are used in a common context. An object type can support one or more interface types. The attributes, methods, and events already defined in the interface types are therefore available to the object type with their interfaces and are also inherited by the respective sub-types. If interface types are used, names and interfaces can be standardized and the definition of attributes, methods, and events simplified in the object type definition. Object type component: Field for UNIQUE IDENTIFICATION OF AN OBJECT. A key field is defined for an object type in the Business Object Builder. The identifying key of an object is made up of all the key fields of the object type. Latest point in time for the processing of a work item to end. The processing of a work item ends when it assumes either the status logically deleted or the status completed. Deadline by which the processing of a work item MUST BE TERMINATED. Deadline by which one of the recipients of a work item MUST HAVE STARTED to process it. Table containing the assignment of events to the event receivers interested in the event. A distinction needs to be made between type linkage and instance linkage which are contained in separate tables. If events are used in SAP Business Workflow (as triggering or terminating events, in wait steps), the entries required in the linkage tables are made by the workflow system. Repeated processing of steps within the workflow definition. UNTIL and WHILE are available as loop types. User who is informed when a work item or workflow has been fully processed and its status set to completed . The notification takes place in the form of an e-mail in the recipient's Business Workplace. The notification text is stored as a completion text with the task represented by the completed work item. This basis text can be updated with values from the runtime environment of the work item (attributes of application objects involved). User who is notified if the workflow runtime system discovers a missed deadline. The notification takes place in the form of a missed deadline work item in the recipient's Business Workplace. When this work item is executed, information about the monitored deadline is displayed. Object type component: Operation that can be executed on an object. The methods of an object type are specified and implemented in the Business Object Builder. Methods usually refer to existing ABAP functions, such as FUNCTION MODULES, TRANSACTIONS AND DIALOG MODULES. They are called using a standard interface, which is determined basically by the method ID and the method parameters. The actual implementation of a method is not externally apparent. 29

METHOD PARAMETER

MISSED DEADLINE WORK ITEM

MULTIPLE CONDITION

MULTISTEP TASK

NODE NOTIFICATION COMPLETION

OF

OBJECT

OBJECT MANAGER

You can specify the following for each method:  IMPORT PARAMETERS (FOR SYNCHRONOUS AND ASYNCHRONOUS METHODS)  A RESULT (ONLY SYNCHRONOUS METHODS)  EXPORT PARAMETERS (ONLY SYNCHRONOUS METHODS)  EXCEPTIONS (ONLY SYNCHRONOUS METHODS) Method parameters are used to exchange information between the caller of a method and the method. They can be defined for each method as part of the object type definition. Parameters of a method are values which are either passed to the method (import parameters) or are returned from the method (export parameters) at runtime. The interface of the method call is hence determined with the definition of the parameters. A method will rarely, however, have more than one return value which is returned specifically as its result. Parameters are therefore generally only used as import parameters of the method. Work item for notifying the message recipients for missed deadline if the runtime system discovers a missed deadline for a work item. The notification takes place in the form of a type D work item in the Business Workplaces of the relevant recipients. The recipients are specified when the step is defined. The notification text is entered when the task to be monitored is defined. When a missed deadline work item is executed, the most important information about the monitored work item is displayed. Step type in a workflow definition to process one of more defined branches of the workflow definition at runtime. This is based on information from the context of the workflow or the objects processed. The value of the basis of comparison (expression from workflow container) is checked against the comparison values defined. Task containing a workflow definition. It describes the formal "framework" (interface, triggering events) for a workflow definition. Multi-step tasks can be split into workflow templates and workflow tasks. WORKFLOW TEMPLATE WORKFLOW TASK ORG. OBJECT TYPE WS ORG. OBJECT TYPE WF CROSS-CLIENT CLIENT-SPECIFIC ANY PLAN VERSION PLAN VERSION-SPECIFIC NO VALIDITY PERIOD VALIDITY PERIOD Superordinate term for steps, outcomes, triggering events and operators in a workflow definition. Notification of the recipient of the completion message. The notification of completion is sent as a mail document and displayed in the Business Workplace of the relevant recipient. Notifications of completion are sent if the following apply:  THE WORK ITEM IS SUCCESSFULLY TERMINATED (STATUS Completed)  AN APPROPRIATE RECIPIENT IS ENTERED IN THE DEFINITION The notification of completion contains the notification text defined for the task, and a reference to the workflow log or work item display. Any type of related information which can be accessed uniquely under an identifying key. Most of this information is generally stored in an ABAP Dictionary table. Objects are created at runtime and are the specific instances of a previously defined object type which have been assigned values. The tools provided for object handling and object type handling are referred to as a whole as the object manager. 30

OBJECT REFERENCE

OBJECT STATUS ATTRIBUTE OBJECT TYPE

OBJECT COMPONENT

TYPE

Reference to the data of an object in the Business Object Repository. Object data is made available at runtime in an internal table. The object reference contains a reference to this internal table. Attribute whose value is an object status (CO status management). Description of data (objects) in the system created at definition time in the Business Object Builder. Examples:  DOCUMENTS (INVOICES, PURCHASE REQUISITIONS, JOB APPLICATIONS, AND SO ON)  MASTER DATA (CUSTOMER, MATERIAL, VENDOR, AND SO ON)  TRANSACTION DATA (ORDER, QUOTATION, AND SO ON) Object types are described and implemented by specifying the following components:  BASIC DATA  KEY FIELDS  ATTRIBUTES  METHODS WITH PARAMETERS, RESULT AND EXCEPTIONS  EVENTS WITH PARAMETERS  IMPLEMENTATION PROGRAM The Business Object Repository provides a full directory of all object types. The object type must be defined before its data (objects) can be used in the system. You define and implement object types by specifying their components in the Business Object Builder. An object type is made up of the following components:  BASIC DATA  KEY FIELDS  ATTRIBUTES (= OBJECT PROPERTIES)  METHODS (= OPERATIONS ON OBJECTS) WITH PARAMETERS, RESULTS AND EXCEPTIONS

ORGANIZATIONAL MANAGEMENT OBJECT

POSSIBLE AGENT

 EVENTS WITH PARAMETERS  IMPLEMENTATION IN PROGRAM Certain Organizational Management objects are important for the integration of SAP Business Workflow and PD Organizational Management. The objects are identified using a 2-character identifier for their object type and an 8-digit number or 12-character name. The follow object types are used for the organizational plan and for the specification of agents and responsibilities:  O - ORGANIZATIONAL UNIT  C – JOB  S – POSITION  US – USER  P - EMPLOYEE  A - WORK CENTER  AC - ROLE Tasks are identified as follows:  STANDARD TASKS (TS), CUSTOMER TASKS (T )  WORKFLOW TEMPLATES (WS), WORKFLOW TASKS (WF) The Organizational Management objects also have an abbreviation (which is not necessarily unique) and a descriptive name. User who is organizationally authorized to start a task and execute the associated work item. The possible agents are not usually expressed with a full list of all user names, but with organizational units, positions and jobs. The possible agents of a task 31

PROCESS CONTROL

PROCESS TIME RECEIVER FUNCTION MODULE

RECEIVER INSTANCE

RECEIVER TYPE

RECEIVER TYPE FUNCTION MODULE

REQUESTED END REQUESTED START

are specified in the task definition. Without possible agents a task cannot be executed or started in dialog. Step type in a workflow definition for performing the following operations at runtime:  CANCEL WORK ITEMS OF THE CURRENT WORKFLOW  SET WORK ITEMS OF THE CURRENT WORKFLOW TO OBSOLETE  TERMINATE THE WORKFLOW  CANCEL THE WORKFLOW Time during which a work item is being processed. The calculation of the process time depends on the type of the work item. SWW_WI_CREATE_VIA_EVENT is the Receiver function module, which is responsible for triggering the workflows (for all Workflows in SWE2). This will be assigned automatically when the linkage (SWE2) is created. This function module is common for all.  TEMPLATE RECEIVER FUNCTION MODULE SWE_CD_TEMPLATE_REC_FB IS AVAILABLE IN THE FUNCTION GROUP SWE_TEMPLATE. The interface of this function module is standard and predefined. The receiver function module expects the ID of the event, the event container and the name of the receiver type as input parameters. Return parameters are not passed by the receiver function module. The receiver function module is called with the above parameters if the event entered in the type linkage table occurs and the check function module (if any) terminates without an exception. The receiver function module must be marked as RFC-enabled. Instance that is continued or terminated when an event occurs for an object. The receiver instance is entered in the instance linkage table at runtime by the potential event receiver. When the event manager sets up the instance linkage, it writes the receiver instance into the event container and passes it to the receiver function module declared in the instance linkage table for further processing. In a workflow, wait steps and activities that reference a single-step task with a terminating event create an entry in the instance linkage table. The number of the work item of the wait step or activity is used as the receiver instance. The system makes the entry. OPTIONAL INPUT PARAMETER for the receiver function module. The receiver type is stored in the type linkage table and is entered by the system. The entry is made at definition time if triggering events are defined for tasks. The entry is made at runtime if a wait step or activity that references a single-step task with a terminating event is executed.  WITH TRIGGERING EVENTS OF TASKS, THE RECEIVER TYPE IS THE ID OF THE TASK TO BE STARTED.  WITH WAIT STEPS OR TERMINATING EVENTS OF SINGLE-STEP TASKS, THE RECEIVER TYPE IS "EVENTITEM" OR "WORKITEM". Function module for DYNAMIC DETERMINATION of the receiver type. The receiver type function module is called before the receiver function module is called, provided it is entered in the type linkage table. The event container is evaluated in the receiver type function module, and a receiver type determined from the information contained. Usually no receiver type function module is required. If you think you need your own receiver type function module, the template function module SWE_CD_TEMPLATE_RECTYPE_FB is available in the function group SWE_TEMPLATE. Deadline by which the processing of a work item SHOULD be terminated. EARLIEST POINT IN TIME AT WHICH THE WORK ITEM CAN BE EXECUTED. 32

RESPONSIBLE AGENT RESULT

ROLE

ROLE DEFINITION

ROLE RESOLUTION

SAP BUSINESS WORKFLOW

SAPFORMS SECONDARY METHOD

A dialog work item appears in the Business Workplaces of its recipients when the requested start is reached if the work item is already available for processing. If the dialog work item is not created until after the requested start, it appears immediately in the Business Workplaces of its recipients. With background work items, execution starts when the requested start is reached at the earliest. User assigned locally to a step in the workflow definition. The system establishes the recipient(s) of a work item from the intersection of responsible and possible agents. A specific parameter of a synchronous method for returning the essential result of this method. The possible values of this result can be defined in a fixed value domain or a check table so that they are known in the workflow definition and can be taken into account. A method can only ever have one result, but it can have any number of return parameters as well. A method does not necessarily have to have a result. Method of establishing a user at runtime. This user can be used as a responsible agent or a recipient of certain notifications. A role can be defined in the following ways:  RESPONSIBILITIES  ORGANIZATIONAL DATA  USER-PROGRAMMED FUNCTION TO BE EXECUTED Roles are assigned in the step definition. Example:  ROLE: "SUPERIOR OF "  ROLE: "MRP CONTROLLER FOR "  ROLE: "EMPLOYEE RESPONSIBLE FOR FROM " Description of a role. The definition includes the rule for how and according to which information (objects, application data) the role resolution can be carried out. Determination of the agents combined in a role. Role resolution takes place at runtime depending on the information from the current process. The result of role resolution is a list of agents who are responsible for the actual processing of the task. SAP Business Workflow comprises technologies and tools for the automatic control and execution of cross-application processes. This primarily involves coordinating  THE PERSONS INVOLVED  THE WORK STEPS REQUIRED  THE DATA THAT NEEDS TO BE PROCESSED (BUSINESS OBJECTS) The main aims of SAP Business Workflow are to reduce throughput times and the costs involved in managing business processes, and to increase transparency and quality. R/3 System interface for the integration of electronic forms. These forms can be used, for example, to execute a work item or start a workflow offline. Method that is executed in addition to the main method in the execution of a dialog or background work item. A secondary method is connected to the leading method of the step, and is generally used to display additional information. The secondary method can be any object method defined in the Business Object Repository. 33

STANDARD TASK

START STEP

STEP DEFINITION STEP NAME SUBSTITUTE PROFILE

SUBTYPE SUBWORKFLOW

SUPERTYPE

SYNCHRONOUS METHOD

If the work item is executed several times, (say, for example, the terminating event has not yet occurred), the secondary method is also executed several times. Single-step task for use in workflow definitions. You can execute methods of business object types in standard tasks. The following apply to standard tasks:  OBJECT TYPE TS IN ORGANIZATIONAL MANAGEMENT  CROSS-CLIENT  UNRESTRICTED VALIDITY PERIOD  ANY PLAN VERSION Point in time at which the processing of a work item starts. The processing of a work item starts when the work item first assumes the status reserved or in process. Elementary module of a workflow definition. The following types of step exist:  ACTIVITY (= TASK REFERENCE)  CONDITION, MULTIPLE CONDITION  EVENT CREATOR, WAIT STEP  CONTAINER OPERATION  USER DECISION  DOCUMENT GENERATION  LOOP  FORK  UNDEFINED STEP The individual steps are arranged and processed sequentially. Only steps in forks can be executed simultaneously. Steps within a workflow definition can only be changed or inserted according to certain rules, taking into account block orientation. Part of a workflow definition. The step definition contains all the data relevant to the step. The scope depends on the step type defined. Name to label a step in the workflow definition. Collection of a substitute's "rights". A substitute profile is assigned to a substitute when the substitution is set up. A substitute profile includes a number of task classes. Task classes are assigned to single-step tasks during definition. Substitute profiles are defined and task classes combined to form a substitute profile in Customizing. Copy of an object type, which has inherited all the attributes, events and methods. The subtype can be modified and extended. Subtypes are used to edit or extend object types supplied by SAP. Workflow template or workflow task used in an activity in a workflow definition. At runtime the workflow referenced in the activity is executed when the step is executed. Object type from which another object type (subtype) has inherited all object type components. Changes to the object type components of the supertype only affect the object type components of the subtype if the components have not been redefined for the subtype. Method that assumes process control for the duration of its execution and reports back to the calling component (in this case the work item manager) after its execution. Terminating events can be defined for a single-step task described with a synchronous object method. At runtime, the relevant work item is completed either when the method has been processed or when one of the events occurs. A synchronous method can return the following data to the workflow: 34

TABLE ELEMENT

TASK

TASK CONTAINER

TASK GROUP

TERMINATING EVENT

TOTAL TIME TRIGGERING EVENT

TYPE LINKAGE

 RETURN PARAMETERS  ONE RESULT  EXCEPTIONS Multiline element in the workflow container, which can contain a list of values. A table element can be specified in the activity definition. The activity is executed in parallel processing branches as many times as there are values in the table. Goal-oriented business activity description. The following tasks exist in the workflow context:  SINGLE-STEP TASK (CUSTOMER TASK/STANDARD TASK) Activity in which an object method is executed on a specific object.  MULTISTEP TASK (WORKFLOW TASK/WORKFLOW TEMPLATE) Activity whose description includes reference to a workflow definition. Container of a task for storing data from the task environment. The task container contains the control information in the form of constants and object references:  INFORMATION ON EXECUTION OF THE OBJECT METHOD (OBJECT REFERENCE TO THE OBJECT TO BE PROCESSED, CURRENT AGENT OF WORK ITEM, AND SO ON)  INFORMATION AVAILABLE AFTER PROCESSING THE METHOD The task container already contains some defined workflow system variables. You can define other container elements in the task container, which are of interest, for example, for variable replacement in connection with the notifications. Collection of standard tasks, workflow templates and other task groups, which are used in a common context. You can set up hierarchies of task groups by inserting task groups into other task groups. Task groups can be cross-application. They can include tasks from within one application component as well as tasks from different application components. Event whose occurrence terminates a single-step task. If the indicator confirm end of processing is set for the single-step task, the end of processing must be confirmed by a recipient even after the event has occurred. The event is entered as a terminating event of the single-step task. A singlestep task can have several terminating events. Single-step tasks that refer to an asynchronous method must have at least one terminating event. Single-step tasks that refer to a synchronous method can have terminating events. Single-step tasks with terminating events can be terminated as follows:  BY THE EVENT OCCURRING  BY AN AGENT EXECUTING THE WORK ITEM AND (POSSIBLY) SETTING IT TO 'DONE' (ONLY FOR SINGLE-STEP TASKS THAT USE SYNCHRONOUS OBJECT TYPE METHODS) Sum of process time and wait time. Event whose occurrence starts a task or a workflow. The event must be entered as a triggering event for the task to be started, and the event linkage must be activated. A task or workflow can have several triggering events. Information from the event creation context can be passed in the binding from the event container to the task or workflow container. The event must be defined as an object type component in the Business Object Builder. Assignment of one or several receiver function modules and receiver types to an event. To establish the type linkage, the event manager evaluates the type linkage 35

UNTIL LOOP

USER DECISION

VIRTUAL ATTRIBUTE

WAIT STEP

WAIT STEP WORK ITEM WAIT TIME WHILE LOOP

WORK ITEM WORK CONTAINER WORK DISPLAY

ITEM

WORK MANAGER

ITEM

ITEM

table. The event receiver with the receiver function module and receiver type are defined in this table. The event is specified by the object type and event name. In addition to the instance linkage table, the type linkage table is one of the two event receiver linkage tables managed in the system. If events are used in SAP Business Workflow (as triggering and terminating events, for wait steps), the entries required in the linkage table are made by the workflow system. Step type in a workflow definition for processing a sequence of steps repeatedly at runtime until the termination condition defined in the loop command occurs. The system makes the decision about terminating the loop on the basis of a termination condition created in the condition editor, in conjunction with values contained in the workflow container. The first check takes place when the loop has been processed once. Step type in a workflow definition to take a branch at runtime based on a decision made by the current user during the current workflow. At runtime the user decision is represented by a dialog work item (type W work item). Attribute for which a read procedure always has to be implemented, since no field content in the database corresponds to this attribute. Its value is established by evaluating what may be complex database contents at runtime. It generally applies that multiline attributes and attributes that reference a object with several key fields are to be implemented as virtual attributes. A virtual attribute can return the value of an ABAP Dictionary field or an object reference. Step type in a workflow definition for waiting for an event at runtime. Processing in this workflow branch is continued after the expected event has occurred. At runtime a wait step is represented by a type E work item. Type E work item representing a wait step in a workflow at runtime, which waits for a published event to occur. Time during which a work item exists but is not yet being processed. The calculation of the wait time depends on the type of the work item. Step type in a workflow definition for processing a sequence of steps repeatedly at runtime as long as the comparisons defined in the step definition apply. To make the decision, the workflow system checks the value of a basis of comparison (= expression from the workflow container) against the defined comparison values. The first check is made before the loop is processed. Runtime representation of a task or a step in the workflow definition. There are various types of work item. Runtime representation of the task container of a single-step task. All information and activities are displayed, which are relevant in the environment of the work item in question. Very little technical information is displayed. As an alternative to the standard view of the work item display, which supports the agent in the processing of the current work item, you can use the technical view of the work item display. You can change the status or the deadline data of the work item in the technical view. Active unit which provides methods for the work items. The work item manager has the following functions: 36

 THE WORK ITEM MANAGER CAN INITIATE CALLING OF BACKGROUND PROCESSES. THIS IS NECESSARY BECAUSE ACTIVITIES IN THE WORKFLOW DEFINITION CAN REFER TO OBJECT METHODS WHICH RUN IN THE BACKGROUND.  THE WORK ITEM MANAGER IS RESPONSIBLE FOR DEADLINE MONITORING AND INITIATING APPROPRIATE MEASURES (ESCALATION).  THE WORK ITEM MANAGER MAKES AVAILABLE THE EVENT INTERFACE. IT ACTS AS THE RECEIVER OF EVENTS FOR TASKS WHICH ARE TERMINATED BY AN EVENT AND

WORK ITEM TEXT

WORK ITEM TYPE

WORK QUEUE

WORK QUEUE WORK ITEM WORKFLOW

WORKFLOW CONTAINER

FOR WAIT STEPS. Text that appears in the Business Workplace to describe the work item. The work item text is defined with the single-step task. The work item text can include up to four expressions that refer to the task container. A text is then displayed at execution time, which incorportaes the current values of the container elements. There are various types of work item. The work item type determines the internal processing. The type also determines which statuses and status transitions are allowed. Certain work items are displayed to a user in their Business Workplace, depending on the type. Other work items are only used and processed internally within the system. Work items of the following types are displayed in the Business Workplace:  DIALOG WORK ITEM (TYPE W) Runtime representation of single-step tasks requiring user dialog.  MISSED DEADLINE WORK ITEM (TYPE D) Work item for notification upon missed deadline.  WORK QUEUE WORK ITEM (TYPE A) Runtime representation of a work queue. There are other work item types that can only be seen using the selection report for displaying work items. List of objects that are to be processed once and together within a specified period. The work queue provides a "framework" for the individual entries to be processed and manages the list of objects to be processed, including their statuses and the tasks to be executed on them. The status of the work queue work item (type A) indicates the processing status of the work queue overall. Work item of type A, which represents a work queue at runtime. Work items of type A are displayed in the Business Workplace. The processing status of the work queue overall can be derived from the status of the work item. Execution of a multistep task at runtime. A workflow consists of a sequence of steps, which are processed either by people or automatically by the system. The chronological and logical sequence of the steps, linked to the evaluation of conditions, is monitored by the workflow manager and can be controlled flexibly with event-related response mechanisms. From a technical point of view, a workflow is represented by a workflow work item (type F). The workflow container contains workflow-specific system variables and other container elements to be defined explicitly. The container elements for which the import or export indicator is set form the data interface of the workflow. This interface applies to all versions of the workflow definition. Container elements for which no import or export indicators are set are local container elements in the workflow definition. They are subject to versioning and are only valid in the versions of the workflow defintion in which they were

37

WORKFLOW LOG

WORKFLOW OUTBOX

WORKFLOW RESUBMISSIONS WORKFLOW SYSTEM ADMINISTRATOR

WORKFLOW TASK

TEMPLATE WORKFLOW

defined. They can be used as indicators or internal counters amongst other things. Log for a workflow, which contains all the workflow steps whose processing has been at least started so far. You can double-click in a workflow log to display work items (and change them if you have the appropriate authorization). Any errors during a workflow are displayed in the workflow log and can be analyzed with the help of the error messages displayed. You can go to the following, amongst other things, from the workflow log:  ATTACHMENTS  AD HOC OBJECTS  PROCESSED WORK ITEMS  SUBWORKFLOWS  AGENTS INVOLVED User-specific list of work items for the tasks that were:  STARTED BY THE USER IN DIALOG  TRIGGERED BY AN EVENT CONTAINING THE NAME OF THE USER IN THE CONTAINER ELEMENT _EVT_OBJECT IN ITS EVENT CONTAINER The workflow outbox is part of the Business Workplace. User-specific list of work items "resubmitted" by this user. The work items are displayed with their resubmission dates. Person responsible for the workflow definition from a technical point of view. The workflow system administrator can be set globally in the administration data of the Workflow Builder, or individually for each workflow definition in its basic data. The maintenance of the global workflow system administrator is part of Workflow Customizing. A workflow system administrator is assigned to each workflow at runtime. The entry in the basic data is evaluated for this. Only if this is blank is the entry in the administration data evaluated. The system administrator of a subworkflow is derived automatically from the data of the superordinate workflow. This also applies if another system administrator is maintained in the basic data of the subworkflow. Neither changes to the basic data or the Customizing settings nor organizational reassignments have any effect on workflows that have already been started. The workflow system administrator should be able to repair errors in workflows. If a workflow that has been started assumes the error status, the workflow system administrator receives a mail in their Business Workplace inbox. The workflow log can be used to perform analyses and remove errors. If a workflow fails to start, only the workflow system administrator entered in the Workflow Builder is notified. Information about the workflow system administrator is available as an attribute in the workflow container element _Workitem. Multistep task created by a customer to meet their specific requirements. These tasks contain a workflow definition. The following apply to workflow tasks:  ORGANIZATIONAL OBJECT TYPE WF  CLIENT-SPECIFIC  VALIDITY PERIOD  PLAN VERSION-SPECIFIC Multistep task with the following properties:  ORGANIZATIONAL OBJECT TYPE WS  CROSS-CLIENT  UNRESTRICTED VALIDITY PERIOD 38

WORKFLOW ITEM

WORKLIST

WORK

 ANY PLAN VERSION Executable workflows are supplied by SAP as workflow templates. You can:  USE THEM AS MODELS FOR DEFINING YOUR OWN WORKFLOW TEMPLATES  CONFIGURE THEM MAKING YOUR OWN AGENT AND DEADLINE ENTRIES Type F work item that represents a multistep task at runtime. There is one workflow work item for every multistep task started. The workflow log and workflow container of this workflow work item can be accessed:  FOR ERROR DIAGNOSIS AND CORRECTION  IF NO WORK ITEMS ARE DISPLAYED FOR INFORMATION ABOUT STEPS ALREADY PROCESSED (INCLUDING THEIR CURRENT AGENTS, NOTES AND AD HOC OBJECTS)  FOR REPORTING PROCESSES COMPLETED Workflow work items are not displayed in the Business Workplace, but can be found using the work item selection. If a workflow task or workflow template is referenced as an activity within a workflow definition, this step is also represented with a workflow work item. List of all work items that are assigned to a specific user at a particular time. This user is one of the recipients of each work item. The worklist is located in the workflow inbox in the Business Workplace.

39

QUESTIONS AND ANSWERS What is the WORKFLOW     

table for USER MASTER, WORKFLOW LOG, WORKFLOW CONTAINER, DEFINITION and AGENT OF WORKFLOW? USER-MASTER USR01 WORKFLOW LOG SWWLOGHIST WORKFLOW CONTAINER – SWD_WFCONT WORKLOW DEFINITION SWDSHEADER AGENT OF WORKFLOW SWWWIAGENT

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. 40

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? 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. 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.

41

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 Is it possible to execute a work item automatically (lying in inbox)... automatically when deadline is missed...If so how will you perform it? When deadline is missed, u can trigger another work item. Give time constrain to Latest Start and it branches one more outcome (with a clock symbol) in WF template. Here create an activity and assign the same task to this activity and do it as a background process. A work item is in a users inbox. If the user wants to do a particular process manually without executing the work item what will happen to the work item? The WI stays in the inbox. For killing the WI, u can use Process Control Step. (try fork) How will u delete a work item, which is in the inbox? Use SWWL transaction Use RSWWWIDE Standard Report Use Process Control Step in Workflow template Use SWUF (Workflow Admin) What is Check Function Module and where it is used? Check Function Module, if used, is responsible for triggering a workflow under som conditions. It will check the condition before triggering the workflow and if the condition is not satisfied it terminates the flow. Developer has to create this function module (if not provided by SAP). This is given in SWE2. (Select the linkage and see details) What is Receiver Function Module and where it is used? SWW_WI_CREATE_VIA_EVENT is the Receiver function module, which is responsible for triggering the workflows (for all Workflows in SWE2). This will be assigned automatically when the linkage (SWE2) is created. This function module is common for all. How can I pass parameters from an ABAP program to the workflow container? SWW_WI_START_SIMPLE is the Function Module used for triggering workflow from ABAP. (Try also SWW_WI_CREATE_VIA_EVENT) How to Trigger another workflow from a workflow in process? Explain the process and steps involved in it? In an Activity, just call the workflow, as u calls the task…

42

Workflow is in process. Upon creation of an event, the workflow should end. How to design this process? Can use Process Control Activity with the necessary logic. Depending upon various field values, workflow should be triggered? How to do it? Field Restriction in SWEC List some standard FM used for Role Resolution and explain where it is used and how parameters are passed? SWX_GET_MANAGER – Gives the Superior (output from function module) of the user (input to function module).

What are the macros used by you in the workflow development? DATA: TYPE SWC_OBJECT. SWC_CREATE_OBJECT . SWC_REFRESH_OBJECT . SWC_GET_OBJECT_TYPE . SWC_GET_OBJECT_KEY . SWC_CALL_METHOD . SWC_CONTAINER . SWC_CREATE_CONTAINER . SWC_GET_PROPERTY . SWC_GET_TABLE_PROPERTY . EXIT_RETURN . Have you used the Role Resolution? How did you do that? There are various ways of defining roles. You can use the following: 

Function modules You use a function module to define standard roles if the agent for a task must be found according to extremely complex selection criteria. If you define roles using function modules, the system finds agents by executing the function. How data is obtained varies from function to function. You can use predefined functions, or create your own functions.



Organizational data You use organizational data to define standard roles if your business processes are managed on the basis of your organization model. If you define roles using organizational data, role resolution traces the possible agents for a task by using the relationships between the task, the objects in Organizational Management, and the SAP organizational objects.



Responsibilities You use responsibilities to define standard roles if you need more precise selection criteria to find agents, but do not want to use function modules. You can also use the organization model to find possible agents using jobs, positions, etc.

Explain the workflows developed by you. Explain from starting point to end point of workflow development (Technical point of view). 43

       

Design Process Which responsibilities do you have for the scenario? Design the Multistep task How must the single-step tasks be defined? How must the object type be defined? Which functionality should the method involve? On the single step level you define the greatest possible set of agents. On the Multistep level you define the responsible agents.

What is the Workflow basic Customizing? Before you can use the Workflow module, you must first execute the basic Customizing in transaction SWU3. All of the listed points should be green (the number range for customer tasks is no longer required). A detailed description of the activities is provided in the relevant information buttons. You can also execute some (but not all) of the points using the Automatic Customizing button. See the online documentation for an exact description of what happens there. The RFC destination must work correctly and the user (usually WF BATCH) should have the SAP_ALL profile. What options do I have as a user to configure the inbox individually? You have the following options: 

You can create separate user-dependent or user-independent layouts so that you can adapt the displayed columns individually. You can access the function in the Workplace via an application function key.



You can set filters to set certain criteria for individual columns or several columns simultaneously, according to which specific work items are then filtered.



You can add dynamic columns in the layout that then display dynamic elements for certain tasks and users from the work item container. However, this is only possible if all tasks in the inbox belong to just one task. If they have several tasks in the inbox, filtering serves no useful purpose because all tasks are first completely read once. You can define these dynamic columns using transaction SWL1.

What does the substitute rule system look like in the workflow? You have a choice of two different substitute rulings: 

Active substitute ruling (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).



Passive substitution (for example, for absence due to illness): the substitute must explicitly assume the substitution and can only view the items of the absent person in this mode.

How can users be automatically notified that new work items are available for processing? Answer: Unfortunately, the dialog box that informs users of new work items which appears in SAPoffice is not available within SAP Systems. However, the following two options are provided: 44



In the Workflow Builder, you can designate the item as an express item via additional data. The user then receives a corresponding express dialog box.



The RSWUWFML report is a more flexible option. This report sends an e-mail to an external Internet address to notify the user of new work items.

Can I set deadlines for the latest processing of work

items?

This is where you can use deadline monitoring for work items. In the Workflow Builder, you can set dates for a requested/latest start/end date for each individual step. You must schedule the SWWDHEX job via transaction SWU3 for this. Schedule the job permanently in the production system otherwise it is difficult for the job to schedule individual deadline monitoring scenarios when workflow is heavy. Can I also execute work items with external programs such as Outlook? You can use the Web GUI for HTML instead of the Windows GUI. However, note that some functions do no work in the WEB GUI, due to technical restrictions in the browser. SAP also provides interfaces which allow you to process work items with external programs such as Lotus Notes or Microsoft Outlook. How do you trace the workflow? Symptoms worth investigating with the workflow trace : An event fails to trigger a workflow Inconsistent data in the workflow A workflow step does not execute Starting points for Investigation Is the binding performed correctly? Is the target container being filled as you expected? Are warnings recorded when the condition is evaluated?

RESOLVING WORKFLOW INSTANCE ERRORS Wrong Version in active. No workflow definition is active Binding Errors Workflow appears to be successful but the work has not been done.

WHY DUPLICATE / MULTIPLE WORKFLOWS ARE TRIGGERED Two Workflows are triggered by the same event. Disable one of the event linkage Start condition are used to determine which workflow should be triggered by a particular event, but the start conditions overlap. Correct the Start conditions One workflow is triggered by a subtype event, and the other workflow is triggered by the super type event. Use delegation so that just on event is raised / disable one of the event linkages or use start condition (Check Function Module) to decide which workflow should be started. Workflow is triggered directly by a customizing table and also by an event Check the online documentation for this workflow and if necessary disable the event linkage.

45

1. In a workflow process all the users in an Org. unit has to be displayed and a single user for approval should be selected from that list. What object and how that can be done? 2. A workflow task is pointing to a background job. If there is some error in the background process how will you notify it to the user? Explain the process. 3. To which agent the task goes first. 4. If the possible agents r not assigned where the workflow will go. Will it be an error? 5. In order to keep the work item even after it’s executed what to be done. 6. For asynchronous does the terminating event should be given. 7. Is there any relationship between asynchronous and the work item being removed from the inbox, after it is executed. 8. Approve/Reject should be given after the work item is executed and the transaction is called. What to be done (use the function module popup_*) 9. What to be done in Role Resolution. 10. Web flow. 11. ITS 12. Workflow event log trace. 13. Done any monitoring other than deadline monitoring. 14. Agent assignment is done in workflow or standard task. 15. Extending events 16. Can we start a WF without using event? 17. Diff between hierarchy and dynamic hierarchy. 18. To add document by the user during the WF process- attach document activity 19. Use 'process control activity' - to skip the work item and continue the WF process. 20. To terminate the WF (will completely stop the WF process and its associated WF's) 21. To cancel the WF (will stop the current WF process alone and not its associated WF's) 22. When & where to use set & get parameters 23. When set container is used whether get container is a must. 24. What are the various ways to trigger an event? 25. What is the diff b/w workflow task and workflow template? 26. What is the diff b/w standard task and customer task? 27. What is the name of the Fun Mod, which is used to create event? 28. What are the various ways to trigger an event? 29. Diff between Version Dependent and Independent Workflow 30. What is Notification 31. What is Modeled Deadline 32. What is Receiver Type FM and Receiver FM? 33. What is Check FM? 34. What are possible ways in which can be assign to a task? 35. Can a Terminating Event be a starting event for another workflow or task if so how? 36. What is Adoption Workflow 37. Diff. type of role resolution? 38. Diff. between rule and role? 39. Consistency check for a standard task? 40. What work queue workitem? 41. What is Position Related substation agent? 42. Which container element is used to store the Administrator? 43. Why we used object type WF_TASK? 44. Who is the agent for background task? WF_BATCH 45. Completely explain one workflow process. 46. Diff between possible agents & responsible agents. 47. If the possible agents r not assigned where the workflow will go. Will it be an error. 48. In order to keep the work item even after its executed what to be done. 49. For asynchronous does the terminating event should be given. 46

BUSINESS OBJECTS – SWO1 A business object is a problem-domain entity that you model in the SAP system, such as SalesOrder, BillingDocument, and Employee. The BOR stores all the objects in the R/3 system. The repository is a group of all the objects in the R/3 system.

ATTRIBUTES

A business object is primarily represented by its attributes. You perform actions, such as create, update, or delete on the attributes by calling the methods of the object. FIGURE 1 ATTRIBUTE NETVALUE OF OBJECT BUS2032 (SALESORDER).

The majority of attributes are data-dictionary fields (for example, the NetValue attribute is defined by VBAK-NETWR). When you access an attribute of an object, you execute a SQL statement that retrieves the corresponding field in the database.

FIGURE 2 DEFINITION OF ATTRIBUTE NETVALUE.

47

You can also define attributes that do not exist in the data dictionary. These attributes are called virtual attributes. For example, a business partner has an attribute called BirthDate that is stored in the data dictionary. You can add a virtual attribute to the BusinessPartner object called Age. The age of a business partner is not stored in the database, but you can calculate it using the current date and the birth date of the business partner. If you implement the ABAP code that calculates Age, every time you access the Age attribute, the code executes and returns the business partners age.

FIGURE 3 DEFINITION OF VIRTUAL ATTRIBUTE AGE.

The BOR lets you define multi-line attributes. These attributes define one-to-many relationships between an object and other fields. These objects can be defined in the data dictionary or can also be virtual attributes. An attribute that uniquely defines an object in the system is called a key attribute. In the case of a SalesOrder, the key attribute is VBAK-VBELN (the TableName and FieldName). It is not uncommon for an object to have several key fields. An example of this is object is the SalesArea (BUS000603) object type which has SalesOrganization (TVTA-VKORG), DistributionChannel (TVTA-VTWEG) and Division (TVTA-SPARTE) as key fields.

METHODS As mentioned earlier, the methods of an object represent the actions you take with objects attributes. An action in this example would include retrieving the status of one or more sales orders based on specific criteria. Methods are analogous to function modules in that they have importing and exporting parameters as well as exceptions, which you view by selecting a method and clicking on the toolbar button. This allows external systems (or internal developments) to pass and accept parameters from these methods just as if they were using function modules -- allowing external systems to call methods.

48

FIGURE 4 METHODS OF SALES ORDER.

DELEGATION AND SUBTYPING One of the most complex concepts in object-oriented development is that of inheritance. This concept lets you extend core functionality by creating a child of the parent object that inherits all of its attributes and methods. For example, a Manager object is a subtype (child) of the Employee object. The Manager object has all the attributes of an Employee object (such as EmployeeID or Name) but also has some extra attributes (such as CompanyCar or Parking Space). SAP has not implemented inheritance in the BOR. However, it has provided subtyping and delegation, which offer an alternative way to extend R/3 functionality.

SUBTYPING A subtype of an object is another object whose creation is based upon a parent object (see the preceding manager/employee example). The subtype maintains references to all the attributes and methods of its parent object. This means that any methods and attributes defined on the parent can be executed and accessed on the child object. I have often heard less-experienced developers refer to subtyping as copying the parent object. Although the effects can be similar, in order to achieve an understanding of some of the more advanced concepts, such as interface inheritance, it is important to realize that this is not accurate. If a subtype object were merely a copy of its parent, then all the code contained within the parent would be physically copied to the child. This is not the case. The subtype simply maintains references to its parents methods and attributes. The real difference is that the subtype lets you redefine these methods and attributes. You can easily add your own business rules to the parent methods by redefining the subtypes method.

49

FIGURE 5 REDEFINITION OF CHANGE PASSWORD METHOD.

It is imperative that once you redefine the method it still behaves in a similar manner. You are allowed to add extra business logic, but the method must still change the password rather than do something unexpected, like delete a customer. This is particularly important when SAP is being accessed from external systems. The external system will expect a method to provide certain functionality. The developer should take care to ensure that this expectation is met. Delegation Now that you have implemented a new CHANGEPASSWORD method, you need to tell the SAP system to use the redefined version of CHANGEPASSWORD and not the version that was delivered on the KNA1 object. This is similar to object-oriented inheritance but the two concepts do have fundamental differences.

FIGURE 6 DELEGATION FOR OBJECTS.

By making an entry in the delegation table, you tell R/3 that before executing a method on KNA1, it should first check if that method has been redefined on the subtype. If it has, then the system executes the redefined method. If it hasn't, then the system executes the original method. 50

FIGURE 7 EXECUTION FLOW FOR METHODS WITH DELEGATION.

This delegation is powerful because it lets you implement your own business logic without modifying any SAP code. As long as the objects are properly delegated, your method will be executed.

51

ROLE RESOLUTION AGENTS DETERMINATION         

Role Organizational Unit Job Position Work center User Expression Workflow Initiator (Expression) Superior of workflow Initiator (Role)

   

Responsibility Rules Evaluation Paths Function Modules SAP Organizational Objects

ROLE RESOLUTION

AGENTS DETERMINATION

52

PFTC

RESPONSIBILITY RULES If you use responsibilities, you can define the role container using any table fields or object types. The 'Responsibilities' title element enables you to define any number of responsibilities. You can then assign agents to them. You can also define criteria for each responsibility. The responsibility is then valid for the criteria.

53

EVALUATION PATHS - OOAW WF_ORGUN / WF_ORGUS / US_CHEF / SAP_HOLD. PROCEDURE TO DO:  Determine the evaluation path you want to use  Create a rule as normal, setting the type to “Function to be executed” (i.e) this is a function module based rule.  Enter the function module RH_GET_STRUCTURE  Automatically an additional field Evaluation path appears. Enter your evaluation path ID in this field.  Create the following rule container elements  OTYPE / OBJID / ORG_AGENT Table

:

T778A (for Evaluation Paths)

FUNCTION RH_GET_STRUCTURE. *"---------------------------------------------------------------------*"*"Lokale Schnittstelle: *" IMPORTING *" VALUE(ACT_WEGID) LIKE T778A-WEGID OPTIONAL *" TABLES *" ACTOR_TAB STRUCTURE SWHACTOR *" AC_CONTAINER STRUCTURE SWCONT *" EXCEPTIONS *" NOBODY_FOUND *" NO_ACTIVE_PLVAR

ORGANIZATIONAL ATTRIBUTES

RH_OM_ATTRIBUTE_ORGOBJ_FIND (General Attribute Maintenance: Application Scenario) FUNCTION rh_om_attribute_orgobj_find . *"---------------------------------------------------------------------*"*"Lokale Schnittstelle: *" IMPORTING *" VALUE(SCENARIO) TYPE OM_ATTRSCN OPTIONAL *" VALUE(BUFFER_REFRESH) TYPE FLAG OPTIONAL *" VALUE(PLVAR) TYPE PLVAR OPTIONAL *" VALUE(SEARCH_DATE) TYPE DATS DEFAULT SY-DATUM *" TABLES *" AC_CONTAINER STRUCTURE SWCONT OPTIONAL *" ACTOR_TAB STRUCTURE SWHACTOR OPTIONAL *" EXCEPTIONS *" NO_SCENARIO *" NOTHING_FOUND *"----------------------------------------------------------------------

FUNCTION MODULES

You can execute any role resolutions using a function module. Some function modules are supplied by SAP. To Know standard Roles Available  

Use Transaction PFAC Use function module (RH_ACTOR_STRUCTURE_GET

54

1) use Transaction PFAC

2) Use function module (RH_ACTOR_STRUCTURE_GET) to get the following screen. Then type the role number for more info. About role and testing it.

55

CALLING FUNCTION MODULE CALL FUNCTION 'RH_GET_STRUCTURE' * EXPORTING * ACT_WEGID = TABLES ACTOR_TAB = AC_CONTAINER = * EXCEPTIONS * NOBODY_FOUND = 1 * NO_ACTIVE_PLVAR = 2 * OTHERS = 3 . IF SY-SUBRC 0. * MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO * WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4. ENDIF.

FUNCTION RH_GET_STRUCTURE *"---------------------------------------------------------------------*"*"Lokale Schnittstelle: *" IMPORTING *" VALUE(ACT_WEGID) LIKE T778A-WEGID OPTIONAL *" TABLES *" ACTOR_TAB STRUCTURE SWHACTOR *" AC_CONTAINER STRUCTURE SWCONT *" EXCEPTIONS *" NOBODY_FOUND *" NO_ACTIVE_PLVAR *"---------------------------------------------------------------------DATA: PLVAR LIKE OBJEC-PLVAR. DATA: OTYPE LIKE OBJEC-OTYPE. DATA: OBJID LIKE OBJEC-REALO. DATA: TDEPTH LIKE GDSTR-TDEPTH. DATA: ORG_AGENT LIKE SWHACTOR. REFRESH: ACTOR_TAB. SWC_GET_ELEMENT AC_CONTAINER 'PLVAR' PLVAR. SWC_GET_ELEMENT AC_CONTAINER 'ORG_AGENT' ORG_AGENT. IF SY-SUBRC > 0 OR ORG_AGENT IS INITIAL. SWC_GET_ELEMENT AC_CONTAINER 'OTYPE' OTYPE. SWC_GET_ELEMENT AC_CONTAINER 'OBJID' OBJID. ELSE. OTYPE = ORG_AGENT-OTYPE. OBJID = ORG_AGENT-OBJID. ENDIF. SWC_GET_ELEMENT AC_CONTAINER 'TDEPTH' TDEPTH. IF SY-SUBRC > 0. CLEAR TDEPTH. ENDIF. * now read data CALL FUNCTION 'RH_STRUC_GET' EXPORTING ACT_OTYPE = OTYPE ACT_OBJID = OBJID ACT_WEGID = ACT_WEGID ACT_PLVAR = PLVAR ACT_BEGDA = SY-DATUM 56

ACT_ENDDA ACT_TDEPTH ACT_TFLAG ACT_VFLAG AUTHORITY_CHECK TABLES RESULT_TAB EXCEPTIONS NO_PLVAR_FOUND OTHERS

= = = = =

SY-DATUM TDEPTH ' ' ' ' $CROSS

= ACTOR_TAB = 1 = 2.

CASE SY-SUBRC. WHEN 01. MESSAGE E300(5W) RAISING NO_ACTIVE_PLVAR. WHEN 02. MESSAGE E170(5W) WITH PLVAR OTYPE OBJID ACT_WEGID RAISING NOBODY_FOUND. ENDCASE. ENDFUNCTION.

TRIGGERING A WORKFLOW USING FUNCTION MODULES SWW_WI_START_SIMPLE INCLUDE DATA: BEGIN OF WA_VBAK, VBELN TYPE VBAK-VBELN, AUART TYPE VBAK-AUART, AUGRU TYPE VBAK-AUGRU, NETWR TYPE VBAK-NETWR, VKORG TYPE VBAK-VKORG, END OF WA_VBAK. DATA IT_VBAK LIKE TABLE OF WA_VBAK WITH HEADER LINE. ************************************************************************* DATA : AGENTS LIKE TABLE OF SWHACTOR WITH HEADER LINE, CONTAINER LIKE TABLE OF SWCONT, "Assign initiator SALESORDER TYPE SWC_OBJECT, "Assign Values to Workflow Container SALESNUMBER LIKE SWEINSTCOU-OBJKEY. "Create Object ************************************************************************* PARAMETERS SALESNO TYPE VBAK-VBELN. SALESNUMBER = SALESNO. ************************************************************************* IF SY-UNAME = 'KAAV02'. AGENTS-OTYPE = 'US'. AGENTS-OBJID = 'KAAV02'. APPEND AGENTS. ENDIF.

57

*“Macro Commands to assign values to Container SWC_CONTAINER MY_CONTAINER. SWC_CREATE_CONTAINER MY_CONTAINER. SWC_CREATE_OBJECT SALESORDER 'BUS2032' SALESNUMBER. SWC_SET_ELEMENT MY_CONTAINER ‘Salesorder' SALESORDER. SWC_CONTAINER_TO_PERSISTENT MY_CONTAINER. SELECT

VBELN AUART AUGRU NETWR VKORG INTO TABLE IT_VBAK FROM VBAK WHERE VBELN = SALESNO.

READ TABLE IT_VBAK WITH KEY VBELN = SALESNO. SWC_SET_ELEMENT MY_CONTAINER 'NETVALUE' IT_VBAK-NETWR. CALL FUNCTION 'SWW_WI_START_SIMPLE' EXPORTING TASK = 'WS80000786' TABLES AGENTS = AGENTS WI_CONTAINER = MY_CONTAINER.

EXECUTING WORKITEM FORM USER DEFINED SCREEN Class : CL_WAPI_WF_TOOLBOX Data : C_TOOLBOX TYPE REF TO CL_WAPI_WF_TOOLBOX, WORKITEMID TYPE SWW_WIID VALUE ‘700551’. CREATE OBJECT C_TOOLBOX EXPORTING I_CONTAINER I_REPID I_DYNNR I_MODE I_WI_ID

I_MODE ( Additions )

C_MODE_INPLACE_WITH_INFO C_MODE_INPLACE_BUTTON_ONLY C_MODE_MODELESS

= = = = =

CONT “ Object of CL_GUI_CUSTOM_CONTAINER SY-REPID ‘9000’ CL_WAPI_TOOLBOX=>C_MODE_INPLACE_WITH_INFO WORKITEMID.

-

Show Only Toolbar Embedded (0 / 1) Show Only, Text, Links Show Toolbar, Text, Links in Modular window

58

RAISING A BUSINESS OBJECT EVENT WITH A CONTAINER The following code raises the EVENTRAISED event linked to the sales order business object BUS2032 and passes in the variable WEATHEROUTSIDE with the value SUNNY. INCLUDE . SWC_CONTAINER LT_EVENT_CONTAINER. SWC_CREATE_CONTAINER LT_EVENT_CONTAINER. SWC_SET_ELEMENT LT_EVENT_CONTAINER 'WeatherOutside' 'Sunny'. CALL FUNCTION 'SWE_EVENT_CREATE' EXPORTING OBJTYPE = 'BUS2032' "Sales order object OBJKEY = '0000014078' "Sales order number EVENT = 'EventRaised' "Event defined in SWO1 CREATOR = 'X' START_RECFB_SYNCHRON = 'X' IMPORTING EVENT_ID = EVENT_ID TABLES EVENT_CONTAINER = LT_EVENT_CONTAINER.

59

ACTIVATING GENERIC BUSINESS OBJECT SERVICES If you want to have the same functionality that is available when you push the Services for Object button located at the top of each SAP related document you can do the following: 1) Enable your functionality as an object in the BOR using SWO1 - Make sure it generates 2) Add this code to your EDIT dialog (in the PAI section after pushing a button) that you use against that object. *** EXAMPLE CODE *** data l_borident like borident. CASE ok_code. WHEN 'OBJSERV'. l_borident-objkey = zcustomobj-id. l_borident-objtype = 'ZCUSTOM'. l_borident-logsys = 'DEVCLNT005'. IF NOT l_borident-objtype IS INITIAL and not l_borident-objkey is initial. CALL FUNCTION 'SWU_OBJECT_REFRESH'. ** activate generic system service CALL FUNCTION 'SWU_OBJECT_PUBLISH' EXPORTING objtype = l_borident-objtype objkey = l_borident-objkey EXCEPTIONS objtype_not_found = 1 OTHERS = 2. CALL FUNCTION 'SWU_OBJECT_DISPATCH_SERVICE' EXPORTING service = 'HC1H' called_by_system = space EXCEPTIONS OTHERS = 0. ENDIF. ENDCASE.

60

Testing Role Resolution : PFAC

ORGANIZATIONAL DATA If you select this option, role resolution is executed using 'business object types' related in the organizational model. For example, you can relate organizational units to the 'country' object type. A value for the country must then be written to the role container at runtime. Role resolution then returns all of the organizational units assigned to this country. 

SAP Organizational Objects Allows to match codes entered in customizing tables against organizational objects in the organizational plan.



If you have code representing a particular laboratory, you can relate this to an organization unit representing all the people in the laboratory. If you have code representing an MRP controller, you can relate this a particular job (or) position in the organizational plan.

Eg: 

61

LOCK INDICATORS The following lock indicators can be set for single step tasks: Locked against instantiation The system does not create a work item for the single step that is locked against instantiation Locked against execution The system does create a work item for the single step task that is locked against execution however it cannot be executed. Business process models: The process consultant analyzes the real-life business processes of a company and tries to map these processes into an optimized, workflow-compatible business process model. To create the role: For process consultant: SAP_BC_SRV_USER SAP_BC_BMT_WFM_PROCESS Person within the system of workflow roles who analyses the existing business processes, identifies those that are suitable for SAP Business workflow and maps them onto a business model. For work developer: SAP_BC_BMT_WFM_DEVELOPER Person within the system of workflow roles who implement the workflow based process model developed by the process consultant and using the SAP Business workflow definition tools. For workflow system administrator: SAP_BC_ENDUSER SAP_BC_SRV_USER SAP_BC_BMT_WFM_ADMIN Person within the system of workflow roles who is responsible for the technical maintenance of the development environment and the runtime behavior after automatic customizing. For workflow agent: SAP_BC_SRV_USER Person within the system of workflow roles who appears as an end user in productive workflows. The workflow agent starts workflows and processes work items. Their work area is the Business Workplace. For process controllers: SAP_BC_SRV_USER SAP_BC_BMT_WFM_CONTROLLER

62

VERSIONS IN WORKFLOW Default Version 0000. To Generate a new version. Choose Workflow -> Generate Version. Generates a version 0001 – Active Version. Import & Export parameters are not subject to version change

DISPLAYING VERSIONS Choose Basic Data.  Version Independent Basic Data  Version Overview When transported to another system, only the ACTIVE VERSION is transported with a new free version number.

TABLES AFFECTED SWDSHEADER

FIELDS

WFD_ID VERSION EXETYP

:

WF DEFINITION BASIC DATA

Workflow Definition Version Workflow Type

WORKFLOW TYPES S E D R C A

-

Definition Runtime Ad Hoc Definition Ad Hoc Runtime Configuration Definition Configuration Runtime

CHANGE TO HR MASTER DATA SWEHR1 SWEHR2 SWEHR3

Linkage Object Type to HR Infotype Event Infotype Operation (SAP) Event Infotype Operation (Customer)

CHANGE DOCUMENTS SCDO SWED SWEC BSVW NACE AWUW

Overview Define Workflow Properties Linkage Status Management Message Control Logistics Information System

EVENT LINKAGE SWETYPU SWB_COND SWUY

Type Linkages Workflow Start Conditions Create Workflow Message Linkage

SWFC SWF_AUTO

Automatic Workflow Customizing

63

SUBSTITUTING BY USERS – (INFO. FROM EDI BOOK PG. NO. NO. 185 - CHAP. 9) Substitution is the capability to designate another position as a backup to execute your work items. The person who wants to assign someone else his or her substitute has to initiate the process. 1. 2. 3. 4.

Go to SBWP Choose settings, workflow settings, maintain substitute. Click the create substitute button. Enter the user ID of the person who will substitute for you and enter the date on which you will be gone in the validation period. If you sets the substitute option correctly, you can log on to the system with his ID and select your’s workitem as follows. 1. Go to SBWP 2. Select settings, workflow settings, adopt substitution 3. From the list of users who have assigned you as the backup. SUBSTITUTING BY ADMINISTRATOR The system administrator can set a substitute in the HR module. 1. Execute PO13. 2. Enter the position of the person who needs a substitute. Click the Relationship Info Type under the Active Tab. Click the Create button. 3. Use B311 in the Type of the Relationship field. Enter S for the Type of Related Object, and enter the position of the user who will be the substitute in the ID of the Related Object Field. Save your entry to define the substitute.

64

THE FOLLOWING IS AN EXTRACT FROM TABLE HRP1000 WS00000016 WS00000023 WS00000024 WS00000025 WS00000026 WS00000033 WS00000038 WS00200025 WS00200028 WS00200034 WS00200035 WS00200036 WS00200038 WS00200061 WS00200062 WS00200063 WS00200065 WS00200066 WS00200067 WS00200068 WS00200069 WS00200070 WS00200071 WS00200072 WS00200073 WS00200075 WS00200081 WS00200085 WS00200095 WS00200096 WS00200097 WS00200098 WS00200099 WS00400002 WS00400004 WS00400005 WS00400006 WS00400011 WS00400012 WS00400014 WS00400019 WS00400020 WS00400021 WS00400022 WS00400024 WS00400025 WS00400026

AL-EARLYINP AM_SUBWF AM_WF_1 AM_WF_1_ERL AM_WF_ALL exmpformabs wf_req_rel WF Test1 WF Test2 Pool Contract Interview Applicant Processing Close Complete Process Assign plan Release lot Confirm cert Inv.postings L-tInspCompl Usage dec. Res.L-tChar. Selection Close Processing In process In_process Process Complete Close In_process ECO Doc Flow FIPP_COMPL WFMC_CUSTOM1 WFMC_CUSTOM2 BSEG_SUBWF01 BSEG_FRAME1 WFMC_CUSTOM3 CreateLetter CreateLetter BSEG_SUBWF02 BSEG_SUBWF03 AppEvtCreatr PrepareHire MMIVquantity

ArchiveLink - EarlyInput FI-AA subflow for error handling FI-AA mass change/retir. w/o rev.type 1 FI-AA retirement with revenue dist.type1 FI-AA mass change/retir. w/o rev.type 2 Workflow template: Notif. of absence Workflow for purch.req. release WF test flow with one step TestWF with parallelism and recursion Applicant pool Offer of contract of employment Interview Applicant Applicant processing Process quality notification Close quality notification Complete task Process PM notification Assign plan Release inspection lot for inspection Confirm receipt of certificate Perform missing inv.postings for lot Long-term inspection completion Make usage decision Results recording long-term inspection Applicant selection Close PM notification Process error records Process quality notification PM notification in process Process service notification Complete task Close service notification Service notification in process Demo ECM Object equal Document FIPP_COMPL WFMC: Customizing Message Control WFMC: Customizing output type Release for payment single-stage Release for payment (frame) WFMC: Maintain access seq. and cond.tab. Create + send letter Create letter Release for payment two-stage Release for payment three-stage Event Creator 'Vacancy assigned' Prepare hiring Handling invoice locked due to quantity 65

WS00400027 WS00400032 WS00600011 WS10000050 WS10000051 WS10000052 WS10000054 WS10000056 WS20000006 WS30000015 WS00000016 WS00000023 WS00000024 WS00000025 WS00000026 WS00000027 WS00000033 WS00000038 WS00000039 WS00000042 WS00000044 WS00200025 WS00200028 WS00200034 WS00200035 WS00200036 WS00200037 WS00200038 WS00200061 WS00200062 WS00200063 WS00200065 WS00200066 WS00200067 WS00200068 WS00200069 WS00200070 WS00200071 WS00200072 WS00200073 WS00200074 WS00200075 WS00200081 WS00200085 WS00200095 WS00200096 WS00200097 WS00200098 WS00200099

MMIVprice FIPP_FRAME_2 ECM flow crte_contrct FIPP_FRAME FIPP_SUBWF01 FIPP_SUBWF03 AL-EARLYINP FIPP_SUBWF05 AF_process AL-EARLYINP AM_SUBWF AM_WF_1 AM_WF_1_ERL AM_WF_ALL AM_WF_2_ERL exmpformabs wf_req_rel ECM flow ECO flow ECO BOM flow WF Test1 WF Test2 Pool Contract Interview Selection Applicant Processing Close Complete Process Assign plan Release lot Confirm cert Inv.postings L-tInspCompl Usage dec. Res.l-t.ins. Selection Complete Close Processing In process In_process Process Complete Close In_process

Handling invoice locked due to price Preliminary posting (frame), sequential Engineering Change Master Create contract Preliminary_Posting (Frame) Release amount workflow single-stage Release amount workflow three-stage ArchiveLink - EarlyInput Release amount workflow empty Process notification of absence ArchiveLink - EarlyInput FI-AA subflow for error handling FI-AA mass change/retir. w/o rev.type 1 FI-AA retirement with revenue dist.type1 FI-AA mass change/retir. w/o rev.type 2 FI-AA retirement with revenue dist.type2 Workflow template: Notif. of absence Workflow for purch.req. release Engineering change master (template) Demo ECM object unequal BOM Demo ECM bill of material WF test flow with one step TestWF with parallelism and recursion Applicant pool Offer of contract of employment Interview applicant Applicant selection Applicant processing Process quality notification Close quality notification Complete task Process PM notification Assign plan Release inspection lot for inspection Confirm receipt of certificate Make missing inventory postings for lot Long-term inspection completion Make usage decision Record results of long-term inspection Applicant selection Complete task Close PM notification Process error records Process quality notification PM notification in process Process service notification Complete task Close service notification Service notification in process 66

WS00400002 WS10000021 WS10000044 WS10000048 WS10000049 WS10000050 WS10000051 WS10000052 WS10000053 WS10000054 WS10000055 WS10000056 WS20000001 WS20000006 WS00000023 WS00000024 WS00000025 WS00000026 WS00000027 WS00000033 WS00000038 WS00000039 WS00000042 WS00000044 WS00200028 WS00200034 WS00200034 WS00200034 WS00200035 WS00200035 WS00200035 WS00200036 WS00200036 WS00200037 WS00200038 WS00200061 WS00200062 WS00200063 WS00200065 WS00200066 WS00200067 WS00200068 WS00200069 WS00200070 WS00200071 WS00200072 WS00200073 WS00200073 WS00200073

ECO flow AL-EARLYINP exmpformabs send_mail CRTE_CONTACT crte_contrct FIPP_FRAME FIPP_SUBWF01 FIPP_SUBWF02 FIPP_SUBWF03 FIPP_SUBWF04 AL-EARLYINP Selection FIPP_SUBWF05 AM_SUBWF AM_WF_1 AM_WF_1_ERL AM_WF_ALL AM_WF_2_ERL exmpformabs wf_req_rel ECM flow ECO flow ECO BOM flow WF Test2 Pool Pool Pool Contract Contract Contract Interview Interview Selection Applicant Processing Close Complete Process Assign plan Release lot Confirm cert Inv.postings L-tInspCompl Usage dec. Res.L-T.ins. Selection Selection Selection

Demo ECM Object equal Document ArchiveLink - EarlyInput Example workflow: Notif. of absence Send mail Create contact Create contract Preliminary posting (framework) Release amount workflow single-stage Release amount workflow two-stage Release amount workflow three-stage Full release workflow ArchiveLink - EarlyInput Applicant selection Betragsfreigabeworkflow leer FI-AA subflow for error handling FI-AA mass change/retir. w/o rev.type 1 FI-AA retirement with revenue dist.type1 FI-AA mass change/retir. w/o rev.type 2 AM Standard mit Erlös (Typ 2) Workflow template: Notif. of absence Workflow for purch.req. release Engineering change master (template) Demo ECM object unequal BOM Demo ECM bill of material TestWF with parallelism and recursion Applicant pool Applicant pool Applicant pool Offer of contract of employment Offer of Contract Offer of Contract Interview Applicant Interview Applicant Applicant selection Applicant processing Process quality notification Close quality notification Complete task Process PM notification Assign plan Release inspection lot for inspection Confirm receipt of certificate Perform missing inv.postings for lot Long-term inspection completion Make usage decision Record results of long-term inspection Applicant selection Selection procedure Applicant selection 67

WS00200074 WS00200075 WS00200081 WS00200085 WS00200095 WS00200096 WS00200097 WS00200098 WS00200099 WS00400002 WS00400004 WS00400005 WS00400006 WS00400011 WS00400012 WS00400014 WS00400019 WS00400020 WS00400021 WS00400024 WS00400025 WS00400026 WS00400027 WS00600011 WS10000021 WS10000048 WS10000049 WS10000050 WS10000051 WS10000052 WS10000053 WS10000054 WS10000055 WS10000056 WS20000006 WS30000015

Complete Close Processing In process In_process Process Complete Close InProcess ECO Doc Flow FIPP_COMPL WFMC_CUSTOM1 WFMC_CUSTOM2 BSEG_SUBWF01 BSEG_FRAME1 WFMC_CUSTOM3 Create Letter Create Letter BSEG_SUBWF02 AppEvtCreatr PrepareHire MMIVquantity MMIVprice ECM flow AL-EARLYINP send_mail CRTE_CONTACT crte_contrct FIPP_FRAME FIPP_SUBWF01 FIPP_SUBWF02 FIPP_SUBWF03 FIPP_SUBWF04 AL-EARLYINP FIPP_SUBWF05 AF_process

Complete task Close PM notification Process error records Process quality notification PM notification in process Process service notification Complete task Close service notification Service notification in process Demo ECM Object equal Document FIPP_COMPL WFMC: Customizing Message Control WFMC: Customizing message type Release for payment single-stage Release for payment (frame) WFMC: Maintain access seq. and cond. tab. Create + send letter Create letter Release for payment two-stage Event Creator 'Vacancy assigned' Prepare hiring Handling invoice locked due to quantity Handling invoice locked due to price Engineering Change Master ArchiveLink - EarlyInput Send mail Create contact Create contract Preliminary_Posting (Frame) Release amount workflow single-stage Release amount workflow two-stage Release amount workflow three-stage Acct assignment approval workflow ArchiveLink - EarlyInput Release amount workflow empty Process notification of absence

68

WORKFLOW PERFORMANCE GENERAL  To avoid an unnecessarily high number of tRFC calls during workflow implementation, some activities of the workflow runtime system, such as data flow or processor determination, are carried out under the userid of the person responsible instead of under WF-BATCH. NOTE: Remember to assign this user the necessary authorizations, in particular for the HR authorization object PLOG. Assign more authorizations to the person responsible (for example, for PLOG we recommend the profile P_PLAN_ALL) or add empty background steps to your workflow definition (for example, based on the single step task TS30000044, object type WFTS, method EMPTY_BACKGROUND). Ultimately, there is a trade-off between security and performance. (See SAP Note 755767)  Note: The background user for the workflow runtime system or a user who creates an event always occupies a work process if a transactional RFC is sent. This occurs during the following actions in workflow: o When starting event receivers (that contains exiting an asynchronous method). o When starting a background step whose predecessor was not exited by an event.  Inbox o The selection time of work items in a user inbox increases with the number of tasks which the user may process. o The selection time also increases with the number of available work items. o Data of a work item may have to be read by the database. PROGRAMMING TIPS  Reducing the number of work items for each workflow o Replace reading/calculating background methods by virtual attributes (for the evaluation of a virtual attribute, no work item is created). o Group together several small background methods in one large group (a work item is created for every background step).  Preventing unnecessary tRFCs o Replace asynchronous methods by synchronous methods (thus the system does not have to execute the exiting event = tRFC). This is usually possible if the method is not exited in the update program. o Do not check input data in the first workflow step but use the option to enter a check function module in transaction SWE2. Thus you avoid the generation of unnecessary work items and the relocation of unnecessary tRFCs.  Define the task assignment in the organizational model concretely. (Do not classify tasks as general tasks). Every user should only be a possible agent of very few tasks. BASIS / CONFIG TIPS  Restrict the number of application servers on which you can start event receivers of events generated on a large-scale. As a result, other application servers will be available for 'regular' online operations. To do this, create a RFC destination of the type '3' in transaction SM51 and permit the load distribution. Remember that system parameters control the intervals according to which the message server searches free application servers. Then enter this destination in the detail screen for the event in transaction SWE2.  Remove columns from the starting configuration of the inbox. A subsequent selection of the database occurs for the following columns: o Task long name o Finish by date o Finish by time o Overdue (up to and including Release 3.1I) o Object (in older releases, object key 1) o Group (in older releases, object key 2) 69



Archive work items that are not required for a longer period and subsequently update the database indexes (read also notes 72873, 49545). Allow the system to buffer as much data as possible. To do this, maintain the entries in group WFLOW in table T77S0 (in particular, entries with identification codes BUF, INBOX, ROLE). With WFLOW INBOX, the buffer mode is set for tasks that are assigned to a user, as well as for organizational assignments of users. We can assume the following values: o 'I' : Buffering in database INDX, refreshment at least once a day o 'S' : Buffering in the shared buffer on the application server o ' ' : No buffering WFLOW ROLE is used to check the result of the agent determination. 'X' (recommended). The agent is checked if it is a possible agent (and not an excluded agent, and so on). WFLOW BUF is no longer.  As the system is running, index records are frequently created for the workflow runtime tables and then deleted again. This has a negative effect on performance during accesses via these indexes. ARCHIVING WORKITEMS  Production: In production systems it is recommended you archive workitems using the object WORKITEM. You can only archive workitems of status COMPLETED or CANCELLED. (Use transaction SARA) It is NOT recommended you use report RSWWWIDE in a production system because the report does not check dependencies, so there is always a danger to delete steps in a flow which is not completed.  Development/Test: Note(49545) To delete workitems using reports RSWWWIDE RSWWWIDE - this report deletes the work item including all attachments and dependent work items, and deletes the work item history. tRFC and qRFC tables The system has a very high interface load and/or many tRFC/qRFC entries are in the error status and/or many tRFC/qRFCs wait for their processing Before you solve the problem, you must make a more precise analysis of the problem. 1. Outgoing t/qRFCs Check whether you use tRFC or qRFC:  Use Transaction SE16 to check how many entries are contained in table ARFCSSTATE.  Now determine for how many entries field ARFCRETURN is empty in table ARFCSSTATE. These entries stand for tRFCs which have not been processed yet or which encountered errors. Tables ARFCSSTATE and ARFCSDATA are affected here, these tables contain many entries. (refer also to point 5) 2. Incoming t/qRFCs a) Table ARFCRSTATE contains many entries, it does not matter if these were written by tRFC or qRFC. Find solutions in Note 366869. b) Tables TRFCQIN, TRFCQDATA or TRFCQSTATE contain many entries. 

Periodic Deadline Checking. In the SAP Web AS Release 6. 40 it is no longer possible to configure case-specific deadline monitoring. Periodic monitoring is supported and the interval between deadline checks can be customized. This has been done to reduce system load and avoid skipped deadlines when the system load is high. If you are configuring an old Release, you are recommended to avoid using case-specific deadline monitoring - configure periodic monitoring instead.

70

COOL WORKFLOW FUNCTION MODULES  For locking of work items against execution, use the function module SWW_WI_DISABLE  For unlocking of work items against execution, use the function module SWW_WI_ENABLE  To read the container elements of a particular work item, use the function module SWW_WI_CONTAINER_READ  We can change the attributes of the deadline monitoring for a particular work item by using the function module SWW_WI_DEADLINES_CHANGE Sending a mail on triggering a particular event Do you want to send a mail when a particular event has been raised? 1. Go to transaction SWETYPV 2. Select "New entries". 3. Enter the Business object and the corresponding event name. Enter the SAP userid in the "Receiver type" and SWE_EVENT_MAIL as the reciever FM. 4. Set 'Type linkage' to active. Whenever the event is raised, an SAP office mail is sent to the corresponding SAP user id. This mail also includes the container elements of that particular event.

PASSIVE (VS) ACTIVE SUBSTITUTIONS Set substitution from PASSIVE to ACTIVE. The substitution should be in HRUS_D2 from the original user id to the substitute user id for ALL tasks and for the relevant dates. This will make the original user's work items IMMEDIATELY appear in the substitute's inbox - like email auto-forwarding. This will also tell you if you have the substitution relationship between the two users set up correctly.

RETURNING WORKLFOWS ATTACHED TO A BUSINESS OBJECT Call function module SAP_WAPI_WORKITEMS_TO_OBJECT objtype = 'BUS1001006' (e.g. Material - Substitute with the applicable business object) objkey = material number top_level_items = 'X' or space selection_status_variant = 0000 Worklist is returned with workflows tasks linked to the business object.

71

TROUBLESHOOTING WHEN THE WORKFLOW DOES NOT START CORRECTLY Case 1: When the workflow does not start. If the workflow does not start this is either because it is not being triggered properly or the workflow definition is not complete. First determine how the workflow should be started. Directly? Via a customizing table? Via an event? Transaction SWUD offers intelligent diagnosis help to establish if the flow was started, if the triggering event was fired, if the flow is syntactically correct, if users are assigned to all the tasks... Case 2: When the workflow starts twice. The most probable cause of a workflow being started twice is that it is triggered by two separate mechanisms simultaneously. For example if the flow is being triggered by an event, check that this event is only firing once. For example, you might find that it has fired once due the customizing for change documents AND once due to the customizing of status changes. Transaction SWUD will allow you to determine how many times the event is firing. If it is only firing once, check that the workflow is not additionally being started directly by a program or customizing tables. Check that the workflow is not customized to trigger on two separate events. Sending e-mails from the workflow. There is a wizard in the workflow editor which will help you send straightforward e-mails from the workflow. The wizard generates a step based on the business method SELFITEM Send Task Description. You cannot modify the business object SELFITEM and delegate so if you want to do something more sophisticated you should build your own method in another object based on the function modules SO_xxx_API1. These function modules are the APIs for sending mail and are fully documented. Use the where-used list to see examples. Different mechanisms for accessing work items. In an early stage of the project you should consider the issue of how users are going to be notified off and access work items. Usually this decision will not influence the definition of the workflows but there may well be organizational issues involved which you should consider early on. ASAP contains a table of alternative methods. The most common being:

72

SCENARIO ANALYSIS Scenario I E-mails went to all the 5000 users: do not know what is the reason? And How? Solution: Before analyzing the problem; first stopped generating mails; and stop Scheduling  One using SM37 for stopping the Job Scheduler  Stopped SAP o/p outbound Mailer Analysis  Workitem could not find the Actual agents; so it is sending mails to all possible agents.  One person did the Manual posting; And when executed the workitem in the inbox;  It was trying to Mail to the actual agents; since Actual agent has already PO manually; the workitem couldn't get the actual agent for posting and if passed on to all Possible agents. So it sends e-mail to all the users.  Other action taken is if they still do manually; one function will check for whether workitem is already there if there it will deleted the workitem and do the Manual posting. Scenario II During Creation of Sales Order; VA01; for some Sales order workflow is not getting triggered; for some it is getting triggered They would have checked only for some order type for triggering. So for some SO it gets triggered. Scenario III When the Approver Approved the Document, Document is/was posted; but when we actually see it is only in Parked condition. Also workflow gave a popup message document posted. Analysis:  While go through identified they were using BDC in the background for posting  While tested BDC it worked properly in foreground; but when posting through background it failed. After seeing the input file found out some field were blank and caused error. Solution: Rectified the date Scenario IV Three documents was Initially parked; Three Different approver? All workitem in Process and in the inbox Who did Posting?? Manually Analysis  Need to find out who did the posting; all the three of them calling and wants to know who did posting.  From workflow long could able to find out Document got created and work time in process;  So, for the Question How to find out that who did manual posting:  Went to the table CDPOS -> Changed document table, find out the change history of the document, and identified the person. Reverse the Process  Deleted workitem manually  Created SO again. 73

WORKFLOW SCENARIO 1. PURCHASE ORDER CHANGE If an external material (non-stock material) or service (externally processed activity) has to be procured for a certain production order, a purchase requisition must be created. The purchaser responsible processes this requisition and one or more purchase orders are created as a result. This is noted in the production order. If changes are made to the materials or services ordered for the production order (changes to the requirement quantity or requirements date), the system modifies the purchase requisition automatically. Any purchase orders that have already been created must be changed manually by the purchaser responsible. Using SAP Business Workflow, the purchaser responsible can be informed if  Changes are made to the requirement quantity or requirements date for an external material or externally processed activity  An external material item or external service activity has been deleted  An external activity has been changed to an internal activity  Or if a production order has been technically completed and the external material or activity are no longer needed  And if one or more purchase orders have already been created. The purchaser receives a work item containing all of the relevant changes regarding the external materials and activities. He or she can then display the relevant purchase requisitions and any purchase orders that have already been created. The purchase orders can also be edited or new ones created.

2. MASTER CONTRACT CHANGE Changing the master contract triggers a workflow that accesses the assigned lower level contracts and automatically copies the changes to the lower level contract. If an error occurs, a work item appears in the inbox of the person who changed the master contract, who has to process it manually. A separate window displays all the changes that have been made for information purposes. If a temporary error occurs in a lower level contract that you want to change, for instance, it is blocked because someone is processing it, the system carries out the changes later on in the background. You can decide how much later on the system makes the changes by making the settings for a time span in Customizing. If the system cannot make the changes after several attempts, the person who changed the master contract receives a work item in their integrated inbox. When you trigger the work item, the system tries to change the lower level contract in the background again. If an application error then occurs, the system replaces the work item with a new one that can only be processed online. In order to guarantee consistent data retention, all the lower level contracts that are to be changed are blocked until the workflow has finished. Once the changes have been made, the workflow finishes and the document is unblocked.

3. CREDIT MEMO PROCESSING: Depending on the value of the credit memo request, the system runs through one of the following processes when you enter a credit memo request:  If the value of the credit memo request is smaller or equal to a certain limit (L1), the system automatically releases the credit memo request. The system removes the billing block in the background, releasing the credit memo request for billing.  If the value of the credit memo request is between limit L1 and limit L2, or equal to L2, the job responsible is informed that the credit memo request should be checked. All the 74

people assigned to this job receive a work item in their integrated inbox, where they can cancel, release or process the credit memo request. o Cancel credit memo request The employee has to enter a reason for rejection. The system automatically transfers the reason for rejection into the credit memo request and stops processing. o Release credit memo request The system automatically removes the billing block in the credit memo request and releases the document for billing. o Process credit memo request Here, the user branches into the "Change sales order" transaction, where they can use all the functions in this transaction. According to the user’s authorization, he or she can remove a billing block, enter a reason for rejection, or process individual items (for example, delete or add order items, or change the order quantity). The system checks whether the billing block was removed manually. If there is a billing block, the system re-checks the value of credit memo request and informs the employee responsible. This process is repeated until the credit memo request has either been rejected or released.

4. PARK DOCUMENT RELEASE Whenever an incomplete accounting document (original document or processing document) is parked the workflow should be triggered. Then parked documents can be deleted, completed, checked, and then posted .The above are processing phases of this workflow. In completion phase the incomplete datas are completed and send for approval as a form to respective person .In checking phase incoming or payment Amounts should be checked against the threshold value and based on the value range dynamically a subworkflow should be determined thro that release procedure levels determined and finally get status release. After get released the document get posted. Amount value range level of approval (sub workflows)  Below 10,00.00 No approval , directed to release  10,00.00 – 1,00,00.00 2  1,00,01.00 – 2,00,00.00 3  2,00,00.00 & Above 4 The Workflow should terminate until the parked document get posted or deleted.

5. INCOMING INVOICE WORKFLOW  Whenever an incoming invoice is received, a workflow will be triggered to send the information regarding this invoice for the approval of concern authority.  Extend business object BUS2081, Create event invoiceReceived, Create methods YYFGetVendorInfo, YYFPurchaseInfo . To display the vendor information And Purchase Information.  Compare the Quantity in a Purchase order with Invoice if There is any Variance in Quantity, Block the invoice due to Quantity variance and send a notification to MM department to check a Purchase order Quantity and GR quantity.  Once you receive any acknowledgement from MM department Check any quantity to be received from vendor with respect to delivery date. If any, change the Status of the invoice from Block to Hold.  When the Invoice status is changed to hold send a notification to MM dept, it has to trigger one separate WF that workflow will be terminated until Balance quantity Received from Vendor.

75

 Check the Purchase order price with Invoice Price if there is any price variance ,Block the invoice due to Price variance and send an invoice to FI dept to Cross verify. The Workitem will get terminated until FI dept Changes the invoice or any Reversal is created or manually release a particular invoice. The Workflow will not be completed until posting is completed.  Create a function module to approve the incoming invoice.  Final integration and Business Automation processes have to perform in MM, FI module.

6. SALES ORDER CANCELLATION WORKFLOW     

Design and developed workflow template for Sales Order Cancellation Workflow. Extend Business object VBAK. Maintain Change document event linkage. Create new events and methods in the extended subtypes. Created the role resolution for determining the approvers.

Process Flow: When a Sales Order Item has been rejected, a work item will be sent for approval to the Approvers. The Approvers are maintained in Custom Tables in ZWFSO_AGENTS, ZWFSO_LEVELS. This cancellation has to be carried out at four different hierarchies; After the cancellation, the change made has to be informed to the agents via a Script Document. ( Use Dynamic Parallel Approval Procedure ).

7. INTRACOMPANY SALES ORDER NOTIFICATION.     

Design and develop workflow template for notification of Sales Order Creation. Extend Business object BUS2032 Create a role to determine the Inside Sales Person. The notification will also list the materials not maintained in Sales Area. Will also update schedule line dates using BAPI – BAPI_SALESORDER_CHANGE’.

Process flow: Whenever an Intra-Company Sales Order created, the workflow will be triggered and notifies the Inside-sales person, maintained in a custom table. This notification has to be sent to both the highest authorities of the two departments. (Use Evaluation Path Method).

8. BROKEN ORDER NOTIFICATION WORKFLOW Design and develop a workflow template for broken order notification.   

Use Business Objects IDOC and its subtypes for tracking the incoming idoc. Create a Subtype for the Bus2012 by creating new methods and events. Create user-defined methods to validate the idoc and to check for any other changes in the incoming idoc.

Process Flow: When ever an order confirmation for the PO is received, if the Schedule Quantity does not match with Vendor Quantity. A Workflow will be triggered to notify Purchasing group. The change in quantity has to be modified in the PO document. 76

9. HR INFO TYPE NOTIFICATION WORKFLOW    

Business objects Of HR module Customize Leave of Absence, and develop Pay change, Bank Information Change, Incident Reports Workflow. Extend the business object BUS1065. Created event ‘Address Changed’ Created new events, methods in extended sub-type.

Process Flow: Whenever any changes in Address Info type, a notification will be given to Payroll Department, mentioning the change made as an attachment. 8. Inquiry Notification Workflow ( Venkateeshz , Tamilarasan ) Design the workflow and business objects for SD Module. Inquiry and quotation.  

Extended business objects BUS2030, BUS2031. Created new events, Methods by extending Business Object BUS2031.

Process flow: After creating the inquiry, the material availability is checked. If material is not available, it will be sent to PPC Dept.to find out whether item can be made inhouse/boughtout. If it is bought out, the message will be notified to Finance Dept. After Approval at Finance Dept it will be notified to purchase dept to procure the item. 10. PURCHASE ORDER APPROVAL WORKFLOW Workflow have to trigger only when the order value is greater than $2000.00 and the number of line items is greater than 2, block the purchase order and trigger workflow for approval. If the Workflow gets started, it will send the Work item to the Manager for approval process. If he doesn’t take any action for a day, the work item will be escalated to the next level manager for approval process. If the Purchase order is changed during the approval process, the workflow will be terminated. Use release Strategy Procedure for releasing a Purchase order . 11. REQUEST FOR QUOTATION WORKFLOW Trigger workflow whenever RFQ is created. If the RFQ quantity is greater than 20 . RFQ will automatically block. It has to trigger a workflow for Release . ( Use release Strategy Procedure ) . Once the RFQ is released, A notification containing the details of Vendor, person created the RFQ and purchase document number is sent to the purchasing group manager for approval. The manager has been given an option to execute the work item or it can be escalated to another same level of manager for approval. The approval status is sent to the creator of the RFQ for further proceedings. ( Use dynamic Circular Approval Procedure ) Add a method in a Business Object to create a report for Blocked RFQ’s and also for particular Purchase organization and send an attachment related to all Purchase organization agents!

77

12. PURCHASE ORDER – CREDIT LIMIT CHECK When a Purchase order is received from a customer check the debtor balance including the PO value. If the debtor balance is more than 60 days excluding the PO then escalate to the next level of approval. Assign a limit to the customer and check if the balance exceeds this limit also escalate to the next level. On approval release the sales order. Inform by mail to the party with a copy to the Sales Manager. Once the customer makes the old payment to clear the debtor balance check again to release the PO.

13. CUSTOMER BLOCK SCENARIO When the Sales order value for the particular customer gets Exceeds the workflow will automatically block the customer ( sales area ). If customer is blocked. The other workflow will automatically get triggered. It will go for various approval processes for that particular sales Organization people . When the all approval is completed the customer block should be automatically release from customer master. Same procedure has to be followed for Billing Block and Delivery Block . 14. MATERIAL MASTER CHANGE WORKFLOW When the part class in material master is updated to specific part classification types, want a workflow sent to master data group indicating a change in material classification has occurred, resulting in risk and liability to event this workflow triggers master data group to coordinate with business units on resolution. In the MM transaction when a user modifies the Cross Plant Material Status or the Cross distribution Chain Status or both. The Change Document object, ‘Material’ associated with the MM02 transaction, captures the above changes. The system is configured to trigger a workflow whenever there is a change in the fields, such as MARA-MSTAE AND MARAMSTAV, of the change document object. The triggered workflow processes the change document object and gets the details of the change. A mail will be sent to Master Data Group with all the details related to the change. If the sales data get changed in Material Master the work item has to got Sales department for approval , If the Account data get changed in Material Master the Work item has to go To FI department for Approval , If the Purchase data get changed in Material Master the Work item has to go To FI department for Approval . 15. VENDOR BLOCK Whenever a vendor master changed the vendor should be blocked and it should be notified to the persons in the purchase organizations dealing with the vendor & all the vendor documents should be blocked from further processing the block should be released based on the approval from the relevant superior purchasing manger & Finance manger dealing purchasing transactions (parallel approval processing ).If not approved the block remains in that particular vendor. To block the Vendor we make use of the transaction (XK05) and also to unblock the document we use the same transaction (XK05). REQUIREMENT: For the above scenario we need to build a workflow that will block the corresponding vendor whenever there is a change is in Vendor master. For the Vendor master (XK05) the change document is KRED and the business object is LFA1.We need to create a subtype of this bus. Object to implement the following methods: Blocking and approval - for blocking as well as to get approve Only approval - for approval only in the subsequent steps Unblocking - for unblocking the Vendor. 78

Dheepak Notes:HR_FBN_GET_USER_EMAIL_ADDRESS :- On giving Sap user name it will return the Mailing address of the user Ex :input :USER_ID dheepak REACTION 0 output :EMAIL_ADDRESS - [email protected]

79

View more...

Comments

Copyright ©2017 KUPDF Inc.
SUPPORT KUPDF