Vous êtes sur la page 1sur 6

SAP Note

Header Data
Symptom
Document at i on f or t r ansact i on ST12

Other Terms
ST12 " Si ngl e t r ansact i on anal ysi s" f or SAP Ear l yWat ch/ Goi ngLi ve, Addon ST- A/ PI , ABAP t r ace, cont ext
t r ace

Reason and Prerequisites
Tr ansact i on ST12 " Si ngl e t r ansact i on anal ysi s" f or SAP Ear l yWat ch/ Goi ngLi ve

Not e t hat t he ST12 ABAP t r ace t r ansact i on i s not of f i ci al l y document ed and onl y avai l abl e i n Engl i sh
l anguage. I t i s mai nl y i nt ended f or use by SAP or cer t i f i ed Ser vi ce consul t ant s dur i ng SAP Ser vi ce
Sessi ons ( f or exampl e SAP Goi ngLi ve Check or Sol ut i on Management Opt i mi zat i on Ser vi ces) .

Solution
Cont ent s

I. Introduction
II.Basics of ABAP trace (for beginners)
III. ST12 in comparison to SE30 (delta course)
IV.How to use ST12
V. Trouble- shoot i ng

I . I nt r oduct i on
1. Mot i vat i on
ST12 was devel oped t o pr omot e t he usage of ABAP t r ace, t o i nt egr at e ABAP and per f or mance t r aces ( SQL
Enqueue RFC, t r ansact i on ST05) and t o make t he t r aci ng and anal ysi s pr ocess f ast er and mor e
conveni ent . ABAP t r ace wi t h ST12 i s t he cent r al ent r y poi nt f or per f or mance anal ysi s. I t shoul d be
used t o det ect t op- down any per f or mance hot spot , f or f unct i onal t i me di st r i but i on anal ysi s, and t o
opt i mi ze ABAP/ CPU bound i ssues. SQL t r ace shoul d be used f or DB bound i ssues.

ST12 i s si mi l ar t o a combi nat i on of t he st andar d ABAP and SQL t r ace
t r ansact i ons SE30 and ST05.
2. Over vi ew
ST12 combi nes ABAP and per f or mance ( SQL) t r ace i nt o one t r ansact i on, wi t h maj or f unct i onal
enhancement s especi al l y f or t he ABAP t r ace par t . I n a j oi nt swi t ch on/ of f wi t h t he per f or mance
t r ace, ST12 al l ows t o act i vat e t he ABAP t r ace f or anot her user. Li ke t hi s an SAP Ser vi ce Engi neer
can t r ace a di al og t r ansact i on t hat i s execut ed by a busi ness user of t he cust omer and does not need
own sampl e dat a. ABAP and per f or mance t r aces can be act i vat ed on anot her ser ver or even on al l
ser ver s t o cat ch e. g. i ncomi ng RFCs.
ST12 makes i t easy t o keep val uabl e t r ace r esul t s and pass t hemon e. g. t o SAP backof f i ce. The ABAP
t r ace r esul t s ar e compl et el y col l ect ed t o dat abase.For Performance trace ST12 remembers
t i mef r ame&ser ver , and one cl i ck navi gat es di r ect l y i nt o t he ST05 t r ace di spl ay on t he pr oper ser ver .
Sel ect ed r esul t s f or mper f or mance t r ace and ot her f i ndi ngs can be saved as annot at i on t ext s i nt o a
t r ace anal ysi s.
The ST12 ABAP Tr ace Summar y qui ckl y shows t he cont r i but i on of known expensi ve f unct i onal i t i es. I t
i s al so abl e t o est i mat e t he t i me cont r i but i on of cer t ai n pr ogr ams, esp. user exi t s and cust omer
codi ng.
Wi t h ST12 t he pr ogr am hi er ar chi es can be anal yzed i n t he aggr egat ed ABAP t r ace ' per cal l ' .
Ther ef or e t he non- aggr egat ed ABAP t r ace wi t h i t s l ar ge t r ace f i l e si zes i s not needed and was
omi t t ed f r omST12.

755977 - ST12 "ABAP Trace for SAP EarlyWatch/GoingLive"
Version 6 Validity: 28.02.2006 - active Language English (Master)
Released On 28.02.2006 22:06:35 By Peter Petrenz (D031878)
Release Status Released for Customer
Component SV-BO Backoffice Service Delivery


