100% found this document useful (1 vote)
197 views

Debugging ABAP For Functional Teams - Part 1 - IT Partners Blog

SAP ABAP Debugging for functional people

Uploaded by

praveenjutur
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
100% found this document useful (1 vote)
197 views

Debugging ABAP For Functional Teams - Part 1 - IT Partners Blog

SAP ABAP Debugging for functional people

Uploaded by

praveenjutur
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/ 13

12/28/2015

DebuggingABAPforFunctionalTeamsPart1|ITPartnersBlog

Skiptocontent

Home
About
Follow:
RSS
ITPartnersBlog
SAPTips,TricksandeLearning
Tags
1
businessprocessanalysis,debugger,debuggertools,debugging,ITPartners,ITstaffing,sap,sapconsulting,sap
Share
gui,sapnetweaver,SAPstaffing,sapsystemsintegration,technologyframework
Tweet

DebuggingABAPforFunctionalTeamsPart1
288
byadminonFebruary18th,2014

Recommend This Post!

Like

Share

StumbleUpon
Submit
0
AnthonyCecchiniisthePresidentofInformationTechnologyPartners(ITP),anSAP
consultingcompanyheadquarteredinPennsylvania.ITPofferscomprehensiveplanning,resourceallocation,
implementation,upgrade,andtrainingassistancetocompanies.Anthonyhasover17yearsofexperienceinSAP
R/3businessprocessanalysisandSAPsystemsintegration.HisareasofexpertiseincludeSAPNetWeaver
integrationALEdevelopmentRFC,BAPI,IDoc,Dialog,andWebDynprodevelopmentandcustomized
WeRecommendReading...
[email protected].

WhylearnhowtousetheDebugger?

DebuggingABAPforFunctio
Part2

DebuggingisthewaytofindtherootcauseofSAPtransactionbehavior(e.g.,findingareasonwhyacertain
valueinafieldwasupdatedordeterminingwhyusersreceiveanerror,warning,orabnormal
terminationmessageduringtheprocessingofatransaction).Debuggingisnecessaryiftherootcausecannotbe
determinedfromfunctionalmethodssuchascheckingcustomizingormasterdata.
SinceABAPisthebackboneofSAP,atonepointoranother,everymemberofafunctionalteammusthavehad
todealwithSAPdevelopmenttechnicalitiesbehindthebusinessfunctionality.Thisneedfortechnicaldetailscan
occurduringvariousphases,suchaswritingfunctionalspecificationsoranalyzingaproductionenvironment
issues.
http://www.itpsap.com/blog/2014/02/18/debuggingabapforfunctionalteamspart1/

1/13

12/28/2015

DebuggingABAPforFunctionalTeamsPart1|ITPartnersBlog

InthisblogIllexplainbasicterminologyforABAPandvarioustoolsandtechniquesfordebugging.This
knowledgeishelpfulwhenyouaretryingtofindtherootcauseofanissueordesigninganeededfunctionalityto
fillaGAPinrequirements.Iwillyoushowthevariousobjectsfordebuggingwithsomeexamples,suchas
debuggingforanerrormessage,ordebuggingafunctionmodule.

HowtoTriggerDebugging
Letslookatsomebasicwaystotriggerdebugging..
Ifyouarenotsureaboutwhichlineofcodeyouwanttodebug,entertransaction/hinthecommandprompt,
sometimesrefereedtoastheOKCODE,whileexecutinganytransaction.PressEntertoactivatethedebugger.
(seebelow)

Youllseethemessage
inthestatuslineandnowifyouweretopressenter
again,orhitsave,orperformanyfunctiononthistransaction,youwillseetheDEBUGGERscreenappear(see
below).Youwillbepositionedatthefirstexecutableinstructionbasedontheuserinteractionyouperformed.If
youknewtheexactlineofcodeyouwantedtohavetheDEBUGGERscreenappearat,thenyoucouldusea
BREAKPOINT ,butwewillcoverthatalittlelater

http://www.itpsap.com/blog/2014/02/18/debuggingabapforfunctionalteamspart1/

2/13

12/28/2015

DebuggingABAPforFunctionalTeamsPart1|ITPartnersBlog

OK,letstakealookatthedebuggingscreenitself.letsstartwiththecontrolbuttons.

