You are on page 1of 35

SAP ABAP Workflow

TROUBLESHOOTING
1

Event Debugging

©La rsen & Toubro Infotech Ltd. Privileged and Confidential 2


Workflow Troubleshooting

▪ Primary Components:
▪ Each workflow consists of several components that are best described by answering following questions:

▪ When Should the workflow start?


▪ Answer to this question assists in event triggering mechanism that starts the workflow

▪ What steps need to occur?


▪ What TASKS (Transactions/Background items need to be performed) need to occur?

▪ Who performs the tasks?


▪ Agent Resolution/determination

▪ As we proceed we will review problem solving and debugging techniques used in each of the
components

©La rsen & Toubro Infotech Ltd. Privileged and Confidential 3


Event Debugging

▪ Event Debugging
▪ Workflows are primarily triggered based on the events generated by applications
▪ Once the baseline configuration is complete we would expect the application to trigger the event that
will start workflow
▪ Most often, issues related to event triggering is “We expected workflow to start but workflow did not
start”
▪ In such case below checks should be done

©La rsen & Toubro Infotech Ltd. Privileged and Confidential 4


Event Debugging

▪ Problem 1 : Workflow not triggered


▪ Turn on the event log in SWELS
▪ Re-execute the application / business document where we expect the workflow to trigger
▪ Display event trace in transaction SWEL

▪ If the event trace shows no receiver was found. This error is typical if the event linkage is not set up or not active in
transaction SWE2
▪ If event linkage is not set to active in SWE2 then set it to active
▪ Re execute the transaction and check the SWEL trace to see if the event was triggered
▪ Other items to check if the issue was not resolved:
▪ SWU3 – Check the workflow engine – make sure all items are configured properly

▪ SWUB – Validate if workflow RFC destination is configured properly. Synchronize the passwords and test the RFC
connection
▪ SM58 – Review the tRFCs that are logged for workflow
▪ SM21 – Check system log for workflow specific errors
▪ ST22 – Check workflow specific short©La rsen & Toubro Infotech Ltd. Privileged and Confidential
dumps 5
Event Debugging

▪ Problem 2 : Required parameter values not passed to the workflow


▪ There are additional parameters that are required to be passed to the workflow but are not being passed from the
event trigger
▪ In such case, debug the event triggering application and look for the event creation Function Modules
▪ Events are created using several FMs like SWE_EVENT_CREATE, SWE_EVENT_CREATE_IN_UPD_TASK and
SWE_EVENT_CREATE_FOR_UPDATE_TASK
▪ If the debugging does not start event after putting the breakpoint in these Function modules, then its possible that
the FM is called in update task
▪ Enable the update debugging and re execute the application
▪ Once the breakpoint is reached, you can review the container elements passed to the parameter
EVENT_CONTAINER of the FM

©La rsen & Toubro Infotech Ltd. Privileged and Confidential 6


Event Debugging

▪ Problem 2 : Resolution by reviewing the event parameters


▪ Sometimes its not required to do the debugging of the exact portion of code that triggers events
▪ We can review the event container parameters through work item display transaction SWI1
▪ Execute SWI1 by providing date/time and other selection parameters
▪ Locate the work item having issue
▪ Display the workflow log for this item
▪ Display the workflow container and review the parameters passed from event

▪ If any of the parameters are missing then go to the workflow definition and check the binding
between event and workflow

©La rsen & Toubro Infotech Ltd. Privileged and Confidential 7


Event Debugging

▪ Problem 2 : Resolution by reviewing the event parameters


▪ Most often custom workflow event parameter binding issues are a result of incorrect binding from
the event to the workflow task
▪ Verify binding in the workflow template

©La rsen & Toubro Infotech Ltd. Privileged and Confidential 8


2

Agent Resolution
Debugging

©La rsen & Toubro Infotech Ltd. Privileged and Confidential 9


Agent Resolution Debugging

▪ Problem 3: A workflow work item is created but it is not assigned to any agent
▪ Review the workflow log from SWI1
▪ Review the log and check if its in status error
▪ You can view the error log and select the error message

▪ Clicking on the long text icon would should the detailed error log

©La rsen & Toubro Infotech Ltd. Privileged and Confidential 10


Agent Resolution Debugging

▪ Problem 3: A workflow work item is created but it is not assigned to any agent
▪ Agent resolution can be defined the workflow step level, however any resolution defined at this level is superseded
if the agent resolution is defined at the task level

▪ Double click the task and select the default role tab. Here you may find a standard rule defined like in the e.g. below

©La rsen & Toubro Infotech Ltd. Privileged and Confidential 11


Agent Resolution Debugging

▪ Problem 3: A workflow work item is created but it is not assigned to any agent
▪ We need to check why an error is occurring in this rule for agent determination
▪ Double click the standard rule and launch the PFAC transaction

▪ Review the function module for rule determination


▪ We can place the breakpoint in this FM for debugging
▪ Run the workflow through transaction SWUS and fill the container elements as they are in the work item in SWI1

©La rsen & Toubro Infotech Ltd. Privileged and Confidential 12


Agent Resolution Debugging

▪ Problem 3: A workflow work item is created but it is not assigned to any agent
▪ On execution in SWUS, the processing would halt at the break point set up in rule function module and you can start
the debugging
▪ Further in debugging if we find that the below FM is returning the exception then we need to verify the possible
agent assignment at the task level

©La rsen & Toubro Infotech Ltd. Privileged and Confidential 13


Agent Resolution Debugging

▪ Problem 3: A workflow work item is created but it is not assigned to any agent
▪ Open the task in PFTC
▪ Go to menu Additional Data > Agent Assignment > Maintain >

▪ Select the line and click on Attributes