BC-CCM-MON-TUN Performance Monitors (TCC)
Priority Recommendations / Additional Info
Responsible Bernd Bayerlein ( D027971 )
Processor Peter Petrenz ( D031878 )
Category Special development
Relevant for Translation Yes
Other Components

ST12 al l ows t o swi t ch on/ of f and di spl ay ABAP t r aces l i ke SE30 but
l wi t hout t he non- aggr egat ed ABAP t r ace
l wi t h new possi bi l i t i es t o act i vat e t he t r ace
f or a user name & t ask t ype
on al l ser ver s t o cat ch e. g. an i ncomi ng RFC
t r ace BSP pages or many i ncomi ng RFCs
l wi t h new eval uat i on possi bi l i t i es f or t he aggr egat ed t r ace
t op- down cal l t r ee
but t om- up cal l hi er ar chy
l ast changed by & on
shor t t ext s f or f unct i onal anal ysi s
l t r aces ar e st or ed cent r al l y and per manent l y t o DB
l wi t h bet t er suppor t f or ' Cont ext t r ace' accr oss RFCs
3. Avai l i bi l i t y
Tr ansact i on ST12 i s avai l abl e as of basi s r el ease 4. 6B. I t i s del i ver ed vi a t he addon ST- A/ PI
( Appl i cat i on ser vi cet ool s f or Ear l yWat ch/ Goi ngLi ve, see not e 69455) . The ST- A/ PI ver si on shoul d be
01F* or hi gher .
The f eat ur e t o swi t ch on t he ABAP t r ace f or anot her user r equi r es
- > on basi s 4. 6*: Addon ST- A/ PI >= 01F*, Ker nel 46D pat chl evel >= 1805
- > on basi s 6. x: Addon ST- A/ PI >= 01G*, Ker nel 640 pat chl evel >= 83
- > on basi s 7. 0 or hi gher : Addon ST- A/ PI 01G*
4. Out l ook: " Si ngl e t r ansact i on anal ysi s"
I t i s pl anned f or t he f ut ur e t o i ncl ude SQL/ per f or mance t r ace handl i ng, st at i st i cal r ecor ds and t he
SQLR t r ansact i on f unct i onal i t y i nt o ST12.

