0% found this document useful (0 votes)
4 views

SAP DEBUGGING

The document provides a comprehensive overview of debugging in SAP, detailing its purpose, methods, and various features such as breakpoints, execution keys, and system variables. It explains different types of breakpoints, how to monitor variables with watch points, and techniques for debugging during pop-up windows and update tasks. Additionally, it includes practical tips for manipulating internal tables and handling authorization checks during the debugging process.

Uploaded by

janaki raman
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
4 views

SAP DEBUGGING

The document provides a comprehensive overview of debugging in SAP, detailing its purpose, methods, and various features such as breakpoints, execution keys, and system variables. It explains different types of breakpoints, how to monitor variables with watch points, and techniques for debugging during pop-up windows and update tasks. Additionally, it includes practical tips for manipulating internal tables and handling authorization checks during the debugging process.

Uploaded by

janaki raman
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 9

ABSTRACT

Debugging is the process of identifying and fixing


issues in an SAP program by analysing its behaviour
step by step. It allows developers to track the
program's flow, inspect variables, and understand
why it is not working as expected

Hariharan Rajagopal
SAP Junior Functional Consultant

SAP
DEBUGGING
Page |1

Table of Contents
What is the use of Debugging? .............................................................................................................. 2
Way of Debugging .................................................................................................................................. 2
Breakpoint .............................................................................................................................................. 2
Execution Keys ........................................................................................................................................ 3
System Variables .................................................................................................................................... 3
Features in Debugging mode for internal table .................................................................................... 3
1. List preview. ............................................................................................................................... 3
2. Search ......................................................................................................................................... 4
3. Source Code ................................................................................................................................ 4
Memory ID .............................................................................................................................................. 5
Watch Point ............................................................................................................................................ 5
Debugging during the Pop-Up Windows. .............................................................................................. 6
Debugging “Update Task” ...................................................................................................................... 6
Script ....................................................................................................................................................... 6
1. We can stop the debugger on the selection of tables ................................................................ 7
2. We can stop the debugger on an update of tables. ................................................................... 7
Skip AUTHORITY-CHECK ......................................................................................................................... 8
Page |2

Debugging – De-Bug
What is the use of Debugging?
We can detect, analyse, and resolve the bugs using debugging.

Way of Debugging
1. Breakpoint
2. Transaction Code: /H

Breakpoint
We can’t put the breakpoint on the Data declaration

We can only put a breakpoint on Executable Statements like IF, DO, Select

Breakpoint – If we set a session breakpoint, the system will stop reading the program at that point/
particular line.

There are 2 types of breakpoints.

1. Session Breakpoint – the breakpoint is attached to the user session and exits until the user
logs out from the SAP. We can use this internal SAP system for debugging.
2. External Breakpoint – the breakpoint is only valid for 2 hours for the respective user. Even
though we logout from the system the breakpoint will be there because of 2 hours’ validity.
We can use this internal SAP system and also for external debugging, for example, Webdynpro
application, BSP, etc…
Pathway – SE80 where only the external breakpoint will be available

There 2 types of breakpoints by using keywords in the program.

1. Static Breakpoint – User-independent breakpoint, which means once we set the “Static
Dynamic Breakpoint” it will apply to all users. When the breakpoint is set for a transaction
code or executable program user Trainee01, Trainee02, and Trainee03 enter into it the
debugging will triggered

Keyword – Break-Point.

2. Dynamic Breakpoint – User-dependent breakpoint. The breakpoint applies to the particular


user only not to other users.

Keyword – Break User Name (Break Trainee01.)

The Breakpoint can be set in the pathway—Breakpoints in the Menu bar Breakpoint at Breakpoint at
Statement. Here, we can set breakpoints at CALL FUNCTION, SELECT, MESSAGE, and Source Code. By
the way, the breakpoints will be set to the whole statement, though we can easily analyse the code.