ControlButtons

Ifyoulookabove,youcanseefourbuttonsIhavehighlightedandnumbered14.Thebuttonscontroltheflow
ofthedebuggingsessionandaredescribedindetailbelow.
1. Singlestep(theF5key).Whenyouclickthisicon,thedebuggercontrolmovestothenextlineofcodein
debugging.Ifthenextlineisacalltoanotherprogram,(e.g.,thefunctionmodule),thenthecontrolshifts
tothatprogram.
2. Execute(theF6key).Whenyouclickthisicon,thedebuggercontrolmovestothenextlineofcodeinthe
sameprogramonly,withoutgoinginsidethecodeofthefunctionmoduleorprogrambeingcalledinthe
lineofcodeinwhichyouclickthisicon.
3. Return(theF7key).Whenyouclickthisicon,thedebuggercontrolreturnstothecallingprogram.This
iconisusefulwhenyouareinalooporinsideafunctionmoduleorprogramcalledfromthemainprogram
andyouwanttoreturntothemainprogram.
4. Run/Continue(theF8key).Whenyouclickthisicon,thedebuggercontrolmovestothenextbreakpoint
set,ifany.Otherwise,thedebuggingisswitchedoff,andtheprogramisexecutedcompletely.

FieldDisplay
http://www.itpsap.com/blog/2014/02/18/debuggingabapforfunctionalteamspart1/

3/13

12/28/2015

DebuggingABAPforFunctionalTeamsPart1|ITPartnersBlog

Duringdebugging,thefieldsdisplayshowsthefieldlist.Ifyouclickanyfieldintheprogram,the
debuggershowsthepresentvalueorcontentsofthatfield.Ifforsomereasonlikeduringtesting,youwanttouse
adifferentvalueforthefield,youcanchangethefieldvalueusingthechangeicon ,butthisaccessindebug
isgenerallygiventodevelopersonlyandNEVERinaproductionsystem.(seebelow)

TableDisplay
Nowweneedtoturntohowwecouldlookintotables.Why?Letssayyourlookingatasalesorder,orpurchase
ReqetcWelltheitemsarenormallystoredinwhatscalledanINTERNALTABLE.Thisisnottobeconfused
withaDATABASETABLElikeVBAK,orVBAP.TheDATABASETABLESarestoredontheBackend
DBMS(Oracle,DB2,evenHANA)andarePERSISTENT.WhiletheINTERNALTABLESareNOT
PERSISTENTandhaveashelflifeofthecurrentLUWinMemory.
First,likeanyfielddoubleclickonaninternaltableinthedebugger.Youwillseethetableappear,likeanyfield,
ontherighthandside.Thewayyouwillknowthisatableisbythe

http://www.itpsap.com/blog/2014/02/18/debuggingabapforfunctionalteamspart1/

icon.(seebelow)

4/13

12/28/2015

DebuggingABAPforFunctionalTeamsPart1|ITPartnersBlog

Toseethecurrentcontentsorrowsoftheinternaltabledoubleclicktheicon.Iknowyouneedtoknowhowto
add,changeordeleterows,sothatswhenyouusetheObjectServicesicon .Dependingonwhatyouare
lookingat(Field,DatabaseTable,InternalTableetc),ifyouclickthisiconthenservicesrelatingtothetypeof
objectyouareworkingwithwillbeavailableforyouruse.Forinstanceyoucanadd,changeordeletearow.You
canalsoexporttheinternaltabletoEXCELbyusingtheicon

.(seebelow)

BreakPoints
NowisagoodtimetodiscussBreakPoints.Abreakpointcanbesetforalineofcodeeitherwhileinthe
debugger,orpriorwhileintheEDITOR(SE80/SE38/SE37/SE24).Theiconforabreakpointlookslikethis .
Incontrast,the iconshowsyouwhereyourareintheexecutionofanobject.Say,youused/htotriggerthe
debuggerandsinglesteppedonelineatatime.Wellthe iconwouldcontinuetomovedownwiththe
execution.
Whenyoudoubleclickonalineofcodeleftofthelinenumber,youwillsetaBREAKPoint.Thenwhenyou
runthetransactionorprogram,thedebuggerwillstopatthatspecificlineofcodeandpopupadebuggerscreen
thatbynowyouknowwell.(seebelow)