I I . Basi cs of ABAP t r ace ( f or begi nner s)
1. Gener al
ABAP t r aces measur es t wo di f f er ent t hi ngs. The f i r st ar e cer t ai n si mpl e and possi bl y expensi ve ABAP
st at ement s l i ke dat abase accesses and st at ement s on i nt er nal t abl es. These ar e easy t o under st and.
The second ar e cal l s t o modul ar i zat i on uni t s l i ke per f or m, cal l f unct i on/ met hod, cal l scr een or PAI
PBO modul es. These ar e compl ex because t hey ar e hi er ar chi cal cont ai ner s and r esembl e nest ed r ussi an
puppet s. Thei r hi er ar chi es can br anch and al so mer ge agai n.
2. Gr oss t i me vs. Net t i me
For modul ar i zat i on uni t cal l s, t her e exi st s a di f f er ence bet ween gr oss and net t i me. Gr oss t i me i s
t he summar i zed t i me over al l cal l execut i ons. Net t i me i s t he gr oss t i me
minus the time when this mod.unit calls other mod.units
minus the durations of simple statements that occur within this modularization unit AND that are
expl i ci t el y measur ed.
The addi t i on ' expl i ci t el y measur ed' i mpl i es t hat net t i me can depend on t he measur ement scope. E. g.
wi t h t r ace scope ' wi t h i nt er nal t abl es' t he net t i mes of mod. uni t s can be l ower because dur at i ons of
st at ement s on i nt er nal t abl es ar e al so deduct ed. Li ke t hi s t he t ot al sumof net t i me per cent ages
al ways r emai ns 100%.
Gr oss t i mes ar e used t o get a t op- down over vi ew. Mod. uni t names of t en gi ve a good i ndi cat i on what
happens bel ow t hem, so t hat t hei r gr oss t i me can be at t r i but ed t o a cer t ai n f unct i onal i t y. Sor t i ng
by net t i mes shows si ngl e expensi ve st at ement s or mod. uni t s t hat t hemsel ves consume much execut i on
t i me.
3. Aggr egat i on l evel s
The non- aggr egat ed ABAP t r ace, whi ch i s not of f er ed i n ST12, woul d cont ai n one l i ne per
st at ement / cal l execut i on.
' Per cal l i ng posi t i on' i s t he def aul t i n ST12. I t aggr egat es t he t r ace per sour cecode posi t i on of a
st at ement or mod. uni t cal l . A codi ng
line 150PERFORM A.
line 151DO 100 TIMES.
line 152PERFORM A.
line 153ENDDO.
woul d l ead t o t wo ' PERFORM A' l i nes i n t he t r ace wi t h 1 and 100
execut i ons and aggr egat ed execut i on t i me. Thi s aggr egat i on st i l l al l ows t o anal yze hi er ar chy
r el at i ons.
' Ful l ' aggr egat i on i s per st at ement and pr ogr am. I t i s compar abl e t o t he st at ement summar y f or t he
SQL t r ace i n t r ansact i on ST05.
For t he aggr egat i on ' Per modul ar i zat i on uni t ' see next chapt er .
4. ABAP t r ace opt i ons
The f l ag ' wi t h i nt er nal t abl es' ext ends t he t r ace scope t o st at ement s on i nt er nal t abl es l i ke r ead
t abl e, l oop at or sor t .
The f l ag ' Par t i cul ar uni t s' can be set i n t he ' Cur r ent mode' scenar i o i n or der t o t r ace onl y one
di al og st ep of a t r ansact i on. When t he t r ansact i on i s st ar t ed f r omST12, t he ABAP t r ace does not yet
st ar t . I t i s act i vat ed bef or e and deact i vat ed af t er t he di al og st ep usi ng ' Syst em- >Ut i l i t i es-
>Runt i me anal ysi s- >Swi t ch on/ of f ' .
The ' Fi l t er f or pr ogr ampar t ' r est r i ct s t he ABAP t r ace t o t he pr ocessi ng i nsi de and bel ow one
speci f i c modul ar i zat i on uni t .
5. Compar i son t o t he SQL t r ace wi t h t r ansact i on ST05
SQL t r ace i s wr i t t en wi t hout aggr egat i on. ST05 t r aces ever y act i on of a user on a ser ver , ABAP t r ace
onl y one user cont ext or t r ansact i on. SQL t r ace needs t o be swi t ched of f , ABAP t r ace ends wi t h t he
t r aced t r ansact i on. ST05 wr i t es t r ace f i l es i nt o t he l ocal f i l esyst emand over wr i t es t hem
ci r cul ar i l y, ST12 st or es i t s anal yses cent r al l y and per manent l y t o dat abase. SQL t r ace gi ves a
but t om- up gl i mpse what t he t r ansact i on i s doi ng and i s sui t abl e f or DB bound per f or mance i ssues,
ABAP t r ace pr ovi des a t op- down over vi ew and can det ect any per f or mance hot spot . For t he i ssues
det ect ed wi t h SQL t r ace of t en an easy t echni cal t uni ng i s possi bl e, wher eas ABAP i ssues of t en
i nvol ve cust omer messages and codi ng changes.

