You create or maintain a process by transaction PEST; A simple example which will be used throughout this article is the following:
In this model, the unique root node is the German payroll driver RPCALCD0. It constitutes the first step of this process model. In the second and third step, payslips are printed by the RPCEDTD0, and payroll accounts are generated by the RPCKTOD0. In other words, the node "Payroll" has two children, namely the nodes for RPCEDTD0 and RPCKTOD0, respectively. One also says that these two nodes have the "Payroll" node as a parent. Note that an e-mail notification will be sent after the execution of RPCEDTD0. This is indicated by the symbol in the upper right corner of the corresponding box. Associated with this model is the selection program H99_SELECT_PERNR.
A process model is executed via the HR Process Workbench which can be called by transaction PUST. The following diagram illustrates the program flow of a process in its simplest form:
With transaction SWEL you can monitor all events that have been raised by a process model. In our example the event trace looks as follows:
After these preparations, we are now in a position to collect some hints how to debug the above steps of a process model.
- How to debug the selection program:
From now on, we assume throughout that a process has already been carried out by transaction PUST.
- How to debug the reports along with their variants used during a process:
- In transaction PUST, right-click on the number of the process you want to analyze. Go to "Display additional information" and keep in mind the starting time of this process.
- Start transaction SM37. Enter WF-BATCH as user name and choose the time appropriately around the starting time of the process. You obtain a list containing the jobs executed during the process. If you want to debug one of this jobs, mark the job in question, enter JDBG in the command field, and press Enter.
- How to debug a single step of a process:
- Set a breakpoint in method DETERMINE_SUPPLIED_OBJECTS of class CL_HR_PM_PW_PROCESS_PROG at line 47 for the command CALL METHOD me->modify_parcel_objects.
- Go to transaction SE37, choose HRPY_PROCESS_WORK_ON_EVENT as function module, and press F8 (Test/Execute).
- In the following screen click on "Debugging".
- Press "Save" on the two upcoming pop-ups without entering anything.
- Press F7. After that, you are at the coding of HRPY_PROCESS_WORK_ON_EVENT.
- Press F6.
- Change the values of the variables H52SPS-PROCESSID, H52SPS-STEPID, EVT_NAME, P_CONT as follows:
H52SPS-PROCESSID process number from transaction PUST H52SPS-PROCESSID 0000000001 for the first step, 0000000002 for the second step, etc. EVT_NAME JOB_STARTED P_CONT X - At the breakpoint jump to the next statement by putting the cursor on the next statement in line 51 and choose "Goto Statement" in the "Debugger" menu. (Otherwise, the system recognizes that this step has already been performed and proceeds in a different way.)
- Note that the job generated by the function module is no longer planned by user WF-BATCH, but by the user who started the function module.
- How to debug all children of a process step. This also enables you to monitor how the STEP_ENDED event is raised:
- Proceed similarly as for the first step, but at point 7. choose the appropriate values for the parent node:
H52SPS-PROCESSID process number from transaction PUST H52SPS-STEPID the step ID of the parent node H52SPS-RUNID the run ID of a finished run of the parent node from transaction PUST, e.g. 0000000001 for the first run H52SPS-PARAID e.g. 000001 EVT_NAME JOB_ENDED P_CONT X
- Proceed similarly as for the first step, but at point 7. choose the appropriate values for the parent node:
- How to debug the communication such as e-mail notifications after a step has ended:
- Go to transaction SE37, choose HRPY_PROCESS_COMMUNI_ON_EVENT as function module, and press F8 (Test/Execute).
- In the following screen click on "Debugging".
- Press "Save" on the two upcoming pop-ups without entering anything.
- Press F6.
- Change the values of the variables H52SPS-PROCESSID, H52SPS-STEPID, EVT_NAME, P_CONT as follows:
H52SPS-PROCESSID process number from transaction PUST H52SPS-STEPID step ID from PUST for the step you want to monitor, e.g. 0000000001