http://www.itpsap.com/blog/2014/02/18/debuggingabapforfunctionalteamspart1/

5/13

12/28/2015

DebuggingABAPforFunctionalTeamsPart1|ITPartnersBlog

Thereismorethanonewaytosetabreakpoint.OneofmypersonalfavoritesthatIhaveshownaboveistouse
themenupathBREAKPOINTS>BREAKPOINTAT.Herewehavemanyoptionstosetdynamicbreakpoints
basedoncommands,functions,methodsetc.OnewaytousethisistochooseBREAKPOINTATStatement,
andenterthecommandAUTHORITY_CHECK.

Thiswillcausetheobjecttostopanytimethiscommandisabouttobeexecuted.Thenwhenyoustop,F6to
execute.ThenusethefieldchangecapabilitytoalterthecontentsofSYSUBRCtozero,ifitisnotzeroalready.
ThisisagoodwaytobypassanduseSAPtransactionsyoumaynothaveauthorizationfor.Pleaserememberthat
http://www.itpsap.com/blog/2014/02/18/debuggingabapforfunctionalteamspart1/

6/13

12/28/2015

DebuggingABAPforFunctionalTeamsPart1|ITPartnersBlog

youmustusecautionwhendoingthis,andyouwillNOTbeabletodothisinProduction.

TheCallStack
LetsendthismonthsBlogwithalookatonemoreusefultool.TheABAPStack.
TheDESKTOP2TabinthedebuggerUIdisplaystheABAPcallstack.Itallowsyoutoswitchtothecontextof
eachstacklevelandnavigatetothesourcecodebyopeningtheABAPEditor,inordertostartadeeperanalysis
ofthecodeinaseparatewindow(justdoubleclick!).AlsonewwithSAPNetWeaver2004sistheabilityto
displaythescreen(Dynpro)stackaswell.Evenmoreimportant,youcandisplayacombinedABAPandscreen
stacktofindoutonwhichABAPlevelwhichscreenwascalled,andwhichscreeninvokedwhichABAPmodule.
Youcannavigatefromeachstacklinetothecorrespondingsourcelineintheeditorbydoubleclickingonthe
iconinthestacktypecolumn

IfyouwouldlikeacompleteanddetailedlookattheSAPDebugger,thenpleaseviewthepriorblogsbelow.You
willbeadebuggingexpertinshortorderandwowyourFunctionalassociateswithyourskillandprowess!
TheNewABAPDebuggerPart1
TheNewABAPDebuggerPart2
TheNewABAPDebuggerPart3

http://www.itpsap.com/blog/2014/02/18/debuggingabapforfunctionalteamspart1/

7/13

12/28/2015

DebuggingABAPforFunctionalTeamsPart1|ITPartnersBlog

InnextmonthsBlogwewilllookatspecificscenariosthatcauseRuntimeErrorDebugopportunities.Illshow
youhowtouseaDebugCommandevenintheBatchenvironment!Sostaytuned!

IfyouenjoyedthisblogonDebuggingABAPforFunctionalTeams,pleasefillouttheformbelowandsignup
forournewsletter.WedeliverrelevantSAPTechnicaltips&tricks,SAPnews,andthecurrentmonthsBLOG
righttoyourinbox!

Sign up for updates!

Name:

Email:

We respect your email privacy

Checkoutarewebchannels

http://www.itpsap.com/blog/2014/02/18/debuggingabapforfunctionalteamspart1/

8/13

12/28/2015

DebuggingABAPforFunctionalTeamsPart1|ITPartnersBlog

IT Partners

Recommend This Post!


FromFunctionallyTechnical

http://www.itpsap.com/blog/2014/02/18/debuggingabapforfunctionalteamspart1/

9/13

12/28/2015

DebuggingABAPforFunctionalTeamsPart1|ITPartnersBlog

1Comment
Recommend

ITPartners,Inc

Share

Login

SortbyBest

Jointhediscussion
OracleTraininginChennai ayearago

ThankstoSharetheQTPMaterialforFreshers,
qtptrainingchennai

Reply Share

WHAT'STHIS?

ALSOONITPARTNERS,INC

TheNewEnhancementFrameworkPart5

WhatareBTEandBDTEnhancementsPart
1

1comment3yearsago