I I I . ST12 i n compar i son t o SE30 ( del t a cour se)
1. Si mpl i f i cat i ons i n ABAP t r ace opt i ons
The non- aggr egat ed ABAP t r ace i s not of f er ed i n ST12. One r eason i s t hat f or most busi ness
t r ansact i ons i t gr ows t oo l ar ge, anot her t hat t he new hi er ar chy anal ysi s f eat ur es i n ST12 make i t
l ar gel y super f l uous.
The st ar t opt i ons ar e much si mpl er t han i n SE30. Per def aul t one has aggr egat i on ' per cal l i ng
posi t i on' and a t r ace scope l i ke i n t he DEFAULT var i ant i n SE30, i . e. t r aci ng modul ar i zat i on uni t s
and DB oper at i ons. For t he f l ags ' Wi t h i nt er nal t abl es' and ' Par t i cul ar uni t s' see chapt er above.
Rest r i ct i on t o one modul ar i zat i on uni t i s possi bl e. Some mor e r ar el y used opt i ons ar e avai l abl e as a
popup.
2. Tr ace st ar t possi bi l i t i es
Thr ee scenar i os ar e of f er ed:
l The ' User ' scenar i o al l ows t o act i vat e t he ABAP t r ace f or t he next act i on under a cer t ai n user
name and t askt ype ( DI A BTC RFC UPD) on any appl i cat i on ser ver or syst emwi de.
I n sl i ght di f f er ence t o t he SQL t r ace i t does not t r ace ever yt hi ng under t he user name, but t he
t r ace i s swi t ched on f or onl y one user cont ext t hat does t he next r ol l - i n and t hat has t he
pr oper user &t askt ype. The t r ace t hen l ast s unt i l t hi s user cont ext / t r ansact i on i s f i ni shed.
Choose ' < Al l Ser ver s >' i n t he ser ver f i el d i n or der t o t r ace t he next such act i on
syst emwi de. The t r ace r equest i s t hen di st r i but ed t o al l ser ver s. On each r ef r esh, ST12 checks
whet her a t r ace has st ar t ed t o r un on any ser ver . I f yes, t hen ' < Al l Ser ver s >' i s r epl aced by
t he expl i ci t ser ver name and t r ace r equest s on ot her ser ver s ar e cl ear ed. Thi s enabl es e. g. t o
cat ch an i ncomi ng RFC or a bat ch j ob t hat st ar t s on any ser ver .
Pr er equi si t e f or t he whol e ' User ' scenar i o i s a ker nel pat ch. See ' Avai l i bi l i t y' above.
l The ' Tasks&HTTP' scenar i o i s avai l abl e as of SAP basi s 6. 10. I t al l oes t o speci f y a max. number
of ABAP t r ace act i vat i ons=ABAP t r ace f i l es, and i s t her f or e sui t abl e t o t r ace many i ncomi ng RFCs
or BSP pages, wher e ever y scr een el ement makes an own cal l t o t he R/ 3 syst em.
l ' Wor kpr ocess' , l i ke ' Par al l el mode' of SE30, i s used t o t r ace par t s of l ongr unni ng pr ocessi ng,
esp. bat ch j obs, f r oman SM50 l i ke pr ocess l i st .
l I n t he ' Cur r ent mode' scenar i o t he t r ansact i on t o be anal yzed has t o be st ar t ed f r omST12, so
sampl e dat a ar e r equi r ed l i ke i n SE30.
3. Tr ace col l ect i on and admi ni st r at i on of saved t r aces
ST12 ' col l ect s' t he ABAP t r ace f r omt he l ocal f i l esyst emand st or es i t t o dat abase as a ' t r ace
anal ysi s' . Thi s makes t he t r ace cent r al l y and per manent l y avai l abl e, whi ch i s a gr eat advant age when
passi ng on t he t r ace t o ot her l evel s f or f ur t her anal ysi s. I n t he ' User ' or ' Wor kpr ocess' scenar i o
t he asynchr onous t r ace col l ect i on i s t r i gger ed by pr essi ng t he ' End & col l ect t r ace' but t on.
Conveni ent sear ch f eat ur es ar e i ncl uded.
4. Eval uat i on
Eval uat e - > ABAP Tr ace shows t he aggr egat ed hi t l i st . New f eat ur es i n compar i son t o SE30 ar e:

a) Toggle between three aggregation levels
The ent r y di spl ay shows t he t r ace ' Per cal l i ng posi t i on' . Usi ng t he f i r st t wo but t ons or t he menu,
one can swi t ch t o ot her aggr egat i ons. The second l evel i s ' Ful l ' .
The new aggr egat i on ' Per modul ar i zat i on uni t ' i s a ki nd of mi xt ur e of bot h. On an upper l evel i t
shows onl y one l i ne f or ever y modul ar i zat i on uni t . When such a l i ne i s expanded, t he st at ement s and
cal l s i nsi de t hi s mod. uni t ar e shown i n aggr egat i on ' per cal l i ng posi t i on' . St at ement s and cal l s
out si de of mod. uni t s ar e gr ouped bel ow dummy l i nes ' <pr ogr am> [ out si de of mod. uni t s] ' . The net t i mes
of si mpl e st at ement s ar e added t o t he net t i me of t hei r upper l evel mod. uni t . Thi s aggr egat i on i s
sui t abl e t o det ect l ocal i zed i ssues i n si ngl e mod. uni t s.