▪ If the attributes are shown like above then possibility is that the responsible agent does not belong to this group of
possible agents. As the task is not classified as General, we need to define the possible agents

©La rsen & Toubro Infotech Ltd. Privileged and Confidential 14


Agent Resolution Debugging

▪ Problem 3: A workflow work item is created but it is not assigned to any agent
▪ One option is to create org structure, position and assign a user to the position
▪ Then assign the task to the position
▪ Second option is to make the task as general so it can be executed by anybody
▪ Re xecute SWUS after making one of the above change.
▪ This time the agent should get assigned as expected

©La rsen & Toubro Infotech Ltd. Privileged and Confidential 15


3

Workflow Task
Debugging

©La rsen & Toubro Infotech Ltd. Privileged and Confidential 16


Workflow Tasks

▪ The code for the single step task is written in the methods assigned to the objects in business object
repository

▪ Its often necessary to debug the method code to resolve workflow issues

▪ Dialog Task Debugging:


▪ Identify the dialog task in the workflow template and double click on it

▪ Double click on the method to launch the BOR of the method

©La rsen & Toubro Infotech Ltd. Privileged and Confidential 17


Workflow Tasks

▪ Click the program button to launch the code for this method.

▪ Place a break point inside this method.

▪ To test we will use workflow test transaction SWUS and the existing business document data that can
be accessed through SWI1 for the existing work item

©La rsen & Toubro Infotech Ltd. Privileged and Confidential 18


▪ On execution method code is available for debugging
Workflow Tasks

▪ Background Task Debugging:

▪ Special consideration is required for background task because any break points in the code DO NO
cause the task to stop and wait for the user to debug

▪ Double click on the step in the process flow diagram to launch the step details screen

©La rsen & Toubro Infotech Ltd. Privileged and Confidential 19


Workflow Tasks

▪ Background Task Debugging:

©La rsen & Toubro Infotech Ltd. Privileged and Confidential 20


Workflow Tasks

▪ Background Task Debugging:

©La rsen & Toubro Infotech Ltd. Privileged and Confidential 21


Workflow Tasks

▪ Background Task Debugging:

▪ After placing the break point go back to the previous screen and pull up the method attributes

©La rsen & Toubro Infotech Ltd. Privileged and Confidential 22


Workflow Tasks

▪ Background Task Debugging:

▪ On return to the task description, the task attribute would have changed

©La rsen & Toubro Infotech Ltd. Privileged and Confidential 23


Workflow Tasks

▪ Background Task Debugging:

▪ You can now re execute the application and workflow will stop at this task

▪ We can go to the work item overview transaction SWI1

▪ On the workflow log go to this task and go to the technical log for it

©La rsen & Toubro Infotech Ltd. Privileged and Confidential 24


Workflow Tasks
▪ Background Task Debugging:

▪ You can now re execute the application and workflow will stop at this task

▪ We can go to the work item overview transaction SWI1

▪ On the workflow log go to this task and go to the technical log for it

▪ Here you can click on execute button to execute the task

▪ On execution you will get a debugger opened for the background method associated with the task

▪ After you have finished debugging the method, make sure to change the attributes of the method back
to the background and then regenerate the workflow via PFTC

©La rsen & Toubro Infotech Ltd. Privileged and Confidential 25


4

Important Transactions

©La rsen & Toubro Infotech Ltd. Privileged and Confidential 26


Important Transactions

©La rsen & Toubro Infotech Ltd. Privileged and Confidential 27


Important Transactions

©La rsen & Toubro Infotech Ltd. Privileged and Confidential 28


Important Transactions

©La rsen & Toubro Infotech Ltd. Privileged and Confidential 29


Important Transactions

©La rsen & Toubro Infotech Ltd. Privileged and Confidential 30


Important Transactions

SWI6 (Display Workflows)


– Allows you to display the workflows triggered for given business object type
and object key
SWIA (Process WI as administrator)
- Allows you to execute the Work items without checks and forward them to other agents
SWI5 (Workload analysis)
- Allows you to check another user’s inbox
©La rsen & Toubro Infotech Ltd. Privileged and Confidential 31
5

Case Study

©La rsen & Toubro Infotech Ltd. Privileged and Confidential 32


Case Study

▪ Create simple workflow with decision step. Add email sending steps on approval / rejection
▪ Hardcode user or
▪ Create table and select using rules

▪ Create workflow whenever material is created in system and send information to a specific
user for approval (hardcode or use rule to determine approver). On approval or rejection
send email notification to material creator.

▪ PO change workflow
▪ Condition 1: The workflow should trigger on PO change.
▪ Condition 2: The PO type should be NB <standard type>.
▪ Condition 3: If the PO changer and the PO creator are different then, send a mail to PO creator with
the subject line as follows:<PO number> is changed by <PO changer>
▪ Condition 4: If the PO creator does not check the mail in 10 minutes, send a Reminder Mail.

©La rsen & Toubro Infotech Ltd. Privileged and Confidential 33


Case Study

▪ Create leave application and that should go for approval to superior. Send email notification
on approval or rejection to applicant

▪ PR release workflow.
▪ Work with MM functional to configure release strategy in L&T server
▪ Copy standard workflow
▪ Add email sending step after each approval/rejection step and send notification to PR created user

▪ PO release workflow
▪ Work with MM functional to configure release strategy in L&T server
▪ Copy standard workflow
▪ Add email sending step after each approval/rejection step and send notification to PR created user

▪ Create PR that should go for approval. After approval create PO automatically (use any
default vendor) and send mail to user who created that PR

▪ Create Quotation and should go for approval. After approval create SO automatically (use
any default customer) and send mail to user who created that PR

©La rsen & Toubro Infotech Ltd. Privileged and Confidential 34

You might also like