Temporary – We can Temporarily delete the breakpoint by deactivating the breakpoint in the
particular session, and then the program allows us to execute. When we run the program again, the
debugger will start again.

Permanent—We can permanently delete the breakpoint. Though we can execute the program
without debugging, if we run it again, it won’t call debugging mode.
Page |3

Execution Keys
1. F5 Step by Step if there is a Call Function it will read
2. F6 Line by Line It will execute the reusable components like, Call Functions, Class, and
Subroutine and go to the next line
3. F7 Return from the reusable components
4. F8 Execute

System Variables
1. SY-SUBRC – Return Code

If it is “0” the current code is read successfully.

If it is <> “0” the code is unsuccessful.

2. SY-TABIX – It will be activated only in the loop statement

We can analyse the number of times the loop has been triggered.

Features in Debugging mode for internal table


1. We can Change the record of the internal table
2. We can Delete the record of the internal table
3. We can Append the row in the record of the internal table
4. We can Delete the Whole internal table of the record
5. We can change the input variables during runtime
6. We can skip some conditions, place the cursor in the line and Debugger  Go to Statement
/Shift + F12. By the way, we can skip the particular condition without executing

List preview, Search, and Source Code Window in Debugging mode

1. List preview.
Where we can analyse the preview in debugging mode without executing it.
Page |4

2. Search
We can search Control + F. This feature wide used to find the value without exporting it.

3. Source Code
By using this feature, we can reduce our time by debugging again and again because a new screen will
be proposed where we can analyse the source code by debugging.
Page |5

Memory ID
How we can check the memory using debugging? Generally, the memory ID is not treated as a Variable
in debugging. So we can’t see the value by double-clicking it. Using System area.

ABAP Memory – EXPORT/IMPORT______ TO MEMORY ID

SAP Memory – SET/GET PARAMETER ID ______ FIELD

By double-clicking the SAP Memory we can see the values of the variables.

Watch Point
Used to monitor the values of the variables and internal tables.
Page |6

Using this, we can monitor the value. We can also monitor the required data by keeping a “Watch
Point”.

Debugging during the Pop-Up Windows.


For Pop-Up mode there won’t be a command box to trigger debugging. We can use the below mention
code to debug

“[FUNCTION]

COMMAND = /H

TYPE=SYSTEMCOMMAND”

Save this code in Notepad. Drag the Notepad and paste/put it over the Pop-Up window. By the way,
the debugging mode will be activated.

Debugging “Update Task”


Follow the pathway – In debugging mode, Settings  Change debugging profile/setting

For the Update task – the normal debugging or breakpoint won’t read the updated task. So we have
to trigger the updated debugging by the above-mentioned pathway. The debugging will start after the
committed work, which means the debugging will trigger after committing, and then we can read the
Updated Functional Module. We can able to find the updated module by the radio button mentioned
above screenshot.

Script
Using Script, we can stop the debugger on the selection of tables, we can stop the debugger on an
update of tables.
Page |7

1. We can stop the debugger on the selection of tables

We can analyze the data by passing the required tables.

2. We can stop the debugger on an update of tables.

Without Script tab usage: Set the breakpoint at INSERT DBTAB and MODIFY DBTAB. By this, we can
analyze where the data will be stored.

For updating the table, we need to activate the update debugging, if not we can debug the system
and create the document. If the update debugging is activated, then the document will be created
then update debugging will be triggered where we can analyze the updating of the table.
Page |8

Using Script Tab: Just pass the Script name and start the script, where the system will create a
document and start update debugging.

Pass the required tables, by the way, we can analyze the updating of fields.

Skip AUTHORITY-CHECK

Note: It’s just for the Knowledge. Don’t process without a Basis person for such kinds of errors.

If we face any authorization issues for the respective user, by using debugging we can skip that error.

Whenever the system is unsuccessful for the input the SY-SUBRC will be other than zero, to pass the
condition we can edit the SY-SUBRC to zero. The system will allow us to process.

You might also like