Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

How to Debug an ABAP Program

Former Member
0 Kudos

Hi Friends,

I am new to ABAP.

Can anyone of you let me how to debug an ABAP program in detail.

I would like to know whether my logic is working properly and see the field values during debugging.

If any one of you have an How to document which speaks about debugging, pls send it to id, dmv_79@yahoo.com

Points will be assigned all to helpfull answers.

Thanks

mv_d

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi,

Refer to the below link

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

Reward points if useful.

Regards,

Atish

10 REPLIES 10

sastry_gunturi
Active Participant
0 Kudos

Go to SE38... give the program name

and click debugging

If your program has a selection screen...

in the command bar hit /h to switch debugging on.

Hope this helps

Former Member
0 Kudos

Hi,

Refer to the below link

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

Reward points if useful.

Regards,

Atish

gopi_narendra
Active Contributor

Former Member
0 Kudos

Set break point and use /h session

Former Member
0 Kudos

<b>Debugging Program with ABAP Debugger</b>

<b>Activate the Debugger before executing your ABAP program</b>

<b>System -> Utilities -> Debug ABAP/4</b>

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.)

reward points if it sis usefull.....

Girish

Former Member
0 Kudos

Hi,

go to se38->give ur program name-.execute->give /h at command prompt->execute->now debugging will start->

f5-used for line by line debugging

f6-used for directly executing function modules or performs i.e. control won't go into that block.

f7-run to cursor

f8-direct executing.

fileds: here we can check fild values.

click fileds option and double click on the filed or type the filen name beside filed

tables : here we can check the data in the internal table.

click tables option and double click on the internal table.

Break points:

if you want to debug a particulr part you can use this.

place the cursor at any perform click breakpoint or double click on that line.it will be set.

if /h from report statement it will debug,so for debugging from particular point we will use break points.use f7 to traverse between multiple break points.

Watch-points: In some cases we need to check the data populated in the internal table for eample if we want to check the data of internal table record belongs to 100th vendor we will create watch point for this goto->breakpoints->create watch points->give filed itab-lifnr->=->100.

debugging procedure:

Use '/H' in the command line and execute the report/program, so that it goes to debugging mode

2. keep a hard coded break point in the code like BREAK-POINT and it stops there.

3.From the program Menu, Keep the Soft Break-points and do the debugging.

see the links

Refer to this thread

http://help.sap.com/saphelp_47x200/helpdata/en/c6/617ca9e68c11d2b2ab080009b43351/content.htm

http://www.sappro.com/downloads/Settings&SystemAreas.pdf

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

https://forums.sdn.sap.com/click.jspa?searchID=2673672&messageID=3187106

https://forums.sdn.sap.com/click.jspa?searchID=2673672&messageID=850453

https://forums.sdn.sap.com/click.jspa?searchID=2673672&messageID=1546485

https://forums.sdn.sap.com/click.jspa?searchID=2673628&messageID=2048883

http://www.saplinks.net/index.php?option=com_content&task=view&id=24&Itemid=34

http://www.sap-img.com/abap/testing-and-debugging-abap-codes-functions.htm

Regards,

Priyanka.

Wil_Wilstroth
Active Participant
0 Kudos

Hi mv_d,

Here is my own how-to-debug which i had created in my own blog intend to help anyone who needs it.

<a href="http://http://isskythelimittechnical.blogspot.com/2006/09/sap-r3-debugging-and-using-breakpoint.html">How to debug</a>

I hope it helps you.

Regards,

William Wilstroth

William Wilstroth

0 Kudos

Hi mv_d,

It is not good to ask contributors to send document to a poster's email as it is not sharing with other people on solution related to your question.

Try not to practice by asking people to send solution to your personel email. Everyone is here to learn and share knowledge.

On the link, i have corrected it and also sharing it with everyone:

<a href="http://isskythelimittechnical.blogspot.com/2006/09/sap-r3-debugging-and-using-breakpoint.html">how to debug</a>

Thanks and regards,

William Wilstroth

William Wilstroth

Former Member
0 Kudos

Hi,

The Debugger is a programming tool that you can use to execute ABAP programs, by line or by section. With this tool, you can display data objects and check the flow logic of programs.

Two types of debugging are currently possible: Debugging with the classic Debugger for release levels up to and including 6.40 or debugging with the new Debugger, which is available for all releases after 6.40. The main differences between the classic and the new ABAP Debuggers are described below:

The Classic ABAP Debugger

runs in the same roll area as the application to be analyzed (debuggee). It is therefore displayed in the same window as the application. However, this technology also has some restrictions. For example, some ABAP programs (such as conversion exist) cannot be analyzed in debug mode for technical reasons. However, the most significant restriction is that no ABAP technology can be used for designing the Debugger interface and it is therefore not possible to create a modern user interface.

The New ABAP Debugger

, on the other hand, is executed in a separate external session (Debugger), while the application to be analyzed (debuggee) uses a second external session. With this technology, the user interface of the Debugger can be designed freely by ABAP means.
The new Debugger provides the user with a flexible interface that can be configured as required and has more than eight desktops. Here it is possible to place and arrange up to four tools - depending on the user's selection. For example, it is possible to display source texts or structures. In this way, the user can design the Debugger interface according to his own individual requirements.

As of Release 6.40, you can select the debugging type as you wish by choosing the classic Debugger or the new Debugger in the ABAP Editor from the path Utilities ® Settings. It is also possible to switch the Debugger at any time during a session under the menu option Debugging.

Regards,
Kavitha.

Reward Points if helpful.

Former Member
0 Kudos

Hi William ,

The link which you have specified is not working.

Pls send me the document to my mail id dmv_79@yahoo.com

Thanks

mv_d