Transcript
  • 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.