Debugging
ABAP Debugger
Runtime Analysis
Runtime Measurement of Program Segments
BREAK-POINT
Basic form
BREAK-POINT.
Additions:
1. ... f
2. ... AT NEXT APPLICATION STATEMENT
Effect
The BREAK-POINT is a debugging aid. When you run a program normally, it is interrupted at the statement, and the system automatically starts the debugger, allowing you to display the contents of any fields in the program and check how the program continues.
If the program is running in the background or in an update task, the system generates a Syslog message.
Note
• If a COMMIT WORK statement occurs in a SELECT loop, the database cursor is lost. This causes a runtime error in the next loop pass when the system tries to read the next line of the table.
Since debugging sometimes generates automatic COMMIT WORKs (non-production client or not debugging in debugging mode), it can be difficult to debug SELECT loops because BREAK-POINT statements within the loop can so easily lead to runtime errors.
• You can set dynamic breakpoints in the Debugger without having to change the ABAP program. Such breakpoints are only valid for the user that set them, and are deleted when the user logs off.
Addition 1
... f
Effect
If the program is not running in dialog mode (background, update task), the contents of field f are output along with the system log message.
Addition 2
... AT NEXT APPLICATION STATEMENT
Note
This addition is for internal use only.
Changes and further developments, which may be incompatible, are possible at any time, and without notice or warning.
Effect
This statement is only relevant to system programs (program attributes, status "S"), or system modules, subroutines, or function modules (names begin with "%_")
If system debugging is not switched on, the program is not interrupted until it reaches a statement that is not in a system program (or module, subroutine, or function module).
If system debugging is switched on, the program is interrupted at the statement itself.
Note
When system debugging is switched off, BREAK-POINT statements in system programs are ignored at runtime unless you use the AT NEXT APPLICATION STATEMENT addition.
GET RUN TIME FIELD
Basic form 5
GET RUN TIME FIELD f.
Effect
Relative runtime in microseconds. When you first call GET RUN TIME, the field f is set to zero (initialized). Each subsequent call places the runtime since the first call into the field f. f must have type I.
The ABAP statements between two GET RUN TIME statements are known as the performance section, and the time between the two calls is known as the measurement interval.
Notes
You can use SET RUN TIME CLOCK RESOLUTION to set the measurement accuracy. The default setting is high accuracy.
Example
Runtime measurement for the MOVE statement
DATA: T1 TYPE I,
T2 TYPE I,
TMIN TYPE I.
DATA: F1(4000), F2 LIKE F1.
TMIN = 1000000.
DO 10 TIMES.
GET RUN TIME FIELD T1.
MOVE F1 TO F2.
GET RUN TIME FIELD T2.
T2 = T2 - T1.
IF T2 < tmin =" T2."> Interval...').
Variant 1
SET RUN TIME CLOCK RESOLUTION HIGH.
Effect
GET RUN TIME uses high accuracy with a short measurement interval to measure the runtime.
Variant 2
SET RUN TIME CLOCK RESOLUTION LOW.
Effect
GET RUN TIME uses low accuracy with a long measurement interval to measure the runtime.
Note
Runtime errors:
• SET_RUN_TIME_CLOCK_ERROR : After GET RUN TIME, you may no longer use SET RUN TIME CLOCK RESOLUTION.
SET RUN TIME ANALYZER ON/OFF
Variants:
1. SET RUN TIME ANALYZER ON.
2. SET RUN TIME ANALYZER OFF.
Effect
These statements only work if you are executing a program using runtime analysis. If you select the Particular units option, the system only measures the statements that occur between SET RUN TIME ANALYZER ON and SET RUN TIME ANALYZER OFF.
Note
You should remove these statements from your source code when you have finished measuring runtime. This ensures that other users can define their own runtime monitoring criteria as well.
Variant 1
SET RUN TIME ANALYZER ON.
Effect
Starts writing performance data.
The return code is set as follows:
SY-SUBRC = 1:
The runtime analysis is not active, or the performance data file is not open for writing.
SY-SUBRC = 0:
All other cases.
Variant 2
SET RUN TIME ANALYZER OFF.
Effect
Stops writing performance data.
Example
DO 3 TIMES.
PERFORM NOT_TO_BE_MEASURED.
SET RUN TIME ANALYZER ON.
PERFORM TO_BE_MEASURED.
SET RUN TIME ANALYZER OFF.
PERFORM NOT_TO_BE_MEASURED.
ENDDO.
FORM NOT_TO_BE_MEASURED. ENDFORM.
FORM TO_BE_MEASURED. ENDFORM.
Note
You can also start and stop measurement dynamically:
1. From the menu:
• System → Utilities → Runtime analysis → Switch on
• System → Utilities → Runtime analysis → Switch off
1. In the command field
• /RON
• /ROFF
Ads
Wednesday, October 14, 2009
Subscribe to:
Post Comments (Atom)
Blog Archive
-
▼
2009
(185)
-
▼
October
(63)
- Indexes - Form and Use
- Better Aproach - Coding in Abap (Coding Format)
- Example : Standard Abap Report
- SQL Interface
- BASICS OF INTERACTIVE REPORTS
- Transactions
- General command field formats
- Sap Script
- SAPScript Transaction codes
- Convert the sapscript from spoollist to pdf
- Report command field formats
- ABAP/4 functions:
- What is ABAP?
- Usefull Transaction Code in Abap
- SAP ABAP Interview FAQ
- SAP ABAP MNC Interview Questions
- SAP ABAP MNC Mostly asked interview questions
- SAP ABAP interview Questions and Answers
- ABAP Technical Interview Questions
- Face SAP ABAP Interview
- SAP ABAP Certification
- BUILD WEB SERVICE ABAP&SAP
- ABAP Objects-An Introduction to Programming
- SAP ABAP complete reference
- SAP ABAP Complete Certification
- Sap BC Abap Programming
- SAP ABAP Interview Part - 2
- SAP ABAP Interview Part - 1
- ABAP ENHANCEMENTS
- ALE ABAP DETIAL
- SAP BUSINESS WORK FLOW
- ALE IDOC'S IN SAP ABAP
- SAP ABAP DATA BASE UPDATES COMPLETE
- LUW’S AND CLIENT/SERVER ARCHITECHERE:SAP-ABAP
- SAP LOCK CONCEPT
- ORGANIZING DATABASE UPDATES
- COMPLEX LUW PROCESSING IN ABAP SAP
- SAP ABAP MEMORY
- CHANGING THE SAP STANDARD
- ENHANCEMENTS TO DICTIONERY ELEMENTS IN SAP
- BUSINESS TRANSACTION EVENTS IN ABAP SAP
- MODIFICATIONS OF SAP STANDARD OBJECTS
- SAP WORK FLOW SCENARIOS
- SAP SCRIPT CONTROLS
- DIFFERENCE BETWEEN BADI'S AND USER EXITS
- SAP ABAP ALV IN BRIEF
- SAP ABAP OPTIMIZATION I
- TYPE KEY WARD IN ABAP SAP
- TABLE TYPES IN SAP
- TYPES OF VIEWS IN SAP
- SAP ABAP FAQ'S ON SD MM FI/CO
- SALES FLOW IN SAP
- FI/CO DEFINATIONS FOR ABAPER
- PERFORMENCE TIPS IN ABAP SAP
- INTERNAL TABLES IN BRIEF
- CROSS APPLICAITONS DEFINATIONS
- RUN TIME ANALASIS IN ABAP SAP
- SAP ABAP Programming FAQ'S For inerview
- ABAP Programming real time questions for SAP ABAP
- SAP ABAP FAQ'S REAL TIME II
- SAP ABAP Questons and Answers for Interview
- ABAP ALE FAQ'S
- This is my First Post for ABAP Lovers
-
▼
October
(63)
No comments:
Post a Comment