0% found this document useful (0 votes)
23 views12 pages

Debugging 1730116885

Uploaded by

shubhambaggy7
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
23 views12 pages

Debugging 1730116885

Uploaded by

shubhambaggy7
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 12

DEBUGGING

1. Debugging

▪ Debugging is a technique by which we can find the error, correct the error and detect
the error.

▪ SAP debugger is a part of ABAP workbench only.

2. Ways of Debugging

There are 2 ways of debugging.

▪ Set the breakpoint on any executable statement and program stops automatically at
that point.

▪ We can debug the code with the help of transaction code /h.

3. Execution Keys

There are 4 execution keys in debugging mode.

▪ F5 - Step by step execution

▪ F6- Line by line execution

▪ F7 - Return

▪ F8 - Continuous execution or exit

4. System Variables in Debugging Mode

There are 2 default system variables available in the debugging mode.

▪ SY-SUBRC - System variable for return code (successful = 0, not successful = other
than 0). To check whether the above statement, function, or select query is
executed or not.

▪ SY-TABIX - It returns the current line index inside a loop.

Below are the important system variables

1. SY-DATE: Current date

2. SY-UZEIT: Current time

3. SY-UNAME: Username

4. SY-TCODE: Transaction code

5. SY-REPID: Report or program name

6. SY-DATUM: System date


7. SY-LANGU: Logon language
8. SY-MANDT: Client (system identifier)

5. Static Breakpoints

▪ Static breakpoints are also called as user independent breakpoints.

▪ The syntax to set a static breakpoint is BREAK-POINT.

6. Dynamic Breakpoints

▪ Dynamic breakpoints are also called as user dependent breakpoints.

▪ The syntax to set a dynamic breakpoint is BREAK username.

Example: - BREAK Sathish (Username).

7. Various Operations on Internal Table in Debugging Mode

The various operations on internal table in the debugging mode are as follows:

▪ Deleting a row from an internal table.

▪ Editing a row of an internal table.

▪ Adding a row to an internal table.

▪ Saving internal table to a local file.

▪ Delete complete table.

Click on the LT_USER


Click on the Services of the tool symbol after we can find the Change table content where we
perform the internal table operations.

8. Jump to a Particular Statement in Debugging Mode

▪ We can jump to a particular statement in debugging mode by using the path:

Debugger-Go to statement.

▪ We can also jump to a particular statement by using the shortcut ‘Shift + F12’.
9. Features - Setting Breakpoint at Keywords, FM’s and Messages

▪ We can set the breakpoints at keywords in debugging mode like - SELECT, CALL
FUNCTION, MESSAGE etc.

▪ We can also set breakpoints on specific function modules or subroutines or


messages etc.
10. Features - Deleting and Deactivating the Breakpoints

▪ Deleting breakpoints - Permanently deleting the breakpoints in that particular


session.

▪ Deactivating breakpoints - Temporary deleting the breakpoints in that particular


session. When we run the program again, the breakpoint resumes.
11. Features - Find

▪ In the debugging mode, we can find the specific records of internal table.

▪ We need to do CTRL + F for the internal table data, one pop-up appears to pass the
column values, pass the input and it point to the records having matching values.

12. Features - Source Code Display

▪ In the debugging mode, we can open the code in a new session without closing the
debugging session.

▪ We need to click on to program/include/line icon as per the screenshot(highlighted).


13.Features - Save Parameters as Test Data (SE37)

▪ We can save the function module parameter values in the debugging mode.

▪ The path to save function module parameters values as test data is as follows:
Services of the Tool - Save Parameters as Test Data(SE37)

14.Features - SAP Memory and ABAP Memory Values

▪ We can check the values of SAP memory and ABAP memory in the debugging mode.

▪ The path to check the memory id values in the debugging mode is as follows:

New Tool - Special Tools - System Areas (Internal Only)


15. Watchpoints

Watchpoints are used to monitor the values of variables, work areas and internal tables.
16. Breakpoints and Watchpoints Comparison

▪ Breakpoints are for executable statements whereas watchpoints are used to


monitor the values of variables, work areas and internal tables.

▪ A user can set a maximum of 30 breakpoints whereas a user can set a maximum of
10 watchpoints.

17. Comparison of Session Breakpoint and External Breakpoint

▪ A session breakpoint is attached to user session and exists until the user closes the
last session, whereas external breakpoint has a validity of 2 hours.

▪ The session breakpoint is used to debug the ABAP code internally whereas the
external breakpoint is used to debug the ABAP code from an external process like
Web Dynpro applications, BSP (Business Server Pages) etc.

18. User Specific Desktop

▪ Desktop 1, Desktop 2 and Desktop 3 are considered as user specific desktop in the
debugging mode.

The layouts are different and in desktop 2 we can see the ABAP STACK (It is based on the LIFO).

But in Standard desktop we can see both normal and ABAP STACK and Desktop 3 is just most
preferable one to debug.
19. Way to Debug a Dialog Screen or Pop-Up Screen

▪ Firstly, we need to create a text document using the below mentioned code.

[Function]

Command=/H

Type=SystemCommand

▪ Then drag and drop this text document on the required dialog screen or pop-up
screen.

20. Update Debugging

▪ Update debugging is used to debug the code which is written in the update task as
we cannot debug the update task code using normal debugging.

▪ Example - Function module called in the update task.

▪ The path to on the update debugging is as follows:

Settings - Change Debugger Profile/Settings - Update Debugging

21. Script Tab

▪ We can use the script tab to stop the debugger on the selection of specific tables
and update of tables.

▪ We need to go to script tab, click on to load script and pass the name of the script as
per the requirement.
• After click on the Start Script and enter the table like MARA, MAKT, MARD.
The various scripts for selection and updating of tables are as follows:

▪ Script for selection of tables - RSTPDA_SCRIPT_BP_SELECT_TAB

▪ Script for updating of tables - RSTPDA_SCRIPT_BP_CHANGE_TAB

Note: To check the inserting and updating fields into DB tables in the debugging you should change
the normal debugging mode to update mode.

Breakpoint - Breakpoint at statement - INSERT DBTAB or MODIFY DBTAB

You might also like