cancel
Showing results for 
Search instead for 
Did you mean: 

abap debugger

Former Member
0 Kudos

can somebody explain the process of abap debugging

thanks

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi Varada Rajan,

ABAP DEBUGGING:

First test your code with '/h' type in command window which shall take you to debug or by putting break points with F8. You test your program from code and then go to se30 performance analysis transaction and there you can know what are the drawbacks. Then go to SLIN transaction and do extended syntax check or from code in menu options where you have debugging -> extended check and the program id ready without error.

As mentioned above after doing syntax check and extended syntax check you have to create a TEST PLAN. You have to test all possible Positive & Negative test cases.

Test for division by zero if it involves calculation or code accordingly.

Try to test for field overflows. If it involves sap script or smart forms try to print outputs which have single page and also multiple page and which does not have any output at all.

Test by leaving all parameters in selection screen blank.

Test by entering wrong values in selection screen and display a pop-up if the user enters wrong selection screen values.

You can also do ABAP trace and SQL trace to make sure that your program is efficient.

Debugging code/program.

As mentioned above type /h in command line and try to execute the program. Another way is to set break-point at the function module or the required line and do single step execute or execute. Once you finished debugging, you can select Delete to clear all the break points.

Third option in certain cases is to check for sy-subrc <> 0 and proceed from there by making it 0 by updating the sy-subrc in the debug editor and see how the program behaves if the value is what you enterd in the debug screen. For certain case try to use WATCH POINT feature in debug editor.

Debugging Program with ABAP Debugger

Activate the Debugger before executing your ABAP program

System -> Utilities -> Debug ABAP/4

The purpose of the debugger is to allow you to execute your program line by line. It also allow you display the data as you execute the program. (double click on the varaible field name and it will be display)

or after program have been executed,

Run transaction SM66 and find your work process.

Select the line of your work process and double click on it

Click the debugging option.

If this is a custom program, you can put a wait statement in the code to buy yourself some time.

-


1) To understand the Watchpoint, you have to play with it.

a) Debug your program.

b) Place your cursor on the field you want to watch

c) Press Shift+F8, or click the Create Watchpoint button

d) Select the LOCAL WATCHPOINT checkbox if you want the watchpoint to be active for the immediate program only (and not includes etc. By default, you want to leave this unchecked).

e) Drop down on the relational operator, and choose one. They are self-explanatory. (For this example, use '=')

f) Select the COMPARISON FIELD checkbox if you want to check the field against another field, else leave unchecked if you want to check your field against a static value.

g) Enter your comparison field (if you checked the previous box) or your check value in the last box. Once your selected field equals the selected value, the program will break as if a breakpoint was reached. It is possible that the program never breaks, meaning your watchpoint criteria was never satisfied (For example if you check Itab-Field = VALUEA, if Itab-field never have a value equal to VALUEA the program will NOT break.)

2) I use SQL Trace is used for analysis, then based on the information retrieved I do manual tuning.

Sam Hearn - Business Analyst

-


I have another tip for 1 which is very handy (I've been using it for several months).

1. Create and save a file name AbapDebugParaPopUps.ini with the following contents using Notepad:

[System]

Name=MLP

Client=001

Description=MLP

[User]

Name=D000328

Language=D

Password=

[Function]

Command=/h

Title=/h in Popup aktivierbar

Type=SystemCommand

2. Add a link to it in the start menu of windows (or in a place of your desk accesible from a modal window)

3. Whenever you need to debug a modal window in abap, you just drag and drop the file onto the modal window and press enter or a function code that completes the screen. After that you'll enter in debug mode. <<AbapDebugparaPopUps.ini>>

Please Reward If Really Helpful,

Thanks and Regards,

Sateesh.Kandula

Former Member
0 Kudos

Classic debugger is the one used earlier for older versions. now there is a new one. These are user friendly when you point on an icon will give you the info or else you can click and check them functionality in a test program. These are user friendly.

if you go to utilities -> settings and the debugging tab you will see these two options. you can toggle between them and check the difference and the look and feel.

check these...

ABAP DEBUGGING

<u>http://help.sap.com/saphelp_webas620/helpdata/en/c6/617ca9e68c11d2b2ab080009b43351/content.htm</u>

<u>https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/9cbb7716-0a01-0010-58b1-a2ddd8361ac0</u>

Debug Program scheduled Background

<u>

3 types update,normal and system debugging

check this for update debugging

If you set "Update Debbugging" you can debug the codes which works in update tusk.

SAP std often runs the routine (function or form) to update the database in update tusk mode, these routine start as soon as a commit work is done.

The commit is called at the end of the program, so you can't debug them by "normal debbugging" because it ends as soon as the program ends

or----


All the database updates are performed by the update work processes by calling the functions/subroutines in update tasks.

These tasks are executed after a commit work is reached in the application. By default you cannot debug these functions.

TO debug these u need to explicitly activate update debugging.

for system debugging check the below link

<u>http://help.sap.com/saphelp_nw2004s/helpdata/en/ef/5f0640555ae369e10000000a155106/content.htm</u>

<u>http://help.sap.com/saphelp_47x200/helpdata/en/c6/617ca9e68c11d2b2ab080009b43351/frameset.htm</u>

For debugging tutorial:

<u>http://help.sap.com/saphelp_erp2005vp/helpdata/en/5a/4ed93f130f9215e10000000a155106/frameset.htm</u>

http://www.sapdevelopment.co.uk/tips/debug/debughome.htm

http://www.sap-basis-abap.com/sapab002.htm

System Debugging

If you set this option, the Debugger is also activated for system programs (programs with status S in their program attributes). When you save breakpoints, the System Debugging setting is also saved.

Update Debugging

Update function modules do not run in the same user session as the program that is currently running in the ABAP Debugger. These function modules are therefore not included in debugging. Only if you select the Update Debugging option can you display and debug them after the COMMIT WORK.

Normal Debugging

Normal debugging is the one we do it by the normal dynamic break points or by /H or by using stattic break points.

You can switch to diffferent debuggin modes while processing.

BREAKPOINT

In the source code we set the Break-point there by clicking the stop button, the system will stop there when you execute the program.

Watchpoint

For watchpoints, we need to give some condition and when this condition is satisfied, program will stop

example : if you want to debug only

for matnr value 100 than set watch point

matnr = 100. when value reaches 100 than

program stops at that point.

more at

http://help.sap.com/saphelp_nw04/helpdata/en/c6/617cdce68c11d2b2ab080009b43351/content.htm

check these documents as well

https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/abap/abap-runtime-...

https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/media/uuid/f720ea47-0801-0010-f7a3-bd37d...