b) Top down call tree and Buttom- up cal l hi er ar chy
Use t he aggr egat i on ' Per cal l i ng posi t i on' t o anal yze cal l hi er ar chy r el at i ons:
- > ' But t om- up cal l hi er ar chy' wor ks l i ke a mul t i - l evel wher e- used sear ch. The hi er ar chy above an
ent r y i s di spl ayed i n f or mof a swi mmi ng l ane di agr am. The empt y di amond symbol s show wher e a cal l
i s i ssued, t he f i l l ed up/ down t r i angl es wher e i t ar r i ves. The smal l ar r ows bet ween t hemar e pur e
cosmet i cs, i l l ust r at i ng t he cal l di r ect i on. The exact meani ng i s: " Out of modul ar i zat i on uni t <empt y
di amond> a cal l t o modul ar i zat i on uni t <f i l l ed up/ down t r i angl e> i s i ssued. ' .
- > ' Top down t i me spl i t hi er ar chy' shows t he ~30 most i mpor t ant bel ow an ent r y i n a swi mmi ng l ane
di agr am. I mpor t ance i s measur ed i n t er ms of how much aggr egat ed t i me f l ow t hey r ecei ve f r omt he
or i gi nal ent r y. The subor di nat e modul ar i zat i on uni t s ar e gr ouped i nt o di st i nct br anches, i t i s shown
how t hey ar e l i nked t o t he or i gi nal ent r y and wher e t he t i me f l ow spl i t s up ( sever al emt py di amonds
i n t he l i ne) . Thi s i s ver y hel pf ul f or t i me di st r i but i on and f or t i me- l ost anal ysi s.
- > For t he ' Top down cal l t r ee' , put t he cur sor on a modul ar i zat i on uni t cal l ( per f or mor cal l
met hod/ f unct i on/ scr een) and pr ess t he t r ee but t on. The hi er ar chy bel ow i s t hen di spl ayed i n a new
col umn. Al l cal l s t o t hi s mod. uni t ar e l abel ed ' 0' , i ncl udi ng t he one wher e you put your cur sor . ' 1'
ar e st at ement s i nsi de t hi s mod. uni t , ' 2' t he st at ement s i n mod. uni t s one l evel bel ow, and t hen
i t er at i vel y down up t o 30 l evel s. Let t er s ar e used t o desi gnat e l ower l evel s.

I n bot h cases t he t r ace l i nes i n t he hi er ar chy ar e mar ked wi t h col or . The ' Onl y cal l t r ee/ cal l
hi er ar chy f i l t er ' but t on set s an ALV l i st f i l t er so t hat onl y t r ace ent r i es i n t he hi er ar chy ar e
di spl ayed. ' Of f ' but t ons make t he hi er ar chy col umns di sappear .
Remar ks:
The hi er ar chy onl y consi der s cal l s t o f or ms, met hods, f unct i ons and cal l scr een t o PBO PAI modul es.
I t does not go acr oss submi t s or ABAP event s.
The second r est r i ct i on r ef l ect s t hat t echni cal l y onl y t he hi er ar chy r el at i ons one l evel up/ down ar e
known f or sur e. An exampl e t o i l l ust r at e: Assume an ABAP pr ogr amhas f or mr out i nes A1 and A2 t hat
bot h cal l a f or mB wi t h a di f f er ent i nput par amet er . When cal l ed by A1, B cal l s a f or mC1. When
cal l ed by A2, B cal l s a f or mC2. Now when you put t he cur sor on ' Per f or mA1' , t he t op- down cal l t r ee
wi l l cont ai n not onl y B and C1 but al so C2, whi ch i s cal l ed by B but i n r eal i t y not when B was
cal l ed by A1. Li kewi se when you put t he cur sor on a ' Per f or mC1' , a but t on- up cal l hi er ar chy wi l l
cont ai n f or ms B and A1 but al so A2.
I t can al so happen t hat al t hough f or mB i s cal l ed by f or mA1, B st i l l appear s hi gher i n t he l i st
sor t ed by gr oss t i me because B i s al so cal l ed by A2.
c) last changed by & on
' Show/ hi de- >Last changed by' r et r i eves ' Last changed by' user names and change dat es f r omt he ABAP
r esposi t or y. For si mpl e st at ement s i t di spl ays t he change i nf o of t he sur r oundi ng sour cecode
i ncl ude. For mod. uni t cal l s t he i nf o r el at es t o t he t ar get i ncl ude t hat cont ai ns t he cal l ed
mod. uni t . Thi s makes i t easy t o det ect any user exi t or cust omer modi f i cat i on. Even cust omer cl ai ms
t hat somet hi ng woul d go sl ower si nce a cer t ai n dat e can be ver i f i ed her e.

