You are on page 1of 5

01/07/2016

LearnSAPABAPProgrammingTips&Techniques:ToolsusedforPerformancetuningandcodingtipsforperformance
0

More NextBlog

mahendra.avuthu@gmail.com Dashboard SignOut

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

Recommend this on Google

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

You might also like