P. 1
19500638-ABAP-Debugging-Techniques.pdf

19500638-ABAP-Debugging-Techniques.pdf

|Views: 31|Likes:
Published by mayura mulla
abap debugging techniques
abap debugging techniques

More info:

Published by: mayura mulla on Mar 11, 2013
Copyright:Attribution Non-commercial

Availability:

Read on Scribd mobile: iPhone, iPad and Android.
download as PDF, TXT or read online from Scribd
See more
See less

10/20/2013

pdf

text

original

ABAP Debugging Techniques

Table of Contents
               

Need for Debugging Debugging requirement. Initial Set Up Debugging Types. Debugging Screen Single Dimensional structure Two Dimensional structure. System Variables. Break Point. Watch Point. Termination of Batch Job Background Job Overview Dump Analysis Error List Runtime Analysis Debugging of Background Task

Need for Debugging .

method Performance problem Screen Processing Detailed error analysis source code level Tool System Log (SM21) ABAP Dump Analysis (ST22) ABAP Runtime Analysis (SE30) ABAP Runtime Analysis (SE30) ABAP Runtime Analysis (SE30) SQL Trace (ST05) Screen Trace (ST20) ABAP Debugger . function.Need for Debugging Problem Type Starting point for analyzing a crashed program/ background job Runtime Error Unexpected Program behavior Finding specific statement.

Debugging Requirement .

Function Module User Exit Screens – Module Pool Program. Background Jobs. Standards Programs. .Debugging requirement • • • • • • Report.

Report .Debugging .

USAGE • Change field values at Runtime. To directly pinpoint to a field value of Internal Table. • • • . Check for proper Data retrieval and Logic flow. Skip record counts within a loop and arrive at particular iteration of concern. of variable or ITab field for manipulating the logic flow.

Control switches to Debugging Mode. • . (Optional – wherein need to debug incorrect value field on first screen) Using hard code in ABAP program “BREAKPOINT”   • Execute. Enter ‘/h’ in command line.Initial Set Up Identify relevant variable to locate appropriate point in code to start debugging.  Menu Bar  Utilities  Breakpoint  Set.

Return (F7): Control skips current subroutine. without passing through code within. . • • • Run (F8): Control runs to next debugging point or reaches the end result of the program. Execute (F6): Control overruns through each Subroutine.Debugging Types • Single Step (F5): Control passes through each executable statement.

Debugging Screen .

contains multiple fields.Single Dimensional structure • • • Variable/ Field: Contains data. Structure: Consists Multiple fields. o • • . Field Contents can be modified using Change button. Work Area: Current line of ITab. Process FIELD button -> enter name in Col Field names  data displayed in Field Contents.

Process Tables button  enter name in Internal table section OR double click on ITab name  Table data displayed below.Two Dimensional structure • Internal Table: Contents of database table retrieved by ABAP code (selected fields). Change field contents: double click on any ITab field  leads to Single Field Contents screen  use Change button for Runtime changes o • • .

SY-DBCNT: Total No of lines processed. o sy-subrc = 0  successful retrieval of data o sy-subrc <> 0  unsuccessful retrieval of data SY-TABIX: Current line number of internal table. about confirmation of retrieval statement.System Variables • • SY-SUBRC: Successful execution of previous statement System variable providing fruitful information. • .

method . subroutine. if. Showing all Dynamic Break point options . exception and system exception). etc.).Break Point • • Static Break-point (ex: Break-point and Breakuser ID) Dynamic Break-Point (Break Point is set at any statement (message. function module.

Ex.Placing Break point at ‘message’ .

Local/ Global data. Can be placed for any field of Internal table. Comparison Field Value. Features: Comparison Operator.Watch Point • To directly pinpoint a field of Internal Table having particular value. o • • • • • . Logical Operator.

instead use Watch Point feature as shown in below screen shot. Executing F8 until then is time consuming. . Interested to know about processing for 55th iteration out of 100 records in an Internal table.• • • Watch Point is set within a loop with ‘n’ iterations.

Debugging – Background Job .

Termination of Batch Job • Transaction for Batch Job: SM37 Execute for given User. Identify particular Job from the displayed list of Jobs. • • • • • . Check for Job Log. Identify the actual message text using SE91. For the erroneous Message Text note the Message Number and Class.

Background Job Overview .

Debugging – Dump Analysis Tool .

Selection of particular error gives the Runtime Error Description.Dump Analysis • Transaction : ST22 Execute for given User/ Program/ Date. Provides list of errors for given selection. • • • .

List of Errors for given User .

Runtime Error .

Debugging of Background Task .

• • After setting the flag save and execute the session.Debugging of Background Task Steps: After ‘/h’ debugging. click on settings and select the option as “In background task don’t execute” . To perform background task debugging go to transaction code SM58 • .

.

SM58 tcode screen and execute Select the background task and do debug LUW from menu bar .

You're Reading a Free Preview

Download
scribd
/*********** DO NOT ALTER ANYTHING BELOW THIS LINE ! ************/ var s_code=s.t();if(s_code)document.write(s_code)//-->