Learn SAP ABAP Programming Tips & Techniques - Tools Used For Performance Tuning and Coding Tips For Performance
Learn SAP ABAP Programming Tips & Techniques - Tools Used For Performance Tuning and Coding Tips For Performance
LearnSAPABAPProgrammingTips&Techniques:ToolsusedforPerformancetuningandcodingtipsforperformance
0
More NextBlog
LearnSAPABAPProgramming
Tips&Techniques
LearnBasicSAPABAPprogramming,Performancetuning,Runtimeanalysis,SQLtrace,Codeinspector,
Debugging,NewconceptsinABAPandCoreABAPconceptslike..Classical,ALV,Interactivereporting,BDC
programming,SAPSCRIPTS,SMARTFORMS,BADI,BAPIandmore...
Wednesday,14March2012
AboutMe
ToolsusedforPerformancetuningandcodingtipsfor
performance
CertifiedSAPABAPConsultant
Performancetuningtools:
BlogArchive
1)SE30Runtimeanalysis:TheruntimeanalysistoolisanABAPworkbenchtoolusedfor
analyzingtheperformanceofanABAPprogramortransaction.
ThetoolmeasuresthestatementsthatareexpensiveintermsofCPUtime.Mainlythestatement
usedfordatabaseaccess(Selectstatements),Modularization(Perform,callfunction)and
internaltablestatementslikeappend,clear,collectetc...
SatishM
Viewmycompleteprofile
2012(5)
March(5)
Toolsusedfor
Performanc
etuning
andcoding
tips...
Thetoolwilldisplaytheinformationregardingexecutedinstruction,accessedexecutiontime,
tablesandtypesofaccess.
DATATYPES
ANDKEY
WORDSIN
ABAP
TostartthetoolgototcodeSE30
ABAPReports
Basic
Knowledge
onData
Dictionary
Objects
Workbench
toolsand
otherbasic
definitions
Entertherespectiveobjectnameeitherprogramnameortcodeyouwantedaruntimeanalysis
andclickonexecute.
Youwillgetyouprogramortcodeselectionscreen.Givetheinputandclickonexecute.
Theoutputisdisplayed.
http://abapprogrammingtechniques.blogspot.in/2012/03/toolsusedforperformancetuningand.html
1/5
01/07/2016
LearnSAPABAPProgrammingTips&Techniques:ToolsusedforPerformancetuningandcodingtipsforperformance
Clickonbackbuttontillyouarebackinse30tool.
Hereclickonevaluatetochecktheanalysisreport.Hereinthegraphyouwillfindtheoverall
executiontimeinmicroseconds,ABAPspecifiesthetimeconsumedbytheABAPstatements
likeloopoperationsreadoperations,stringoperationsetc..
Database:specifiesthetimeconsumedforthedatabaseoperationlikeselectstatements.Usually
thecolorshouldbeingreenforthebetterperformanceoftheprogram.
System:Specifiesthetimeconsumedforthesystemstatements.Likeloadingthedynpros,
reportsetc..
http://abapprogrammingtechniques.blogspot.in/2012/03/toolsusedforperformancetuningand.html
2/5
01/07/2016
LearnSAPABAPProgrammingTips&Techniques:ToolsusedforPerformancetuningandcodingtipsforperformance
Clickongoto>hitlist..youwillgetthebelowscreenwithhitlistanalysis.Sortthecolumn
NETindescendingordertoknowthemostexpensivehits.Numberindicatesthenooftimesthe
statementwasexecutedandGrosstimesspecifiesthetimetakenforalltheinternalcalls.Where
asnettimespecifiesthetimetakefortheactualcall.
Callhierarchywilldisplaythechronologicallistwiththeflowofcallduringtheruntime.
2)SQLTraceST05:Thisisatoolusedtoanalyzethedatabasecallsmadeinreports,
transactionsetc.
***willexplainhowtousethetooltoimprovetheperformancewithanexample**
Codingtipsforperformancetuning:
1)Alwaysdeclareyourinternaltablesandworkareasusing"TYPES:"keyworkinsteadusing
"DATA:".BecauseTypes:willnotallocateanymemory.DATA:willallocatememory
Ex:TYPES:Beginoftyp_kna1,
kunnrtypekunnr,
name1typename1,
......
.....
endoftyp_kna1.
TYPES:tab_typ_kna1typestandardtableoftyp_kna1INITIALSIZE0.
DATA:it_kna1typetab_typ_kna1,"internaltabledecleration
wa_kna1typetyp_kna1."wadeclaration
2)Avoidusingimplicitworkareasanduseexplicitworkareasallthetime.
3)Alwaysdeclaretheinternaltableusedtofetchdatafromtablesusingselectqueriesaccording
tothefieldordermaintainedinthedatabasetable.
ex:thefieldsofinternaltableit_kna1declaredasperthefieldorderindatabasetableinkna1
4)Similarlythesameordershouldbemaintainedintheselectquery
ex:selectkunnr
name1
.....
....
http://abapprogrammingtechniques.blogspot.in/2012/03/toolsusedforperformancetuningand.html
3/5
01/07/2016
LearnSAPABAPProgrammingTips&Techniques:ToolsusedforPerformancetuningandcodingtipsforperformance
fromkna1
intotableit_kna1
wherekunnrins_kunnr.
5)Similarlyinthewhereclauseoftheselectquerycheckifanyprimarykeyisbeingpassedas
inputtotheprogramthenusetheprimarykeyelsecheckifanysecondaryindexavailableforthe
inputvalue.makesureagainthefieldorderofthetableisnotdisturbedinthewhereclauseas
well.
iIntheaboveexampleconsideringthes_kunnrasaninputvalueandkunnrisaprimarykeythe
quryisbiutusingaprimaryindex.nthesamescenarioifihavename1asmyinputvaluetothe
program.Iwouldprefertocheckifanysecondayindexisavailbleonfieldname1.IfyesIwill
changemyquerylikebelow
selectkunnr
name1
.....
....
fromkna1
intotableit_kna1
wherename1ins_name1.
ifnoneoftheinputisavailableweshalldeclarearangeoffiledtypekunnrandwewillforcethe
primaryindexforthequery.
ex:
DATA:range_kunnrTYPERANGEOFkna1kunnr,
selectkunnr
name1
.....
....
fromkna1
intotableit_kna1
wherekunnrinrange_kunnr.
6)Anotherimportantpointforsecondaryindexisthatiftherearefourfieldsintheindexallthe
fourfieldsshouldbeusedinthewhereclauseofthequerytomakethedatabasehotbasedon
thesecondaryindex.Inthisscenariowewillfollowtheaboveapproach.i.e.declareadummy
rangeforthefieldsthatarepartofindexifnoinputvaluesavailabletouseinwhereclause.And
usetheminthewhereclauselikeinaboveexample.
PostedbySatishMat12:55
Nocomments:
PostaComment
http://abapprogrammingtechniques.blogspot.in/2012/03/toolsusedforperformancetuningand.html
4/5
01/07/2016
LearnSAPABAPProgrammingTips&Techniques:ToolsusedforPerformancetuningandcodingtipsforperformance
Enteryourcomment...
Commentas:
Publish
Unknown(Google)
Signout
Notifyme
Preview
Home
OlderPost
Subscribeto:PostComments(Atom)
Simpletemplate.PoweredbyBlogger.
http://abapprogrammingtechniques.blogspot.in/2012/03/toolsusedforperformancetuningand.html
5/5