1comment2yearsago

http://www.womanistmusings.coAn

outstandingshare!Ihavejustforwardedthis
ontoacolleaguewhohasbeen

pratheekKumarNicearticleiwasreally

impressedbyseeingthisarticle,itwasvery
intrestinganditisveryusefulfor

TheNewEnhancementFrameworkPart4

SAPControlsTechnologyPart2

2comments3yearsago

7comments3yearsago

AnthonyCecchiniTheinformationinthisand

AnthonyCecchiniYes...@itpsapinc

allmyblogsarefromexperienceusingtheIDE
toolortoolsetiamdescribing.

Subscribe

AddDisqustoyoursiteAddDisqusAdd

Privacy

Likethisblog?SubscribetoOurNewsletter
andhaveitdeliveredtoyourinboxeach
month!
FirstName.....

EmailAddress.....

Subscribe
WeRespectYourPrivacy!

http://www.itpsap.com/blog/2014/02/18/debuggingabapforfunctionalteamspart1/

10/13

12/28/2015

DebuggingABAPforFunctionalTeamsPart1|ITPartnersBlog

I.T.Partners,INC
3,799likes

LikePage

Share

I.T.Partners,INCshared
alink.
24mins

Howtousethe
alternativetax
classificationinsales
SCN.SAP.COM

Like

Comment

Share

http://www.itpsap.com/blog/2014/02/18/debuggingabapforfunctionalteamspart1/

11/13

12/28/2015

DebuggingABAPforFunctionalTeamsPart1|ITPartnersBlog

Tweets
IT Partners, INC
@itpsapinc

Follow
15m

Now Hiring: SAP Junior Batch Scheduler CPS in Ashburn, VA bull.hn/l/2ODV3/3 #job

IT Partners, INC
@itpsapinc

1h

How to use the alternative tax classification in sales order header


scn.sap.com/community/erp/

IT Partners, INC
@itpsapinc

2h

4 Ways to Improve Productivity in the Workplace scn.sap.com/community/busi


pic.twitter.com/CakCOAwJxC

IT Partners, INC
@itpsapinc

3h

Tweet to @itpsapinc

Categories
SelectCategory

Archives
SelectMonth

SuggestionsForYou:
DebuggingABAPforFunctionalTeamsPart2
LayerAwareDebugging(SLAD)inSAPDemystifie
UsingTheSALVOOClassforQuickandeasyTab
ABAPDynamicProgrammingPart4
WhatsNewinABAP7.02and7.03Part3
WhatsNewinABAP7.02and7.03Part2
ABAPDynamicProgrammingPart5
ABAPDynamicProgrammingPart1
http://www.itpsap.com/blog/2014/02/18/debuggingabapforfunctionalteamspart1/

12/13

12/28/2015

DebuggingABAPforFunctionalTeamsPart1|ITPartnersBlog

ABAPDynamicProgrammingPart3
ABAPDynamicProgrammingPart2

About
Since1993,ITPartnershasbeenprovidingreliable,costeffectivesolutionstomeetourcustomer'sgoalsand
objectivesintheSAPMarketplace.
WithITPartnersConsultingasyourvaluedbusinesspartner,yougettheexpertisenecessarytocreateandrealize
businessvalue,andtorunSAPprojectssuccessfully.Ourconsultantshelpreducetimetovalue,lowertotalcost
ofownership,andimprovethereturnonyourSAPsoftwareinvestment.

Tags

abapABAPQualityabapskillsalvblogsbusinessclientbusinessprocessanalysisCodeInspector
consultingcompanydebuggerdebuggingdialogDynamicProgrammingenhancementenhancements
ExtendedProgramCheckframeworkguiininformationtechnologypartnersIT
PartnersITstaffingMemoryAnalysisMemoryInspectormessagetypesnewOpenSQLRollArea
7.03

sapsapconsultingsapguisapidocsapidocssapnetweaversapr3

RuntimeAnalysisinABAP

SAPstaffingsapsystemsintegrationSATSLINtechnologyframework
webdynproworkflowworkflowdevelopment
Search
Search
Copyright2015InformationTechnologyPartners.TitanThemebyTheThemeFoundry.

http://www.itpsap.com/blog/2014/02/18/debuggingabapforfunctionalteamspart1/

13/13

You might also like