16
Skip to content Home About Follow: RSS IT Partners Blog SAP Tips, Tricks and eLearning Tags abap , business process analysis , debugger , information technology partners , new , sap consulting , sap help , sap r 3 , sap systems integration , set , stack , standard tools , to , watchpoint , workflow development The New ABAP Debugger – Part 3 by admin on August 19th, 2011 Recommend This Post! Anthony Cecchini is the President of Information Technology Partners (ITP), an SAP consulting company headquartered in Pennsylvania. ITP offers comprehensive planning, resource allocation, implementation, upgrade, and training assistance to companies. Anthony has over 17 years of experience in SAP R/3 business process analysis and SAP systems integration. His areas of expertise include SAP NetWeaver integration; ALE development; RFC, BAPI, IDoc, Dialog, and Web Dynpro development; and customized Workflow development. You can reach him at [email protected] Tools of The NEW ABAP Debugger In this, the 3 rd and the final installment, I will explore the tools of the NEW ABAP Debugger somewhat in depth. I will explore the tools I feel you will most likely use repeatedly. Please consult theSAP help portal for the New ABAP Debugger to explore any tool further, and learn about any not discussed directly in this blog. The tools of the New ABAP Debugger are optimized for the different debugging situations you may have to deal with during the course of solving a problem. Some of the tools you will recognize from the Classic ABAP Debugger; others are brand new. Before we look at a few of the tools and how to use them, lets first get comfortable with the tools menu and how the tools are organized. If you want to add a new tool to the current desktop, you will get the popup window titled “New Tool” where you can choose the appropriate tool based on your situation. Tweet 5 1 Share 6 Like You might also like... go mobile ab Debugging ABAP for Functional Tea Part 2

The New ABAP Debugger – Part 3 _ IT Partners Blog

  • Upload
    sandeep

  • View
    14

  • Download
    1

Embed Size (px)

DESCRIPTION

The New ABAP Debugger – Part 3 _ IT Partners Blog

