Beruflich Dokumente
Kultur Dokumente
Attachments:10
Added by Guest, last edited by Alon Mizrahi on Nov 01, 2011 (view change)
show comment
Go to start of metadata
Workflow Troubleshooting and Debugging
Introduction:As business requirement are mapped into a Workflow process definition. DEBUGGING becomes an essential tool to
expedite the implementation of WF process.
But before that user should be familiar with basic WF configuration and development.
Like what is WF type : 'TS' for Single step task and 'WS' for Multistep task
Since WF has many different elements, starting the debugger is not as straight forward as with a standalone ABAP program.
Each WF consists of several components: Event, Task, Method, Rule.
*When should WF starts?
*What TASKS need to occur?
*Who performs the Tasks?
We have to pass the data from one container to another. If we are having problem in any of the container then it will give you
wrong result.
So we have to be careful while doing binding.
EVENT
TASK <->
METHOD
For Material Change Tn MM02Then we have to find out the Business Object and Event name corresponding to
the application program.
There are two ways:
1. Tx BAPI---It will give the business Object name. Like
Use change document to trigger a Event. For change document you can use SCDO Tx.
Here we can create and easily find out the required Change document for our application.
After triggering your event if Event trace shows 'no event receiver found'.
This error is typical if the event linkage is not set up or not active in tx SWE2/SWETYPV . By Reviewing SWE2 we notice
that the type linkage was not set to active.
To resolve the issue activate the event linkage and be sure to save the entries.
Or
Click on new entries tab in SWE2/SWETYPV. And fill all the details:
Object type, Event, Receiver type(Workflow no.),Receiver function Module. And mark the check box Linkage Activated.
If you execute transcation SWEL , after your application program execution then it will show the event trace in SWEL.
NOTE:
1. In Production, you can have the event log(SWELS) turned ON. But you are advised not to leave it ON for an extended
period of time,
as every event that occurs in the system, whether linked to a workflow or not, is logged in this file, and this can overburden
the database system.
2. Ideally in Production environment if WF did not start when it should have ,we would want to manually start it.
We can do this by using tn SWUE (create event) or SWUS (start WF).
Event Triggering With SWUE :- CREATE EVENT
You will probably need to test whether a workflow will be triggered by the event without always having to go through the
business process of creating a new object instance every time.
For these purposes, you can use the test tool SWUE to create the event.
After that you fill all the details in SWUE like BO, Event name. Then enter the object key, and click on the 'Trigger Receiver
FM Synchr' flag, then push the 'Create Event' button.
This screen shows you the event and the receiver when a breakpoint has not been set. It can be a quick test to see that the
workflow will be triggered.
But, if you can't tell why your workflow is not triggered, you will need to go a little deeper.
Go to SE37 and set a breakpoint in the receiverFM, checkFM, or receiver type FM that is being called.
Back out and go into SWUE and fill out the prerequisite key. Remember to check 'trigger receiver FM synchr'. When you
push 'Create Event',
you get into your function module at your breakpoint, and you will have the necessary parameters and object elements to
proceed with debugging your FM.
Tips:
What is Check FM or Receiver Type FM ?
A check function module can be used to simply abend if the object does not meet the
criteria for your workflow (i.e.: It's not the correct document type)
A receiver type FM can be used to dynamically determine which of a number
of workflows should be called based on object attributes (much more efficient than
many check FMs!)
This function module will determine which of several workflows will be called when this event is triggered.
If you drill down on the event, and you see the receiver FM SWW_WI_CREATE_VIA_EVENT, and no receiver TYPE FM,
then it is reasonable to assume that the workflow (identified by 'receiver') is going to be triggered by this event.
3. SWU0 Tx: EVENT SIMULATION
The Event simulator is a quick way to tell if your workflow is a candidate for
starting. It can also tell you what other workflows may (or may not) be linked
to the event.
You must examine the individual statuses of the workflows to determine the
cause for the problem. This tool is a very informative overview of what could
happen if this event were to be triggered.
Just push 'Instance' and fill in the values with a document you have already created.
After you push 'instance' you should get a pop-up screen where you can enter the key values for the object.
The BOB will display all the attributes for that object. This enables you to quickly view whether the values are as you
expected.
The circling arrows icon will indicate which attributes are virtual attributes.
The pretty green and yellow ring indicates that this attribute is also an object reference in its own right.
If you scroll down on this page, you will also see all the methods which are linked to that object.
Testing methods - push the go button for the method you are interested in. Remember, at this point,
you would have set the breakpoint in the method code, turned the debugger on, and filled in the object key for an
instance to be worked on.
Don't forget to push the Debugging Button. You will be brought into the ABAP code behind the method.
From here, you can step through the code, much as you would any other ABAP program. There are some
differences though.
Suppose You executed this Method Zmam which is used for addition of two numbers num1 and num2.
The result is being stored in num3.Then after debugging the final screen will show you the result.
You may need to fill in some elements manually. Watch to see if you get a Sy-SUBRC =8 after any macro call. Some of
them, for instance,
SWC_GET_ELEMENT CONTAINER 'ReleaseCode' PRELEASECODE.
Will not be able to get the value, as the BOB does not have the context of the workflow to derive container values from.
Simply fill these in as you go along.
TIPS: Debugging a background Workflow Process: