Application Development and Automation 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: 
Read only

Debugging

Former Member
0 Likes
1,103

Hi everybody,

Can anybody send me the detailed step by step process in explanation on debugging. It will be helpfull for me if anybody send me the details regarding this topic.I will reward you if any body do this favour to me .

my id is sundeepsap@yahoo.co.in

waiting for reply.

Thanks,

Sundeep.

7 REPLIES 7
Read only

Former Member
0 Likes
961

Hello Sundeep,

How do I debug background Processes?

In transaction SM50 (process overview), you can select a background process and choose Program/Mode -> Program -> Debugging from the menu.

An alternative workaround, which allows you to step into a particular piece of code is to place a piece of code in a endless DO-ENDDO, where you can change a variable to step out of the DO at a particular point in your code. This allows you to hold the process at that point and debug it from SM50 as described above. An implementation of this exists in function module C160_HOLD_FOR_DEBUG, which will enter the endless loop if a particular environment variable is set, thereby allowing you to control its behaviour. (Further instructions are found in the comments in subroutine INC14Z_HOLD_FOR_DEBUG of include LC14ZFCB).

How do I debug completed background process?

You can do this only after the job has finished execution. This will simulate the exact background scenario with the same selection screen values as used in the job and sy-batch set to 'X'.

Use SM37 to get list of jobs , type 'JDBG' in the command line ( no '/' ), put the cursor on the job and press ENTER

You are in debug mode now. Step through SAP program (press F7 couple of times) until you get to code you need.

How do I debug remote function calls?

You can use the same techniques as described in How do I debug background Processes? above.

How do I debug Updates/System code?

Both options are available from the menu in debugging. Choose Settings -> System/Update Debugging to activate either before proceeding.

Why does it give a dump when I put a break-point in between SELECT and ENDSELECT?

A breakpoint in SELECT loops can cause an exception through loss of the database cursor. The reason for this is that during debugging a database commit is triggered and hence the cursor is lost.

How do I set breakpoints in modal dialogs?

There are two similar approaches to set breakpoints in modal dialogs:

Approach 1:

Click on the Create shortcut icon on the toolbar.

In the popup window choose "System command" and in the command enter "/h"

A shortcut on the desktop would be created

Drag and drop the shortcut to the modal window to set debugging on.

Approach 2:

Create a txt file on the desktop with the following lines:

[FUNCTION]

Command=/H

Title=Debugger

Type=SystemCommandDrag and drop this file to the modal window to set debugging on.

How do I switch between the Classic and New Debugger

From within the ABAP workbench, select the Utilities->Settings Menu

Select the ABAP Editor Tab

Select the Debugging tab within the ABAP Editor Tab

Select the Classic Debugger or New Debugger radio button

Hope these Q & A will helps you.

Vasanth

Read only

Former Member
Read only

Former Member
0 Likes
961

Hi Sundeep,

In debugging there are four options

F5, F6, F7 and F8

To start the debugging can be done in two ways,

1. One is placing the breakpoint

2. When execute the tcode or program in the command box where you enter the tcode give /h and then press enter. The debugging will start.

Now execute the program or tcode . The code will be displayed.

press F5 - is single step - it takes each line by line

Press F6 - When a perform statement is executed it executes the whole perform unlike the F5 option

Press F7 - This option is used to exit out of the present perform or function module after executing

Press F8 - It executes the whole program

Double clicking each of the variable or internal table get the values displayed

You can add , delete , change values of the internal table.

Hope this helps

Regards

Arun

Read only

sreeramkumar_madisetty
Active Contributor
0 Likes
961

Hi

In Debugging we use the following controls mainly:

/h : Dynamic debugging

F5 : sequential debugging

F6 : to skip the debugging of any function modules

F7: To come out of the function module where the control presents.

F8 : one break point to another break point.

break user : to break the user other than u logoned.

For detailed explanation on this refer:

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

regards,

kumar

Read only

Former Member
0 Likes
961

Hello Sundeep,

3 types of debugging:

<b>update,normal and system debugging</b>

<b>check this for update debugging</b>

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.

<b>for system debugging check the below link</b>

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

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

<b>For debugging tutorial:</b>

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

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

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

<b>System Debugging</b>

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.

<b>Update Debugging</b>

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.

<b>

Normal Debugging</b>

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.

<b>BREAKPOINT</b>

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.

<b>Watchpoint</b>

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.

<b>MORE INFO:</b>

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

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

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

Regards,

Beejal

**Reward if this helps

Read only

SantoshKallem
Active Contributor
0 Likes
961

mailed u.

try out in this forum and help.sap.com u will find a lot.

regards.

santhosh

Read only

Former Member