Citation preview

  • 4/22/2015 TheNewABAPDebuggerPart3|ITPartnersBlog

    http://www.itpsap.com/blog/2011/08/19/thenewabapdebuggerpart3/ 1/16

    Skiptocontent

    HomeAbout

    Follow:RSS

    ITPartnersBlogSAPTips,TricksandeLearningTags

    abap,businessprocessanalysis,debugger,informationtechnologypartners,new,sapconsulting,saphelp,sapr3,sapsystemsintegration,set,stack,standardtools,to,watchpoint,workflowdevelopment

    TheNewABAPDebuggerPart3byadminonAugust19th,2011

    Recommend This Post!

    AnthonyCecchiniisthePresidentofInformationTechnologyPartners(ITP),anSAPconsultingcompanyheadquarteredinPennsylvania.ITPofferscomprehensiveplanning,resourceallocation,implementation,upgrade,andtrainingassistancetocompanies.Anthonyhasover17yearsofexperienceinSAPR/3businessprocessanalysisandSAPsystemsintegration.HisareasofexpertiseincludeSAPNetWeaverintegrationALEdevelopmentRFC,BAPI,IDoc,Dialog,andWebDynprodevelopmentandcustomizedWorkflowdevelopment.Youcanreachhimatajcecchini@itpsap.com

    ToolsofTheNEWABAPDebugger

    Inthis,the3rdandthefinalinstallment,IwillexplorethetoolsoftheNEWABAPDebuggersomewhatindepth.IwillexplorethetoolsIfeelyouwillmostlikelyuserepeatedly.PleaseconsulttheSAPhelpportalfortheNewABAPDebuggertoexploreanytoolfurther,andlearnaboutanynotdiscusseddirectlyinthisblog.

    ThetoolsoftheNewABAPDebuggerareoptimizedforthedifferentdebuggingsituationsyoumayhavetodealwithduringthecourseofsolvingaproblem.SomeofthetoolsyouwillrecognizefromtheClassicABAPDebuggerothersarebrandnew.Beforewelookatafewofthetoolsandhowtousethem,letsfirstgetcomfortablewiththetoolsmenuandhowthetoolsareorganized.

    Ifyouwanttoaddanewtooltothecurrentdesktop,youwillgetthepopupwindowtitledNewToolwhereyoucanchoosetheappropriatetoolbasedonyoursituation.

    Tweet

    5

    1

    Share

    6

    Like

    Youmightalsolike... gomobileaboutwripl

    DebuggingABAPforFunctionalTeamsPart2

  • 4/22/2015 TheNewABAPDebuggerPart3|ITPartnersBlog

    http://www.itpsap.com/blog/2011/08/19/thenewabapdebuggerpart3/ 2/16

    TheNewABAPDebuggerToolSections

    Thetoolsaregroupedintosections:

    StandardTools:

    SourceCode:Displaycurrentsourcecodeinthebackendeditor.PleasenotethatthisistheoldeditorandIrecommendyoudonotusethis.ThereisanothertoolfartherdownthemenuthatwillusetheNEWEditor

    CallStack:DisplaythecurrentABAPstackandscreenstacks.

    VariableFastDisplay:Displayvariablevalueandtype.

    Breakpoints:Maintainbreakpoints,watchpoints,andcheckpoints.

    SourceCode(EditControl):DisplaycurrentsourcecodeintheNEWABAPFrontEndEditor.ThisistheoptionIrecommendyouusetoenlistallthevaluableenhancementsoftheneweditor.

    DataObjects:

    Object:Display/changeobjectsandclasses.

    Table:Display/changeinternaltables.

    Structure:Display/changestructures.

    SingleField:Display/changevariableswithsimpledatatypes,suchasC,N,D,T,STRING,etc.

    DataExplorer:Displayverycomplexdatastructuresinatreelikefashion.

    Itsworthmentioning,thatifyoudoubleclickonavariabledisplayedinanytool,youwilllaunchthecorrespondingdetailviewdescribedabovethatcorrespondstoitsdatatype.

  • 4/22/2015 TheNewABAPDebuggerPart3|ITPartnersBlog

    http://www.itpsap.com/blog/2011/08/19/thenewabapdebuggerpart3/ 3/16

    SpecialTools:

    WebDynpro:Thestructureofthecontentofthecurrentcontroller,thepropertiesoftheUIelementsinthelayoutofthecurrentviewandthecurrentlyinstantiatedcomponentusages

    LoadedPrograms(GlobalData):Displayallcurrentlyloadedprogramsandtheirglobalvariables.

    MemoryAnalysis:DisplayintegratedMemoryInspectortool(S_MEMORY_INSPECTOR)

    ScreenAnalysis:Displaythescreenattributesandthesubscreenstack.

    DiffTool:Comparevariablesveryquicklytooutlinedelta

    SystemAreas(Internal):DisplaysystemareassuchasSMEM,ABAPMemory,Datasets,ScreenAttributesetc

    OK,letstakeacloserlookatthemostcommondebuggingactivitiesdisplayingsourcecodeandthecallstack,analyzingvariables,andsettingbreakpointsandwatchpoints.

    DisplayingABAPSourcecode

    IbelieveitsimportantthatweareusingtheNewEditorandnottheoldClassicEditor.Tobesureyouareusingtheneweditor,fromtheABAPEditormainscreen(SE38orSE80)followthemenupathUtilities>Settings.VerifythatyouarepositionedontheeditortabandhaveselectedtheradiobuttonfortheFrontEndEditor(New).

    Thereareseveralcompellingreasonsfordoingthis(lookforanupcomingBlogontheNewSAPEditor),thereasonmostrelevantforthisblogisthattheNewABAPDebuggerleveragesthefollowingbenefitsofthenewABAPFrontEndEditor

    ABAPcodeiseasytoreadbecauseofrealtimesyntaxcoloring.Bothverticalandhorizontalfreescrollingispossible.Processingblockstartandend(i.e.,IF/ENDIF,LOOP/ENDLOOP)ishighlightedinrealtime.VariablevaluesandtypesappearinaDataQuickInfopopup.Breakpointsareeasilysetusingabreakpointcolumn

  • 4/22/2015 TheNewABAPDebuggerPart3|ITPartnersBlog

    http://www.itpsap.com/blog/2011/08/19/thenewabapdebuggerpart3/ 4/16

    DisplayingtheABAPCALLStackinTheNewABAPDebugger

    TheCallStacktooldisplaystheABAPcallstack.ItallowsyoutoswitchtothecontextofeachstacklevelandnavigatetothesourcecodebyopeningtheABAPEditor,inordertostartadeeperanalysisofthecodeinaseparatewindow(justdoubleclick!).AlsonewwithSAPNetWeaver2004sistheabilitytodisplaythescreen(Dynpro)stackaswell.Evenmoreimportant,youcandisplayacombinedABAPandscreenstacktofindoutonwhichABAPlevelwhichscreenwascalled,andwhichscreeninvokedwhichABAPmodule.

    Youcannavigatefromeachstacklinetothecorrespondingsourcelineintheeditorbydoubleclickingontheiconinthestacktypecolumn.

    Displayingvariablecontents

    OneofthenewfeaturesoftheNewABAPDebuggeristheVariableFastDisplaytool,whichenablesyoutoviewbasicinformationaboutavariable,suchasthevariabletype,value,hexadecimalvalue,etc.

    Todisplaythisinformation,youselectthetoolandthentypeinthevariablename,oryoucandoubleclickonthe

  • 4/22/2015 TheNewABAPDebuggerPart3|ITPartnersBlog

    http://www.itpsap.com/blog/2011/08/19/thenewabapdebuggerpart3/ 5/16

    variablename(i.e.,thesymbol)inthesourcecodetotransferthesymboltotheVariableFastDisplay.

    Evenmoreconvenientistheabilitytodisplayallglobalvariablesofthecurrentprogramoralllocalvariables(includingtheinterfaceparameters)ofthecurrentprocedure.

  • 4/22/2015 TheNewABAPDebuggerPart3|ITPartnersBlog

    http://www.itpsap.com/blog/2011/08/19/thenewabapdebuggerpart3/ 6/16

    Ifyouareinterestedinaspecialglobalvariableofanotherprogramthatispartoftheapplication,youcanusetheLoadedPrograms(GlobalData)toolbelongingtothespecialtoolscategory,whichallowsyoutobrowseallglobalvariablesofallloadedprograms,notjustthecurrentprogram.

  • 4/22/2015 TheNewABAPDebuggerPart3|ITPartnersBlog

    http://www.itpsap.com/blog/2011/08/19/thenewabapdebuggerpart3/ 7/16

    Thistoolalsoallowsyoutocheckoutwhichprogramshavebeenused(i.e.,loaded)inthecurrentinternalsession.

    OneofthemostsignificantbenefitsoftheNewABAPDebuggeristheabilitytoprovidetailoreddetailviewsforallABAPdatatypes.ThedetailviewsarepartoftheNewABAPDebuggernavigationsystem.Regardlessofthetoolthatisactive,youcannavigatetoadetailviewbysimplydoubleclickingonthevariableinanytool(withtheexceptionoftheSourceCodetool),andthevariableautomaticallyappearsintheappropriatedetailview.

    Forexample,ifwegobacktotheabovediagramforglobalvariablesforthecurrentprogramanddoubleclickonline2oftheMARAstructure,thetooldisplaystheStructureofMARAatthediscretefieldlevel.

  • 4/22/2015 TheNewABAPDebuggerPart3|ITPartnersBlog

    http://www.itpsap.com/blog/2011/08/19/thenewabapdebuggerpart3/ 8/16

    Forverycomplicateddatastructures,suchasacomplexnestedobject,itismoreconvenienttostartananalysisinatreelikedisplaythatallowsyoutodigdeeperanddeeperintotheobjectwithoutlosinginformationaboutthelevelsabove.TheDataExplorertoolprovidesthiscapability.

    BreakPointsandWatchPointsinTheNewABAPDebugger

  • 4/22/2015 TheNewABAPDebuggerPart3|ITPartnersBlog

    http://www.itpsap.com/blog/2011/08/19/thenewabapdebuggerpart3/ 9/16

    WhilebreakpointshavenotchangedmuchbetweentheClassicandNewABAPDebuggers,saveafewenhancements,watchpointshave.Letstakealookateachinturn.

    BreakPoints

    InABAPtherearethreedifferentkindsofbreakpoints,eachofwhichserveaspecificpurpose.InreleasespriortoSAPNetWeaver2004s,onlyonebreakpointiconwasdisplayedinthedebuggertodenoteallthreetypesofbreakpoints.InSAPNetWeaver2004s,threedifferentbreakpointsiconsaredisplayedintheNewABAPDebugger,aswellasintheABAPEditor,soyouknowimmediatelywhichkindofbreakpointyouaredealingwith.

    Youcansetdebuggerbreakpointsinsidethedebugger.Theyexistonlyaslongasthedebuggerisactive.Oncethedebuggerisclosed,alldebuggerbreakpointsaregone.

    Usually,yousetsessionbreakpointsintheABAPEditor.Thescopeofsessionbreakpointsisthecurrentlogonsession.Thismeansthatyoursessionbreakpointsarepresentinallexternalsessions(i.e.,SAPGUIwindows)ofthecurrentlogonsession.IfyouselecttheSavebuttonintheABAPDebugger(inadialoglogonsession),allcurrentdebuggerbreakpointsareautomaticallyconvertedtosessionbreakpoints.

    IfyousetabreakpointinsidethecodingofaWebDynproorBSPapplication,thentheABAPWorkbenchautomaticallysetsauserbreakpoint.UserbreakpointsarestoredintheSAPdatabase,andtheyarevalidforalllogonsessionsofthecurrentuseronthecurrentapplicationserver.Ifyousetauserbreakpoint,thenallfollowinglogonsessionsofthisuserwillhavethosebreakpointsset.

    SettingbreakpointsintheNewABAPDebuggerisnotmuchdifferentfromsettingthemintheClassicABAPDebugger.IfyouclickonthebreakpointiconinthecontrolareaoftheNewABAPDebugger,theCreateBreakpointsdialogappears.HereyouselectwhetheryouwantthebreakpointtooccuratABAPcommands,methods,functions,orforms,orwheneveranexceptioniscaught.Youcanalsosetabreakpointatanarbitrarysourcecodeposition(eveninnotyetloadedprograms).ThiscapabilityisnotavailableintheClassicABAPDebugger.

    Youcangethelpwhenyouaresettingbreakpointsatamethod,function,orformbypressingF4.Forexample,pressingF4intheMethodNamefieldontheMethodtabdisplaysallincludedmethodsofagivenclass.Soevenifyoudonot

  • 4/22/2015 TheNewABAPDebuggerPart3|ITPartnersBlog

    http://www.itpsap.com/blog/2011/08/19/thenewabapdebuggerpart3/ 10/16

    haveallthedetailsaboutthemethodorfunctionmodule,youcanstillsetabreakpoint.IntheClassicABAPDebugger,thereisnosuchhelpavailable.

    UsingthenewBreakpointstool,whichisontheBreak/Watchpointsdesktop,youcanadministerallyourcurrentlysetbreakpoints.Youcancreate,delete,activate,orinactivatebreakpointsusingthistool.IntheNewABAPDebugger,youcantreatthebreakpointsindividually.Forexampleyoucanpromoteanysingledebuggerbreakpointtoasessionbreakpointoranysessionbreakpointtoauserbreakpoint..etc

    WatchPoints

    Awatchpointcanbesetonanyvariablewithlocalorglobalscopetobreaktheexecutionoftheprogramwhenthevariablescontentchanges.Thismakesiteasiertodebugtheprogramsdataflow.

    Inordertocreateawatchpoint,clickontheWatchpointbuttoninthecontrolareaoftheNewABAPDebugger.Inthepopupdialogthatappears,youcanspecifythevariable,thescopeforawatchpointonalocalvariable,andafreecondition.Thescopeforawatchpointonalocalvariablemeansthatyoucansetthewatchpointforonlythecurrentinstanceofthemoduleontheexecutionstackinwhichthelocalvariableexists,orforallinstancesofthismodulethatwillbepushedontothestack.Theabilitytoassociateafreeconditionwiththewatchpointisaconvenientwaytolimitthenumberofwatchpointreachedeventsaccordingtoyourneeds.Whenyouspecifyaconditionalongwithwatchpoints,itisafreestyleconditionforwhichyoucanchoosetwoarbitraryoperands(noneedtospecifythewatchpointvariable,butyoucan)andoneoperator.WritetheconditioninthesamewayyouwouldwriteitinABAP.Youcanusetwobuiltinfunctionsasoperandsinthewatchpointcondition..lines(itab)andstrlen(str)(the

  • 4/22/2015 TheNewABAPDebuggerPart3|ITPartnersBlog

    http://www.itpsap.com/blog/2011/08/19/thenewabapdebuggerpart3/ 11/16

    numberoflinesoftheinternaltableitabandthelengthofthestringstr,respectively).

    Forexample,Iwillsetawatchpointontheinternaltableitab1tobreakwhenitisgreaterthan50linesincontent.

    AllcurrentlysetwatchpointsarelistedintheWatchpointstaboftheBreakpointstool.Hereyoucancreate,edit,delete,activate,orinactivatewatchpoints.Inadditiontoinformationsuchasthevariablename,thescope,andthecondition,youwillfindinthewatchpointlistasymbolfortheoldvariableforallwatchpoints.Thisinformationenablesyoutoviewthevalueofthevariableoftherecentlyhitwatchpointbeforeitwaschanged.Iwillexecutetheabovewatchpointforillustrationofthispoint

    ThefinaltoolIwanttoexploreisthenewDIFFtool.

    Doyourememberthissituation

    Youarehotonthetrailandneedtofindthedifferencesbetweentwotables.UsingtheTablesdesktop,wecaneasilycreatetwotableviewsinordertocomparethetwotables.However,forlargeinternaltables,findingoutthedifferenceswithinanacceptableperiodoftimeisnotaneasytask.

  • 4/22/2015 TheNewABAPDebuggerPart3|ITPartnersBlog

    http://www.itpsap.com/blog/2011/08/19/thenewabapdebuggerpart3/ 12/16

    TheNewABAPDebuggerprovidesaspecialtoolforthistasktheDIFFTool,whichfindsthedifferencesbetweentwoarbitraryABAPdataobjects.Youcancompareinternaltables,structures,strings,orevenobjectsusingtheDIFFTool,whichprovidesthedifferencesconcerningthetypes(e.g.,onetableisasortedtableandtheotherahashedtable),andofcourse,thevalues.

    IwillstarttheDIFFToolfortheinternaltablesitab1anditab2simplyclickontheStartComparisonbutton,andviola,acompletedisplayshowingalistofalldifferencesbetweenthetwotables.

    FinalThoughts

    NowthatyouknowaboutthemostimportanttoolsoftheNewABAPDebugger,Ihopefuturedebuggingtasksareeasierandquickerforyou!Happydebugging!

    HerearelinkstothepriorBlogsinthisseries:

    TheNewABAPDebuggerPart1,clickTheNewABAPDebuggerPart1

    TheNewABAPDebuggerPart2,clickTheNewABAPDebuggerPart2

    IfyouenjoyedthisblogonTheNewABAPDebugger,pleaseclickonthelinkbelowandsignupforournewsletter.WedeliverrelevantSAPTechnicaltips&tricksandcurrentnewsrighttoyourinbox!

  • 4/22/2015 TheNewABAPDebuggerPart3|ITPartnersBlog

    http://www.itpsap.com/blog/2011/08/19/thenewabapdebuggerpart3/ 13/16

    Checkoutarewebchannels

    Recommend This Post!

    FromSAPTools

  • 4/22/2015 TheNewABAPDebuggerPart3|ITPartnersBlog

    http://www.itpsap.com/blog/2011/08/19/thenewabapdebuggerpart3/ 14/16

    TheNewEnhancementFrameworkPart42comments2yearsago

    AvatarAnthonyCecchiniTheinformationinthisandallmyblogsarefromexperienceusingtheIDEtoolortoolsetiam

    AnintroductiontoWebDynproPart23comments2yearsago

    AvatargeekjavaCardandmanymore.higuys,iamabeginnerindevelopmentfield..ihavebeenlookingfrmany

    DebuggingABAPforFunctionalTeamsPart11commentayearago

    AvatarOracleTraininginChennaiThankstoSharetheQTPMaterialforFreshers,qtptrainingchennai

    AGuidetotheNewALVGridControlPart17comments2yearsago

    AvatarJonThanksforthisTony!Readingyourblogwasmuchbetterthansearchingtheinternetforaquick

    ALSOONITPARTNERS,INC

    2Comments ITPartners,Inc Login1

    Share SortbyBest

    Jointhediscussion

    Reply

    AlexZev 2yearsagoHelpmealot,IdidnotknewthepowerofthedebuggerThx

    Reply

    charan 4yearsagoVerygoodcontent.Itwouldbeveryuseful....

    Thanksalotbro.

    WHAT'STHIS?

    Subscribe AddDisqustoyoursited Privacy

    Recommend

    Share

    Share

    Likethisblog?SubscribetoOurNewsletterandhaveitdeliveredtoyourinboxeach

    month!

    FirstName.....

    EmailAddress.....

    Subscribe

    WeRespectYourPrivacy!

  • 4/22/2015 TheNewABAPDebuggerPart3|ITPartnersBlog

    http://www.itpsap.com/blog/2011/08/19/thenewabapdebuggerpart3/ 15/16

    FindusonFacebook

    I.T.Partners,INC

    3,850peoplelikeI.T.Partners,INC.

    Facebooksocialplugin

    Like

    Learnings from "SAP HANA Live Analytics for ERP" and "SAP HANA OA" deployment scn.sap.com/community/rapi

    IT Partners, INC @itpsapinc

    Check out our Technical SAP Blogs for actionable content you can use at your job today! itpsap.com/blog/

    IT Partners, INC @itpsapinc

    Concur PO: Integration centric process for Standard Accounting Extract SAE posting scn.sap.com/community/proc pic.twitter.com/O4h8BFuh2U

    IT Partners, INC @itpsapinc

    25m

    1h

    3h

    Tweets Follow

    Tweet to @itpsapinc

    Categories

    SelectCategory

    Archives

  • 4/22/2015 TheNewABAPDebuggerPart3|ITPartnersBlog

    http://www.itpsap.com/blog/2011/08/19/thenewabapdebuggerpart3/ 16/16

    SelectMonth

    SuggestionsForYou:

    DebuggingABAPforFunctionalTeamsPart2WhatsNewinABAP7.02and7.03Part3WhatsNewinABAP7.02and7.03Part2ABAPDynamicProgrammingPart2ABAPRuntimeAnalysisUsingTheNewSATTransaABAPDynamicProgrammingPart1EvaluatingtheQualityofYourABAPwithCodeABAPRuntimeAnalysisUsingTheNewSATTransaABAPDatabaseSQLAnalysisUsingThePerformanABAPDynamicProgrammingPart3

    About

    Since1993,ITPartnershasbeenprovidingreliable,costeffectivesolutionstomeetourcustomer'sgoalsandobjectivesintheSAPMarketplace.

    WithITPartnersConsultingasyourvaluedbusinesspartner,yougettheexpertisenecessarytocreateandrealizebusinessvalue,andtorunSAPprojectssuccessfully.Ourconsultantshelpreducetimetovalue,lowertotalcostofownership,andimprovethereturnonyourSAPsoftwareinvestment.

    Tags

    7.03abapABAPQualityabapskillsblogsbusinessclientbusinessprocessanalysisCodeInspectorconsultingcompanycontrolstechnologydebuggerdebuggertoolsdebuggingdialogenhancementenhancementsExtendedProgramCheckframeworkguiininformationtechnologypartnersITPartnersITstaffingMemoryAnalysisMemoryInspectormessagetypesnewOpenSQLRollAreaRuntimeAnalysisinABAPsapsapconsultingsapguisapidocsapidocssapnetweaversapr3SAPstaffingsapsystemsintegrationSATSLINtechnologyframeworkwebdynproworkflowworkflowdevelopment

    Search

    Search

    Copyright2015InformationTechnologyPartners.TitanThemebyTheThemeFoundry.