Total Pageviews

Thursday, January 19, 2012

SAP Workflow Debugging

·       Introduction

Upgrading SAP system from one to another version results is some issues. Workflow is one of the object which might be affected due to upgrade. SAP states that workflows normally wont be affected due to upgrade & we do not have to take any pre-requisite steps before upgrade. But there is a possibility of surprise issues. SAP has provided few comprehensive notes wrt SAP Upgrade workflow which one should go through before doing an upgrade. Following are few issues which we encountered while doing an upgrade from 4.6c to ECC 6.0.



Email not delivered in User’s Inbox, Event not triggered, and Trace doesn’t reflect event being triggered etc

Ø      Check whether the BOR object type is linked, Event & the task are linked/activated – Tcode SWE2. Many a times users report issue of Email not received, events not triggered etc. The reason behind such issue is of linkage not being maintained in SWE2.





Event linkage gets deactivated after the workflow is executed once

Ø      If the event linkage is getting deactivated automatically after the workflow is triggered, then goto SWE2 & goto the details of your linkage


Details (Control + Shift + F2)


Change the “Behavior upon Error Feedback” from ‘Deactivation of linkage’ to ‘System defaults’ & save the changes.




How to activate Workflow trace & what is the use of activating it

Ø      In order to check whether the events are triggered properly, you need to activate the Workflow Trace => Tcode SWELS



Click on Switch On.
After the trace is switched on, execute your workflow. The system will capture the trace of all the events , FM’s being called etc.
Once the workflow steps are completed, goto tcode SWEL => To view the workflow trace

Enter the date on selection screen of SWEL & execute


        You will be able to see the log wrt your workflow


Here in the highlighted block, an IDOC is triggered of type IDOCORDCHG ( Order Change) which goes into exception. This event trigger’s the Workflow through FM ‘SWW_WI_CREATE_VIA_EVENT_IBF’ Double click on the line item.


The log is split into 3 :-

Here it provides the details of the EVENT which triggered Workflow. In above case IDOCORDCHG was called which created an IDOC 4330398 & it went to errors because of some issue. So event INPUTERROROCCURRED was triggered.

Here the Workflow details are provided. WF task 90100001 was called through FM SWW_WI_CREATE_VIA_EVENT_IBF. ( This event is specified in the attributes of the task 90100001 in tcode PFTC).




You want to simulate the Workflow triggering event so that you can do the analysis

Ø      To Simulate the Workflow triggering, goto tcode SWUE 


Enter the Object type, Event & click on Object Key. Since our object type is IDOCORDCHG, the object key is nothing but the IDOC number which is reflected in SWEL trace. Enter the IDOC number 4330398


Tick the Trigger receiver FM synch. Check box & click on CREATE EVENT. If the system finds receiver then it will display “Event created, one receiver found”.
Click on Event receiver. It will display the details along with the status. Since the event was triggered successfully & the receiver was found, we have the status ‘No errors’ under STATUS column for the above scenario.


In case of errors wrt Event, Receiver type etc, the Status Column would display the details.




You are facing Agent issues after upgrade

Ø      If you have done any change in org. agent assignment it is advisable to refresh the buffer => Tcode SWU_OBUF

Click on Start Synchronization





Workflow analysis
Ø       Tcode SWI1

Enter the date/time &  execute

Select the record & click on ‘Display Workflow Log’.



Click on Agent


Click on Agents :
It will show a list of users to whom the workflow email is sent. Check if they are the intended recipients. If they are not the intended recipients then we will have to check the Rule & Binding in PFTC tcode

Click on Details: This will display whether the Work item is created successfully.


       

The agents are not assigned properly to the workflow task. Many users who are not related are also receiving emails of the workitem. Also users are facing issues in forwarding a workitem.

Ø      Use PFTC tcode to check Rule/Agent assignment  & Binding



Goto Triggering events tab & Click on Binding



Click on Generate automatic binding & SAVE

Goto DEFAULT RULES tab. Delete the existing binding & click on Generate automatic binding. The default rule decides the criteria based on which the agents are to be picked up.

Check whether the agent assignment is done properly:-



If you are not able to forward a work item to another user, goto PFTC => Agent assignment => Maintain. Click on Attributes where you would get above popup. Make sure that you select radio button ‘General task’ or ‘General forwarding allowed’.



Validate Workflow customizing settings after upgrade
Ø      After upgrade check whether the workflow customizing settings are same in old & new system using tcode SWU3



You want to create/modify a agent group/assignment
Ø      To create/modify a agent group/assignment use tcode PPOMW



You want to do Workflow diagnosis
Ø      SWUD tcode is used for Workflow diagnosis. This will help to check the WF customizing settings, WF hanging etc issues.


Enter the Task type & task no. => Hit enter key
You will get a list of different issues/activities. Execute each of the activity & check the details for any discrepancy



The old rule of 4.6c is overwritten by a standard rule in ECC 6.0. Hence the workflow task for which you had assigned the rule is not picking up correct agents
Ø      Current a new custom rule with same details. ECC 6.0 has a different number range for std. & custom objects. So the possibility of old rules being overwritten after upgrade is ruled out post ECC 6.0.
The tcode is PFAC_RULE. Enter the necessary details by referring to your old rule & then assign the new custom rule to the Workflow task which was referring to the old rule.


Issues faced wrt Workflow for a upgrade from 4.6c to ECC 6.0

Workitem missing from users inbox i.e. Workflow emails not delivered to intended recipients
Ø      The issue was because of the custom workflow task being overwritten by standard SAP task in ECC 6.0. We created a new WF task within the customer name range & changed the SWE2 task assignment to the new WF task.
Ø      The org. assignment was refreshed using SWU_OBUF
Ø      The agent assignment in PPOMW was changed from the old task to the new task


User not able to forward the workitem
Ø      The issue was because of the task being defined as ‘General forwarding not allowed’. We changed the attribute to ‘General forwarding allowed’ & ensured that the rules are defined. This is done in PFTC tcode under Additional Data => Agent Assignment => Display.


Workitem was received by user  who were not assigned as agents
Ø      The issue was because of the custom rule created with standard name range. In ECC 6.0 the custom rule was overwritten by standard rule because of which workflow item was sent to all the users. We created a new custom rule with tcode PFAC_RULE within the customer name range & assigned the new custom rule to the workflow task.
Ø      The binding was deleted & regenerated using automatic option for TRIGGERING/TERMINATING/RULE binding in PFTC.

No comments:

Post a Comment