It is always said that testing workflow is a difficult job. It will more difficult when the WF task is a background task. Because only putting a breakpoint in the background task method will not go in debugging.
Debug in WF means we are debugging some code in the BO-method or Class-method that is assigned to some WF task.
You can follow the below steps to debug a background task.
- Put a break point inside your BO-method. (Write the sample code DO.. ENDDO to make it infinite loop so that an entry get created in SM50)
- Execute your WF.
- Go to SM50.
- Select the particular record.
(You can see the BO name as Report and WF-BATCH as User Name)
- Program/Session – Program – Debugging
- Assign LV_FLG = ‘X’ so that you can exit from the infinite loop.
Note: Basically the background task escapes all the break point.
Here we have done with a infinite loop (DO.. ENDDO) and the same will appear in SM50 (process overview) with Running status. From there (SM50) you can now able to debug the code in foreground.
Tuesday, 18 February 2014
Step by Step SAP Business Workflow implementation
Here we are going to build a simple end to end workflow.
We will trigger our workflow whenever a record will be created in the custom table.
A mail will be send when the workflow will be triggered.
Create a table:
Write code in the create event:
Call the FM SAP_WAPI_CREATE_EVENT to trigger the event.
Need to pass three parameters:
- Object Type (Business object name)
- Event (Event in the business object)
- Object key
Create Business Object:
Create Event:
Edit -> Change Release Status -> Object Type -> To implemented
Edit -> Change Release Status -> Object Type -> To released
Generate:
SWDD:
Binding and activate the Start Event:
Agent Assignment:
Create a mail step:
TEST:
Create a record in the table:
Check inbox (SBWP) :
No comments:
Post a Comment