SAP Debugging Tutorial
SAP Debugging Tutorial
3 ways!
If the program that you want to debug is not editable / can only be presented in display mode / has a blue
back-ground, one may use this “STOP” / break-point button.
For example: We are going to set up break-points upon execution of a selection, and on the turn of calling a SAP
standard function module.
Position your cursor on the line where you’d like to set a break-point at and click the break-point button (shown
above). For this example, the cursor was positioned at the line “START-OF-SELECTION” and the break-point button
was pressed. The same was done for the line containing the words “CALL FUNCTION
‘TRCA_COMPANYCODE_GETDETAIL’ “. Break-points are now represented as highlighted points in the program as
shown in this picture.
Another way of doing so is by inserting a “break-point.” command in the program like this:
The
least popular way of setting or deleting break-points is by going though this:
Utilities > Breakpoints > Set/Delete. ( Ctrl+Shift+F12 )
For “typed” break-point commands, simply erase by backspace or delete the “break-point.” command. For highlighted
break-points, just position the cursor on that line and press the break-point button again from the toolbar, or one may
even go to the utilities part in the menu bar.
Okay, at this point, s_bukrs-low s_rfha-low and the rest of the field names
on the lefts side have no value yet. Once the abap debugger arrow proceeds to the next line, s_bukrs-low will have
the value of p_bukrs ( in this example is Company Code 1058 ).
Observe. (processed by single step or F5)
From this point, pressing F7 will forward you to the next break-point.
Now, since we’re about to process a SAP standard function
module, we have a choice to skip this part and proceed to the rest of the program (by pressing F6), or continue
viewing the process of this function module (by pressing F5).
Note: if by anytime you want to skip the debugging mode, just press F8.
Pressing F5 you’ll have a view of a SAP standard function module processing, notice the main program and source
code.
Notice that there are other tabs beside “Field” in the debugger.
Herein are the contents of the internal table t_ftr. One may manipulate
the current view of the data by choosing the fields he/she wishes to see, but this doesn’t change the actual structure
of the internal table.
The encircled portion on the bottom right expands the table upwards (if one’s having difficulty looking at an internal
table with many line items).
If one wishes to see the other fields in the table, simply press Shift+F7 to scroll to the right or Shift+F6 to scroll to the
fields on the left. Press Shift+F5 to go back to the original view.
If one doesn’t want to continue processing the program, go to: Debugging>Exit (Shift+F3).
IMPORTANT:!!!
Never forget to delete your break-points after you’ve finalized your program :D