d) short texts for functional analysis
' Show/ hi de- >Shor t t ext s' f r omt he menu r et r i eves t i t l es of f unct i ons, met hods, f unct i on gr oups,
r epor t s, cl asses, dynpr os or t abl es f r omt he ABAP r eposi t or y and di spl ays t hem. Toget her wi t h t he
t echi cal names of f or ms f unct i ons et c. t hey pr ovi de t he basi s f or a f unct i onal t i me di st r i but i on
anal ysi s. I f Engl i sh t i t l es ar e not avai l abl e, Ger man or ot her s ar e di spl ayed.

e) internal table names resolved, select statements compressed
I nt er nal t abl e names ar e shown as i n t he sour cecode. Open+Fet ch+Cl ose ar e aggr egat ed t o one l i ne
' Sel ect ' et c.

f) Other features
The header ar ea i n t he eval uat i on scr een can be col l apsed. The ' Show/ hi de' menu al l ows t o di spl ay
t he 2nd par t of l ong cal l t ext s or t he cal l i ng pr ogr amand pr ovi des a conveni ent way t o or gani ze t he
col umns. A ' Top500 cal l s f i l t er ' pr ovi des a f ast er t r ace di spl ay. Sour cecode di spl ay and t he usual
ALV f eat ur es l i ke sor t i ng, f i l t er i ng and sums ar e avai l abl e l i ke i n SE30.
5. ' Cont ext t r ace' acr oss RFCs and r emot e t r ace col l ect i on
ABAP t r ace can be i nher i t ed vi a RFC, so t hat r emot e act i vi t i es al so get t r aced. As pr econdi t i on,
bot h or i gi n and r emot e syst emneed t o have a basi s r el ease as of 6. 10. The par amet er
r st r / accept _r emot e_t r ace has t o be set t o ' t r ue' i n t he r emot e syst em. On basi s r el eases 6. 10 and
6. 20 t hi s par amet er has t o be changed i n t he pr of i l e mai nt enance RZ10, and t he appl i cat i on ser ver
needs t o be r est ar t ed t o make i t ef f ect i ve. Fr ombasi s 6. 40 i t can be swi t ched dynami cal l y t o ' t r ue'
usi ng t r ansact i on RZ11. Not e t hat i t shoul d not be set t o ' t r ue' per manent l y, si nce t hi s mi ght cause
unwant ed t r ace i nher i t ance e. g. by cer t ai n ext er nal i nt er f aces. Especi al l y t he per manent change i n
RZ10 shoul d be changed back t o ' f al se' af t er t r aci ng i s f i ni shed.
St ar t t he t r ace f r omST12 wi t h t he f l ag ' Cont ext t r ace' on. When t he or i gi nal t r ansact i on makes
RFCs, t hese RFCs t hen wr i t e own ABAP t r acef i l es i nt o t hei r ser ver f i l esyst ems. To col l ect t hem,
pr ess ' Col l ect ext er nal t r aces' i n t he f i r st l i ne of ST12. Ent er an RFC dest i nat i on t o t he r emot e
syst em. Ent er a t i mef r ame, or cl ear i t t o f i nd al l f i l es. Then pr ess ' St ar t ' t o sear ch f or sui t abl e
t r acef i l es on al l ser ver s of t he r emot e syst em. Sel ect t he pr oper f i l e and pr ess ' Col l ect ' . The
t r acef i l e i s t hen f et ched r emot el y and st or ed as a new t r ace anal ysi s.
6. ABAP t r ace summar y
I t i s pl anned t o pr ovi de a summar y f or t he ABAP t r ace as t he SQLR does f or t he SQL t r ace, showi ng
t he per cent ages of l ogi st i cs f unct i ons l i ke pr i ci ng or avai l abi l i t y check wi t h t he same f unct i on
t ext s as i n SQLR.

