Begin by browsing for the batch application within the Object Browser, and double click the version to add it to the Application View. For our example, it will be the version for “R55ADOBJ” – “R55DEBUG|VER0001”.
You can then navigate through the batch application in the Application view, to identify the Event Rules in a specific section to debug. This will load the event rules within the debug window. For our example, it will be “Driver” Section, and double click “Do Section”.
Within the debug window, we can double click on a specific line to insert a breakpoint. We can add as many breakpoints as needed within the code. A breakpoint will stop the execution of the script at the specific point or points you have marked, such that you can monitor the values of the variables that you have selected in the Variables view. For our example, we will add the breakpoint at two points:
- “Parse Text String” – First appearance “Fetch Next Line from Flat File” – Second appearance
Furthermore, you will notice that the breakpoints you added will be displayed in the Breakpoints View for easy navigation.
In the Variables View, expand ER Variables and select specific Variables to monitor. Furthermore, this also exposes all the system values and variables, if needed. For our example, we will:
- Expand “ER Variables”
- Add “VA rpt_szStringValue”
- Add “VA rpt_szStringValue_2”
- Add “VA rpt_szStringValue_3”
- In Applications View, Expand “Print” Section, Select “DO” Section
- In Variables View, Expand “Report Variables”
- Add “RV String Value_1”
- Add “RV String Value_2”
Our batch application is now ready for testing. For the purposes of the brevity, I will not detail the steps to execute the application locally. But upon execution of the batch application, we will focus on the ER Debugger due to the breakpoints we have set, and the values of the variables will update. At this point, we have a few options.
- [F9] – We can execute one line at a time
- [F5] – We can execute the code until it reaches the next breakpoint
- [F10] – We can execute into a specific business function to fully understand what’s going on
To resolve our sample issue, we will execute until we reach the next breakpoint and the problem becomes clear.
Once the version is executed, we can then switch to the debugger to control the flow. The script will stop at the first breakpoint set. Press F5 once to execute again. It will stop at the next breakpoint and update the variable values. We can see that the string value is parsed, however the second value is not stored in the variable. Continue executing until the report executes and you’ll notice that only the first string value is reported, not the second.