Today I want to share something that can be useful for ABAPER when you have to debug a program, sometimes it’s necessary to manipulate certain values while we debug a program, using ABAP debugging tool now we can do just that! We can actually change the values of a parameter of a data column while the program is on the debug mode.
Below I just created a sample code for our debugging purpose. In the code below you will see 3 variables, the first two variables have a values of 5 and 10, the result will be passed onto the third variable (v_C)
Z_REPORT_DEBUG.
data:
v_a type i VALUE 5,
v_b type i VALUE 10,
v_c type i.
v_a type i VALUE 5,
v_b type i VALUE 10,
v_c type i.
v_c = v_a + v_b.
WRITE v_c.
Now set the break point on the v_c = v_a + v_b line. (see picture below).
Run the program (F8). Now you will be entering the debugging mode and stopping at your breakpoint line.
Now double click each variable v_a and a_b until you see the value of each variable on the right pane. As you can see below, the value of v_A = 5 and V_B = 10, so let’s change v_B into 20.
To change the variable’s value, double click the pencil button on the side of the value. Enter 20 in the val box and press enter until the box has turned gray again.
Okay, now press F8 to resume the program. You will see that the value now is 25 as the result from adding 20 and 5.
Post a Comment