I V. When and how t o use ST12 ABAP t r ace

Tr ansact i on opt i mi zat i on i n Ear l yWat ch/ Goi ngLi ve used t o r el y heavi l y on t he SQL t r ace. ABAP t r ace
was r ecommended onl y t o anal yze gaps i n t he SQL t r ace or pur e CPU i ssues.
Thi s i s no l onger val i d al r eady si nce SAP r el ease 4. 6B. Especi al l y f or f or det ect i on and anal ysi s of
per f or mance i ssues, ABAP t r ace i s f ar mor e sui t abl e t han SQL t r ace or SQLR. ABAP t r ace wi t h ST12 can
and shoul d be used t o
l i dent i f y t op- down any per f or mance hot spot and get an exact f unct i onal t i me di st r i but i on
l f i nd cust omer modi f i cat i ons and user exi t s
l det ect i ssues i n t he cal l hi er ar chy
l sear ch f or l ocal i zed t echni cal t uni ng pot ent i al , e. g. CPU- expensi ve ABAP st at ement s
1. Top- down gr oss t i me anal ysi s
Sor t by gr oss t i me. Concent r at e on modul ar i zat i on uni t s t hat t ake l ong enough t o be wor t h f or
opt i mi zat i on ( mi n. 5 % gr oss t i me) but ar e smal l enough t o cor r espond t o j ust one speci f i c
f unct i onal i t y. Use t he t op- down t i me spl i t hi er ar chy or but t om- up cal l hi er ar chy but t ons t o f i nd out
whi ch of t hese i nt er est i ng ent r i es ar e hi er ar chi cal l y r el at ed, i n or der t o gr oup t hemi nt o di st i nct
f unct i onal br anches.
Then l ook at t he f or m/ met hod/ f unct i on names and use ' Show/ hi de- >Shor t t ext s' t o get an i dea what
t hese di st i nct f unct i onal br anches ar e doi ng. E. g. i n sal es or der ent r y VA01 ever yt hi ng bel ow
f unct i on PRI CI NG i s pr i ci ng, f unct i on AVAI LI BI LI TY_CHECK does t he ATP check, f unct i on RV_TEXT_COPY

