Documente Academic
Documente Profesional
Documente Cultură
TheABAPDebuggerisusedtooltoexecuteandanalyzeprogramslinebyline.Usingitwecanchecktheflow
logicofaprogramanddisplayruntimevaluesofthevariables.Currently,SAPofferstwotypesofDebuggers:
TheClassicABAPDebugger
TheNewABAPDebugger
TheClassicABAPDebugger,withitsolduserinterfaceanditslimitationstodebugcertaintypesofABAP
programisnownotinusebymanynewandoldABAPdevelopers.
LearnHowToUseTheABAPDebuggerInThisTrainingCourse
TheNewABAPDebugger,withitsstateoftheartandflexibleuserinterface,canbeusedtodebugalltypesof
ABAPprograms.Itprovidesmanynewfeatureswhichimproveourefficiencyofdebugging,bothinABAP
supportanddevelopment.
Inthisarticle,wewilllearnhowtousethesenewfeaturesanddiscoversometipsandtrickstoefficientlyuse
ABAPdebugger.
SwitchingbetweentheClassicDebuggerandNewDebugger
Youcanswitchbetweenboththedebuggerandmakeanyoneyourdefaultdebugger.Todothis,gotoABAP
Editor(SE38)UtilitiesSettings.
NowintheuserspecificsettingspopupboxclickonABAPEditortabandthenclickonDebugging.
HereyoucanselecttheNewDebuggerradiobuttontomakeityourdefaultdebugger.
External(User)Debugging
Externaldebuggingisusedwhenwewanttoanalyzeourprogramwhichiscalledbyanexternaluserthrough
HTTPsuchasWebDynproABAP,WebDynproJAVA,andBSPetc.Toactivateexternaldebuggingwehaveto
setexternalbreakpoints,whichcanbesetjustlikethesessionbreakpointsbykeepingthecursoronthedesired
codelineandclickingontheExternalBreakpointicon.
WecanalsosettheexternaluserforwhomthebreakpointistobeactivatedbygoingtoABAPEditor(SE38)
UtilitiesSettings,andintheuserspecificsettingspopupboxclickonABAPEditorTabandthenclickon
Debugging.
Hereyoucanspecifytheusername.
Watchpoints
Watchpointscanbeusedtobreaktheexecutionofaprogramwhenthevaluesinavariablechanges.
Thishelpustogototheexactpositionwherethevariablechanges.Youcanalsospecifyconditionsin
Watchpointandtheexecutionoftheprogramwillbreakassoonastheconditionisfulfilled.
TocreateaWatchpoint,clicktotheWatchpointbuttonintheNewABAPDebugger.
Now,intheCreateWatchpointpopupenterthevariablenameforwhichyouwanttocreatetheWatchpoint.
DebuggerVariants
WiththehelpofDebuggerVariantyoucansavethecurrentdebuggersettingsintothedatabaseortoalocal
file.Thesesettingsincludebreakpoints,UIcustomizationsandotherspecialoptionsfordebuggingtools.
Nexttime,whenyouwillbedebuggingthesameapplicationyouwillnothavetosetbreakpointsagainortodo
allthesettingsagain.Also,whenyouareworkinginalargeteamthenyoucanalsopassthedebugging
variantstootherusers.
TosavetheDebuggingVariantgotoDebuggerDebuggerSessionSave
Youcansavethecurrentdebuggersessioneithertoafileorinthedatabase.
IntheDebuggerVariantyoucansavethefollowingcomponents:
1.Layout
2.Breakpoints
3.Settings
4.Options
ToloadthesavedDebuggervariantsgotoDebuggerDebuggerSessionLoad
Debuggingamodalwindow
Generally,wecanactivatedebuggingbytyping/hinthecommandline,butwhatifthecommandlineisnot
there?
Oftenyouwillcomeacrossmodalwindowsandotherpopupwindowscommandlineisnotpresentandwe
cannotactivatedebuggingdirectly.Insuchcases,youcaneithercreateaSAPGUIshortcutoftypeSystem
Commandandcommand/horcreateatextfilewithbelowtexts.
[FUNCTION]
Command=/H
Title=Debugger
Type=SystemCommand
Todebugamodalwindowdraganddroptheabovecreatedfileoverit.
DebuggingTricks
Manyatimes,duetoanincorrectentryinadatabasetableoratablewithoutmaintenanceviewwearenotable
tocreate,editordeleteadatabaserecord.Inthesecaseswecanusethisdebuggingtrick.
Todothis,gototransactioncodeSE16.
Enterthenameofyourdatabasetable.Selectthelinewhichyouwanttoprocess,andpressthedisplaybutton.
Enter/hinthecommandlineandhitenterbuttontwotimes.
Now,thedebuggerwindowwillopenandyoucanseethesourcecode.ClickonthevariableCODE,itwillhave
SHOWasitsvalue.
Hereyoucaneditthisvariableandsetthenewvaluebasedontheoperationyouwanttoperform.
BysettingthevariableCODEwithvalueasEDITyoucaneditrecords,
INSR,Insertnewrecords
DELE,Deleterecords
And,ANVOisforeditingtherecordwithprimarykeys.
Aftersettingthevariablewiththerequiredoperation,hitF8.Now,youareinEDITmode.Presssavebuttonto
savetherecord.
TheMagicofSHIFT+F12
Youcanusethiskeycombinationtobypassaspecificlineofcodesuchasanormalsysubrccheckoran
authorizationcheck.Tojumporbypassanyline/linesofcodeallyouhavetofoisjustputyourcursoronthe
desiredlineandthenpresstheSHIFT+F12key.
SomelimitationsofNewABAPdebuggerScreenDebugging
Whenyoutrytosetbreakpointsinscreen/dialogprograms,yougetthemessagestatingthatdebuggingisnot
yetsupported.
Togetbythisanddebugyourscreen/dialogprogramsjustswitchbacktotheclassicaldebugger.
ABAPMemoryID
InthenewdebuggeritisnotpossibletoviewtheusedABAPmemoryIDsandtheircontent.But,intheclassical
debuggeryoucanviewtheABAPmemoryIDsbygoingtoGotoSystemAreasABAPMemory
Categories