i s t ext det emi nat i on et c. Thei r gr oss per cent ages gi ve you exact l y t he f unct i onal t i me di st r i but i on.
Now ask your sel f whet her one of t heml ooks t oo expensi ve or st r ange. 50% gr oss t i me f or f unct i on
PRI CI NG ? 95% f or a f or mDYNAMI C_CREDI T_CHECK ? 91% f or t he DDI C f unct i on modul e DDI F_TABL GET i n a
PS t r ansact i on ?
Those ar e opt i mi zat i on candi dat es. On t he ot her hand i f t i me i s wel l spl i t over onl y t he expect ed
f unct i ons and not hi ng pops out , t hen t her e i s no opt i mi zat i on pot ent i al .
2. User exi t and modi f i cat i on check
' Show/ Hi de- >Last changed by' shows t he change i nf o f or t he ( t ar get ) sour cecode i ncl ude. Look f or
' Last changed by user ' <> ' SAP' and gr oss t i me > 5%. I f you f i nd an ent r y, j ump i nt o t he codi ng and
make sur e t hat t he cust omer changes ar e i n t he r el evant par t s of t he code. Al so ver i f y t hat i t was
not a manual i mpl ement at i on of a SAP not e. User exi t s and cust omcode ar e r esponsi bl e f or t hei r whol e
gr oss t i me. Opt i mi zat i on i s usual l y done by t he cust omer .
3. Net t i mes anal ysi s
Sor t by net t i me t o sear ch f or l ocal i zed t echni cal t uni ng pot ent i al . The aggr egat i on ' per
modul ar i zat i on uni t ' can show f or ms/ f unct i ons/ met hods t hat consume a l ong net t i me. A t r ace wi t h
scope ' wi t h i nt er nal t abl es' can r eveal si ngl e expensi ve ABAP st at ement s l i ke e. g. a sl ow ' r ead
t abl e' st at ement on a l ar ge i nt er nal t abl e wi t hout ' bi nar y sear ch' . The r ecommendat i on woul d be t o
keep t he t abl e sor t ed and add t he ' bi nar y sear ch' opt i on. The ABAP t r ace pr ovi des al so a conveni ent
aggr egat ed vi ew on accesses t o dat abase or buf f er ed t abl es and on RFCs, except f r ont end RFCs.
4. Opt i mi zat i on possi bi l i t i es
I n case you f i nd hi gh t i mes on st andar d f unct i onal i t y l i ke f unct i on PRI CI NG, per f or ma f unct i onal
opt i mi zat i on usi ng ST14 and t he Goi ngLi ve Opt i mi zat i on sessi on checks.
You can sear ch f or per f or mance- r el evant SAP not es usi ng names of modul ar i zat i on uni t s i n t he
hi er ar chy of t he conspi cuous f unct i onal i t i es t hat you not i ced dur i ng your t op- down gr oss t i me
anal ysi s.
Al so consul t t he f unct i onal exper t s. I f t hey al so j udge i t st r ange t hat so much t i me i s spent on
such a f unct i onal i t y, open a cust omer message. E. g. i n t he case wi t h 95% f or DYNAMI C_CREDI T_CHECK,
t hi s l ed t o a qui ck r epl y f r omSAP devel opment j ust t o t ake out one f l ag i n cust omi zi ng.
I f you have ABAP knowl edge, l ook at t he number s of execut i on and
j ump i nt o ABAP at di f f er ent hi er ar chy l evel s. Codi ng par t s t hat ar e pr ocessed ver y of t en shoul d be
r evi ewed. Check e. g. whet her i t woul d be bet t er t o cent r al i ze cer t ai n pr ocessi ng st eps and do t hem
once on a hi gher l evel . Anot her i mpor t ant st r at egy i s t o r emember r esul t s i n a buf f er . I n ABAP a
buf f er i n t he user cont axt i s usual l y i mpl ement ed usi ng gl obal i nt er nal t abl es i n t he t op i ncl ude of
f unct i on gr oups. They ar e per si st ent t hr oughout t he user cont ext and can be accessed f r omal l
f unct i on modul es of t he gr oup. The l ogi c i s: a) Check i f buf f er f i l l ed. b) I f yes, r et ur n r esul t s
f r ombuf f er . c) I f no, sel ect or cal cul at e r esul t s and st or e t o buf f er .
Opt i mi zat i on of t en i nvol ves code changes.

V. Tr oubl e- shoot i ng
Symptom:Negative or excessively long times in the ABAP trace ?
Thi s can occur on cer t ai n oper at i ng syst ems wi t h mul t i pr ocessor s. Push t he ' Fur t her opt i ons' but t on
i n t he ABAP t r ace opt i ons and sel ect ' Low r esol ut i on' . Then r epeat t he t r ace.

Symptom:Too long runtimes for the first few entries ?
Somet i mes t he f i r st ent r i es have i ncor r ect gr oss/ net t i mes, even l onger t han t he t ot al execut i on
t i me. Of t en t hese ent r i es ar e scr een modul es ( PAI PBO) . However t he gr oss t i mes f or t he ot her
ent r i es bel ow l i ke f or ms, met hods or f unct i ons ar e usual l y st i l l cor r ect and r el i abl e. J ust i gnor e
t hese l eadi ng ent r i es.

Symptom:Tracefile overflow ?
Some r ar e pr ogr ammi ng t echni ques can cause addi t i onal t r ace f i l e f l ushes and t hus l ead t o an
over f l ow even wi t h t he aggr egat ed t r ace. Push t he ' Fur t her opt i ons' but t on i n t he ABAP t r ace opt i ons
and i ncr ease t he ABAP t r ace f i l e si ze f r om2 t o max 50 MB.


Validity
References
This document refers to:
SAP Notes
This document is referenced by:
SAP Notes (2)

Software Component From Rel. To Rel. And Subsequent

SAP_BASIS

46B

46D

610

640
1634757 Guided Self Service 'Performance Optimization'
1597364 FAQ: BW-BCT: Extraction performance in source system
1634757 Guided Self Service 'Performance Optimization'
1597364 FAQ: BW-BCT: Extraction performance in source system

Vous aimerez peut-être aussi