Sei sulla pagina 1di 39

Single Transaction Analysis (ST12) getting started

The Single Transaction Analysis was developed to promote the usage of ABAP trace inside SAP Support. It integrates the ABAP- (SE !" and the Performance (ST!#" Trace into one transaction. This $log will show how to ta%e a trace with ST&' in the so called ()urrent *ode( scenario. +urther options for performning traces and analysis will $e presented in future $logs. Before you start, ST12 is delivered as a part of the Service tools for Applications (ST-A/PI). SAP note !"## descri$es ho% to get the latest version of the ST-A/PI. &ote that the ST12 transaction is not officially doc'(ented / s'pported and only availa$le in the )nglish lang'age. Altho'gh it is (ainly intended for 'se $y SAP or certified service cons'ltants d'ring SAP Service Sessions* yo' can 'se it for yo' o%n perfor(ance analysis. A description of ST12 is given in SAP note +##!++ (ST12 ,A-AP Trace for SAP )arly.atch//oing0ive,). ST&' main Screen, The (ain screen of ST12 has three (ain parts as sho%n on fig're 1.

1ig're 12 (ain screen -sing ST&' with )urrent *ode, In the ,3'rrent 4ode, Scenario yo' are going to trace the e5ec'tion of a progra( or transaction. -efore yo' trace* it is reco((ended to e5ec'te yo'r progra( or transaction several ti(es to fill the $'ffer and caches* as filling the $'ffers and caches is so(ething that can6t $e opti(i7ed %ith A-AP or S80 t'ning. -efore yo' can start the trace yo' have to define the (eas're(ent scope. In ST12 this is done ,on the fly,* no (eas're(ent variants are saved. After starting ST12 and clic9ing on ,3'rrent 4ode, (see nr. 1 in fig're 1) yo' %ill see a screen li9e fig're 2.

1ig're 22 3'rrent 4ode :o' can enter a co((ent to give a (eaningf'l description for the trace. )nter yo'r progra( or transaction in the corresponding field and set the appropriate radio $'tton* see nr. 2 in fig're 2. In the lo%er part of the screen yo' define the (eas're(ent scope. The left part is for the A-AP trace (S);<) and the right part for the Perfor(ance Trace (ST<#)* see nr. ; in fig're 2. &ote2 Since ST12 'ses the f'nctionality of $oth transactions (S);< and ST<#) the options are si(ilar or the sa(e. ST12 hides so(e details to (a9e the traces (ore easy to 'se. 1or the A-AP trace the (ost i(portant decision is if yo' %ant to trace ,%ith internal ta$les,. It is reco((ended to s%itch this setting on. =ther options li9e Partic'lar 'nits* 1ilters or ,1'rther opt., are only needed in e5ceptional cases and $eyond the scope of this ,getting started, $log. If yo' clic9 on ,1'rther opt., (see nr. " in fig're 2) the follo%ing screen pops 'p2

1ig're ;2 f'rther =ptions Increase the ,4a5. si7e of file, to 2< 4- (see nr. # in fig're ;) and the ,4a5. trace r'nti(e, to ; << seconds (see nr. in fig're ;) if yo' have long r'nning progra(s. The aggregation is set to ,$y calling position, $y defa'lt %hich is the reco((ended option. All other options only have to $e changed in e5ceptional cases. 1or e5a(ple* if yo' get strange or negative ti(es in the A-AP traces* yo' sho'ld 'se the lo% resol'tion cloc9. 1or the perfor(ance trace yo' can decide %hether yo' %ant to ta9e the S80-* )n>'e'e- and / or ?13 trace. In the a$ove scenario only the S80 Trace is s%itched on. The S80 Trace is the (ost i(portant perfor(ance trace. This is all yo' have to do. :o' can start yo'r progra( or transaction no% $y clic9ing ,)5ec'te / start trace, (see nr. + in fig're 2). After yo'r progra( or transaction has finished and yo' have ret'rned to ST12 yo' %ill see yo'r trace in the lo%er part of the screen. The stat's col'(n (see nr. @ in fig're ") sho%s yo' %hether yo'r trace is ready for eval'ation. There (ight $e a red and %hite circle %hich (eans the A-AP trace is still $eing i(ported into the data$ase. The yello% flash indicates a (eas're(ent error (e.g. ti(e li(it e5ceeded* file si7e to s(all* ...). The green tic9 sho%s that the A-AP trace has $een s'ccessf'lly i(ported to the data$ase. &ote that ST12 i(ports the A-AP trace files into the data$ase* in order to (a9e the( availa$le in the %hole syste( and 9eeps the( for later analysis. In S);< the trace files are application server specific and deleted after a certain n'($er of days. The perfor(ance trace is not i(ported $y ST12 and therefore is only availa$le 'ntil the trace files are over%ritten. To eval'ate the trace yo' can clic9 on A-AP trace (see left arro% in fig're ") in order to display the i(ported A-AP trace. The list on fig're ; has $een sorted descending $y the &et col'(n. This (eans the total ti(es for each calling position is displayed in descending order. In order to eval'ate the perfor(ance traces A'st clic9 the $'tton Perfor(ance traces* see right arro% in fig're ". This %ill display the $asic list of the perfor(ance trace. 1or the S80 trace it is reco((ended to start %ith the state(ent s'((ary. Therefore in the $asic list clic9 (en' Trace 0ist -B S'((ary $y S80 State(ents. In fig're ; on the right $otto( yo' can see an e5a(ple of the S80 Trace S'((ary.

&ote2 Please refer to The S80 Trace (ST<#) - 8'ic9 and )asy -log (The S80 Trace (ST<#) 8'ic9 and )asy) for f'rther details on ST<# analysis.

1ig're "2 Trace Analysis Summary, In order to ta9e an A-AP and S80 Trace at the sa(e ti(e for a progra( yo' are going to e5ec'te the follo%ing steps2 1.) 3all ST12* clic9 on 3C??)&T 4=D) (&r. 1 in fig're 1) 2.) 1ill in the progra( or transaction and a (eaningf'l co((ent (&r. 2 in fig're 2) ;.) Define the (eas're(ent variant2 a. s%itch on A-AP and S80 Trace and 'se internal ta$les (&r. ; in fig're ;) $. increase the file si7e and the d'ration (&r. " in fig're 2 and &r. # and in fig're ;) ".) )5ec'te yo'r progra( (&r. + in fig're 2) #.) )val'ate the trace (fig're #) This $log de(onstrated ho% ST12 co($ines the A-AP and Perfor(ance trace and ho% easy it is to trace a progra( and (eas're $oth A-AP and S80 e5ec'tion. 1't're $logs %ill sho% advanced topics for trace ta9ing and analysis. 4ore infor(ation on ST12 can $e fo'nd here2 ST12 .IEI2 http2//%i9i.sdn.sap.co(/%i9i/display/A-AP/SingleFTransactionFAnalysis -logs2 ST12 - The %or9process trace -oo9s2 http2//%%%.sap-press.co(/prod'ct.cf(Gacco'ntHIprod'ctHJ;< < http2//%%%.sap-press.de/1@21

The Single Transaction Analysis was developed to promote the usage of ABAP trace inside SAP Support. It integrates the ABAP- (SE !" and the Performance (ST!#" Trace into one transaction. Before you start$ ST12 is delivered as a part of the Service tools for Applications (ST-A/PI). SAP note 694 descri!es ho" to #et the latest version of the ST-A/PI. $ote that the ST12 transaction is not officiall% doc&'ented / s&pported and onl% availa!le in the (n#lish lan#&a#e. Altho&#h it is 'ainl% intended for &se !% SAP or certified service cons&ltants d&rin# SAP Service Sessions) %o& can &se it for %o&r o"n perfor'ance anal%sis. A description of ST12 is #iven in SAP note * 9** (ST12 +A,AP Trace for SAP (arl%-atch/.oin#/ive+).

ABAP trace view (SE !"$

Performance traces view (ST!#"$

S%& summary view (ST!# statement summary"$

Stat. records view (STA'"$

.e/t 0eneration ABAP 1untime Analysis (SAT" 2 3ow to analy4e program flow
Posted $y =lga Dolins9aAa in A-AP Testing and Tro'$leshooting on Kan 1@* 2<11 12"#2"" A4
inShare1

SAT is the transaction name of the new ABAP 1untime Analysis Tool5 which is one of the most significant improvements in ABAP in the .et6eaver 7.! EhP'. +or those of you who are already familiar with the transaction SE !5 the former ABAP 1untime Analysis Tool5 transaction SAT is the successor of SE !. In SAT5 ABAP8s 1untime Analysis has $een rewor%ed $y SAP8s 19: department and has $een enhanced with effective new analysis tools and features. SAT offers $enefits such as a modern state-of-the art -I5 new analysis tools5 easy navigation $etween tools and so on. As successor of the transaction SE ! SAT should $e used for a program flow analysis. If you use SE !5 you would $e pleased to %now5 that the SE ! functionality for a program flow analysis is still the same in SAT and was ;ust enhanced $y the new program flow analysis tools. The fourth part of these series of $logs a$out SAT devotes itself to the e/ecution logic of an ABAP program and demonstrates how the new tools of the SAT help you to e/ecute effective program flow analysis of any ABAP application. This $log also fully complies to the SE ! $log A-AP ?'nti(e Analysis (S);<) - Jo% to analy7e A-AP progra( flo% completing it $y all new program flow analysis features5 which were released with SAT. <ou can find other $logs a$out SAT from these series here, &e5t /eneration A-AP ?'nti(e Analysis (SAT) Introd'ction &e5t /eneration A-AP ?'nti(e Analysis (SAT) Jo% to analy7e perfor(ance &e5t /eneration A-AP ?'nti(e Analysis (SAT) Jo% to analy7e (e(ory cons'(ption If you want to see a live demonstration of SAT5 ta%e a loo% at this short video, L SAT - .e/t 0eneration ABAP 1untime Analysis (1lash)

&. 6hy analy4e the flow of an ABAP program=


.hy do yo' need to analy7e the flo% of A-AP progra(G 0et (e give yo' A'st a co'ple of e5a(ples. 1irst* yo' (ay need to find the e5act so'rce code location of a partic'lar A-AP state(ent (a (ethod call* f'nction call...) yo' are interested in. To do this* yo' can r'n the A-AP Trace and then search for the re>'ired line in the res'lt list of the state(ents. Second* yo' (ay %ant to co(pare the flo% of yo'r A-AP progra( in different syste(s. I(agine* for e5a(ple* that yo'r A-AP progra( r'ns as e5pected in the test syste( $'t sho%s a co(pletely differently $ehavior in the prod'ction syste(* or even %orse* a$orts %ith a short d'(p in the prod'ction syste(. :o' co'ld then si(ply r'n the A-AP Trace for this progra( in $oth test and prod'ction syste(s and co(pare the trace res'lts to find o't the differences in the progra( flo% in $oth syste(s.

'. 3ow to find e/act source code line of an ABAP statement=


.e %ill start directly %ith a sa(ple 'sage scenario. K'st i(agine a car rental application* %hich (a9es it possi$le to reserve cars for the c'sto(ers of a car rental co(pany. .hen a car reservation for a c'sto(er is created* it is added to the car reservation ta$le of the c'sto(er. I(agine that o'r tas9 is to add so(e changes to the car reservation record $efore it gets %ritten into the car reservation ta$le. .e therefore need to find o't %hich A-AP progra(* (or (ethod* f'nction (od'le...) %rites the car reservation record into the car reservation ta$le and %here e5actly in the A-AP so'rce code this operation occ'rs.

&o% let6s see ho% to find this infor(ation %ith SAT %ithin a co'ple of (in'tes. 1irst %e ('st start the A-AP ?'nti(e Analysis (SAT) and create a (eas're(ent variant.

1. Start the A-AP ?'nti(e Analysis (SAT) via System -> Utilities -> Runtime Analysis -> Execute or call the transaction directly %ith "/nSAT". 2. Type a na(e of a transaction into Transaction field (or a na(e of a progra( into Program field) ;. 3hoose Eval. Immediately to start the analysis right after the (eas're(ent ". 3hoose etermine !ames o" Internal Ta#les to see the na(es of internal ta$les in the (eas're(ent #. 3reate a (eas're(ent variant for o'r 'ser2 Type a na(e into $ariant field and press %reate $'tton Set aggregation to !one on the uration/Ty&e ta$ 3hoose Ex&licit S'itc(ing on and )"" o" *easurement to t'rn on/off trace only for the needed progra( parts to red'ce a trace file si7e 3hoose only all Processing +loc,s on the Statements ta$ to red'ce a trace file si7e 3hoose additionally all operations on Internal Ta#les since %e %ant to trace %here a car reservation record is %ritten into the reservation ta$le Save the variant

-efore %e go on* so(e i(portant notes. :on8t use aggregation if you want to trace ABAP in order to follow the program logic (%hat %e are doing here). Aggregation s'((ari7es the trace data for a partic'lar type of event in a single trace record and therefore red'ces the n'($er of entries in the trace file. -'t to see the co(plete progra( flo% yo' need all trace data. Try to use (Explicit Switching on and Off of Measurement( where possi$le in order to reduce a trace file si4e and trace only the code yo' really need to see. This option allo%s yo' to s%itch on/off the A-AP trace d'ring the r'nning transaction (if yo' 9no% transaction S);<* it corresponds to the option Particular units in the S);<).The trace %ill $e started as soon as yo' enter "/ron" (trace on) in the =E field in yo'r transaction. .ith"/ro"" "(trace off) the trace is stopped. Alternatively yo' can also 'se the (en' path2 System -> Utilities -> Runtime Analysis -> S'itc( )n / S'itc( )"".

1estrict the measurement only to the really re>uired ABAP statements in order to reduce the trace file si4e.1or (ost (eas're(ents it %o'ld $e eno'gh to trace only Processing +loc,s. 0et6s e5ec'te the (eas're(ent2 1. Press the Execute $'tton. The car rental application starts. 2. Shortly $efore %e create a car reservation for a selected c'sto(er* t'rn on the trace %ith "/ron" in the =E code field (or 'se System -> Utilities -> Runtime Analysis ->S'itc( )n-. ;. 3reate a car reservation and t'rn off the trace "/ro""" in the =E code field (or 'se System -> Utilities -> Runtime Analysis ->S'itc( )""-. &o% it6s ti(e to go $ac9 to the SAT and analy7e trace res'lts. 1. /o to the Evaluate ta$* find o'r (eas're(ent and do'$le clic9 to open it. 2. In the res'lts display go to the %all .ierarc(y ta$. :o' see a list %hich represents the co(plete path thro'gh o'r application ;. Search for ,I&S)?T, in the %all .ierarc(y list* since yo' %ant to 9no% %here a car reservation data record gets inserted into the reservation ta$le ". =n the search res'lt list choose the appropriate line %ith the I&S)?T state(ent and press Position in .ierarc(y$'tton #. Do'$le-clic9 on the I&S)?T entry in the %all .ierarc(y list to A'(p to the so'rce code line in %hich it %as initiated.

Jere yo' are. :o' have fo'nd the e5act so'rce code line in %hich a car reservation record %as %ritten into the reservation ta$le. -efore %e go on* so(e notes for yo'.

-se the Set Filter... $utton to choose the data you want to display . In the trace variant yo' already specified %hich state(ents and %hich parts of yo'r application are to $e traced. Additionally yo' can no% filter the data yo' %ant to display. Please notice that so(e display filters are s%itched on $y defa'lt (e.g. no syste( progra(s). Therefore if yo' (iss so(ething* s%itch off all display filters and chec9 yo'r trace variant. -se the Display Call Stack $utton to show the call stac% for a selected entry. This feat're is availa$le only in the %all .ierarc(y. &o% perhaps yo' %ish to 'nderstand the progra( flo% %hich led to this I&S)?T. And yo' (ay perhaps find that the display in the %all .ierarc(y is a little large and a%9%ardM it %o'ld (a9e sense to restrict this vie%. :o' can acco(plish these tas9s $y 'sing the ne% Processing +loc,s Tool of the SAT. The Processing +loc,s Tool displays a call graph of processing $loc9s in order to present an aggregated vie% of the call se>'ence. The Processing +loc,s Tool contains the state(ents that yo' config'red in yo'r (eas're(ent variant. -asically these are (ethods* s'$ro'tines and f'nction (od'les. :o' can also 'se the Processing +loc,s Tool to display critical processing $loc9s in ter(s of r'nti(e (gross or net) or (e(ory cons'(ption. The SAT (ar9s the appropriate nodes in red and opens the( in a tree vie%. . 4ar9 the I&S)?T entry in the %all .ierarc(y list* press right (o'se $'tton and choose Position in t(e Processing +loc,s Tool in the conte5t (en'. &o% yo' can see a call graph %hich led to the I&S)?T state(ent. +. Press %ritical Processing +loc,s $'tton* in the pop'p choose Percentage o" Total Runtime /!et- and enter0imit$al. of 1#*<<N. The SAT %ill (ar9 in red the processing $loc9s* %hich net r'nti(e e5ceeds 1#N. @. :o' can then A'(p to one of these places and restrict the vie% to this s'$area to analy7e it (ore deeply /'se%on"ine to Su#area $'tton)

That is $asically everything yo' can get %ith a non-aggregated (eas're(ent.

. 3ow to trace a long running $atch ;o$=


&o% i(agine the follo%ing sit'ation. :o' are the ad(inistrator of a prod'ction syste(* and yo' enco'nter in the Process =vervie% (transaction s(#<) a $atch process* %hich already has $een r'nning several days and has $een selecting data fro( a data$ase ta$le. This process is $loc9ing other $ac9gro'nd Ao$s and yo' have to find o't %hat this process is act'ally doing2

:o' can find this o't very easily %ith the ne% A-AP ?'nti(e Analysis (SAT). :o' can 'se SAT to trace progra(s %hich are r'nning in a parallel session. 1. Ensure that you run SAT on the same server as the running process? 2. :o' ('st create or adA'st a trace variant for tracing the parallel process. Set aggregation to !one again to get the%all .ierarc(y. ;. Press the S'itc( )n/)"" $'tton to trace processes r'nning in a parallel session. The ?'nti(e Analysis displays a list of the r'nning processes si(ilar to the Process )vervie' (transaction s(#<). ". Cse the Activate measurement/ eactivate measurement $'ttons to start and stop the trace. )aution, eactivate t(e trace again a"ter s(ort tracing time so t(at you do not reac( t(e trace "ile 1uota2 +e"ore deactivating t(e trace3 re"res( t(e 'or, &rocess dis&lay. T(e dialog ste& t(at 'as active in t(e 'or, &rocess 'it( t(e activated trace may (ave c(anged3 and t(at deactivates t(e trace automatically.

#. /o to ,Evaluate, ta$* find yo'r (eas're(ent and do'$le clic9 it. . Cse %all .ierarc(y Tool to analy7e res'lts.

@. 3ow to trace 3TTPA1+) re>uests or processes of other users=


There are also often sit'ations %here yo' need to trace JTTP or ?13 re>'ests or processes of other 'sers. 0et (e give yo' so(e e5a(ples. I(agine there is an online flight $oo9ing syste(. If a 'ser %ants to reserve a flight* his JTTP re>'est arrives in yo'r $ac9end syste(. And yo' need to trace the reservation process %hich is r'nning in yo'r A-AP $ac9end syste(. In s'ch case yo' don6t 9no% %hich A-AP $ac9end process handles %hich JTTP re>'est and have no idea %hen the JTTP re>'est %ill reach yo'r A-AP $ac9end syste(. Therefore it is diffic'lt to capt're s'ch a re>'est for de$'gging in the appropriate A-AP $ac9end process. Another good e5a(ple %o'ld $e fre>'ent ?13 re>'ests %hich reach yo'r A-AP syste( and last only several h'ndred (illiseconds. It is >'ite hard to trace s'ch short-lived re>'ests. 4ay$e yo' also have to deal %ith a $atch Ao$ that r'ns 'nder another 'ser* %hich al%ays starts at a different ti(e and a$orts sporadically %ith a short d'(p. Jo% can yo' trace so(ething li9e thisG The A-AP ?'nti(e Analysis (SAT) provides an ans%er. It lets yo' sched'le a trace for any 'ser on the c'rrent server. .e %ill de(onstrate it $y 'sing o'r car rental application* %hich (a9es it possi$le to e5ec'te car reservations for the c'sto(ers of the car rental co(pany. After a car reservation for a c'sto(er ta9es place it %ill $e added to the car reservation ta$le of this c'sto(er. .e %ill r'n it this ti(e as a .e$ Dynpro for A-AP application in an e5ternal $ro%ser2

0et6s sched'le a (eas're(ent. 1. Start the A-AP ?'nti(e Analysis (SAT) via System -> Utilities -> Runtime Analysis -> Execute or call the transaction directly %ith "/nSAT". 2. 3reate a trace variant and set aggregation to !one again to get the %all .ierarc(y. ;. Press Sc(edule $'tton in the 4or User/Service area of the initial screen. ". Press Sc(edule measurement $'tton on the )vervie' o" Sc(eduled *easurements screen.

The transaction presents a pop'p on %hich yo' can sched'le an asynchrono's trace according to these criteria2 User (,A-3D, in o'r case) %lient External session (choose ,Any, if yo' are not s're in %hich session the application %ill r'nO) Process %ategory (dialog* $atch* ?13* JTTP* ITS* etc.) )#5ect Ty&e (transaction* report* f'nction (od'le* any* etc.) )#5ect (e.g. only transaction se;@) *ax. !o. o" sc(ed. *easurements (specify the (a5i('( n'($er of traces) Ex&iration ate and Time (specify the ti(e fra(e %hen the trace shall $e active) The A-AP ?'nti(e Analysis a'to(atically starts the trace as soon as a session that (eets yo'r criteria is started on the syste(. The 'ser yo' have specified logs on to the syste( and e5ec'tes his tas9* and SAT starts to %rite the trace. In o'r de(o e5a(ple SAT starts to %rite the trace as soon as the 'ser ,A-3D, e5ec'tes the car rental application in the e5ternal $ro%ser. After the 'ser ,A-3D, (ade a car reservation for a c'sto(er* he closes the $ro%ser and the trace res'lts can $e accessed - as 's'al - in SAT ($y do'$le clic9ing on the corresponding (eas're(ent res'lt on the Evaluate ta$ of the SAT initial screen).

1inally let 's ta9e a $rief loo9 at the (eas're(ent res'lts in SAT. It is the sa(e as %e A'st have seen in the other t%o e5a(ples %ith the only difference $eing that here %e are dealing %ith a .e$ Dynpro application. =n the Des9top 1 %e can see a Pro"ile Tool and a .it 0ist. 1or e5a(ple $y 'sing the )t(er .ierarc(y $'tton of the Pro"ile Tool %e can gro'p the r'nti(es $y pac9ages and find o't ho% ('ch r'nti(e gets cons'(ed $y o'r car rental application and ho% ('ch r'nti(e $elongs to the .e$ Dynpro A-AP. If %e then display the s'$area of o'r car rental application in the .it 0istTool (right (o'se $'tton (en'* is&lay Su#area in .it 0ist Tool) %e co'ld pic9 'p so(e r'nti(e cons'(ing trace entries and analy7e the( (ore deeply $y 'sing the Times Tool (right (o'se $'tton (en'* is&lay Su#area in Times Tool). =f co'rse yo' can 'se as 's'al the %all .ierarc(y to follo% the e5ec'tion logic of the car rental application and for e5a(ple find o't %here a car reservation too9 place.

Please note, SAT offers a possi$ility to group runtimes $y SBA: (Software Bayer Aware :e$ugging" layers. -y 'sing the )t(er .ierarc(y $'tton of the Pro"ile Tool yo' can also gro'p r'nti(es according to the S0AD (Soft%are 0ayer A%are De$'gging) o$Aect sets and profiles. -y 'sing the ne% transaction S0AD yo' can define specific o$Aect sets or layers %hich sho'ld $e accessed $y de$'gger and hide the rest of the code. 1'rther(ore yo' can define %hole layers and then A'(p fro( layer to layer instead of de$'gging thro'gh the application %ith Psingle step6. This ne% de$'gging (ode $eco(es especially i(portant if yo' %ant to analy7e a .e$ Dynpro for A-AP application and need to de$'g only its code instead of spending ho'rs on intensive de$'gging of .e$ Dynpro for A-AP fra(e%or9 code* JTTP handlers* syste( st'ff and so on. 1or (ore infor(ation on ho% to 'se S0AD please cons'lt this %e$log20ayer-A%are De$'gging in &. +.< )JP2

#. Best Practices for a program flow analysis


.hen yo' (eas're a progra( flo% of yo'r application re(e($er the follo%ing2

-se aggregation er Call osition in a measurement variant to get the trace vie% in the Pro"ile Tool and .it 0istTool for eval'ation of (eas're(ent res'lts. Always perform non-aggregated measurements. Set aggregation to !one in yo'r (eas're(ent variant 1educe trace file si4e $y using variants. Cse Ex&licit S'itc(ing on and )"" o" *easurement option in yo'r variant %here possi$le and then t'rn on/off the trace %ith "/ron" and "/ro""" co((ands. ?estrict the A-AP state(ents in the (eas're(ent on the Statements ta$ of yo'r variant. -se the Call !ierarchy Tool to analy4e the call hierarchy of your application and find the ABAP statements you are interested in. :o' can also display the i((ediate call stac9 of a (eas're(ent event $y 'sing the is&lay %all Stac, $'tton. -se the rocessing "locks Tool to display a call hierarchy in a tree.

-se the rocessing "locks Tool to find performance and memory hotspots in the call hierarchy. To get (e(ory hotspots yo' ('st chec9 *easure *emory Use on the uration and Ty&e ta$ in yo'r variant. -se the #imes Tool and Data$ase Tool to get more detailed runtimes and analy4e data$ase accesses To compare the differences in the flow logic of your ABAP programs use the Call !ierarchy comparisonTool. :o' can access it on the Evaluate ta$ $y selecting t%o co(pati$le (eas're(ents on the Evaluate ta$ and pressing %om&are %all .ierarc(ies $'tton.

.ews in ABAP :e$ugger Brea%points and 6atchpoints 5 Statement :e$ugging


Posted $y =lga Dolins9aAa in A-AP Testing and Tro'$leshooting on K'l 1"* 2<11 #21+2<< A4
inShare

SAP .et6eaver 7.! E3P' $rings an e/panded set of $rea%point and watchpoint capa$ilities as well as a new higher-resolution statement de$ugging capa$ility (of course in the .ew ABAP :e$ugger?". This $log shows how to use these new features, The new types of $rea%point (on ABAP command5 on 6e$ :ynpro entities5 on method of a class5 on Simple Transformations..." The new types of watchpoints (on internal ta$le5 on ABAP o$;ects and o$;ect attri$utes..." The new conditional $rea%points and watchpoints This $log also e/plains the new statement de$ugging in ABAP - how you can separately de$ug multiple ABAP statements or e/pressions in one line. If you are interested in a live demonstration of the new features in ABAP $rea%points and watchpoints5 ;ust ta%e a loo% at this short video, Advanced ABAP Brea%points and 6atchpoints in SAP .et6eaver 7.! E3P'

&. .ew Brea%point Types If yo' are in the &e% A-AP De$'gger and press the +rea,&oint $'tton* yo' %ill find a %hole series of ne% ta$s in the $rea9point pop'p. )ach of these ta$s introd'ces a special ne% $rea9point type* %hich yo' can choose accordingly to yo'r special needs* %hen setting a $rea9point in yo'r code. 0et6s ta9e a closer loo9 at so(e of the(. %"% Command "reakpoints .ith the A+AP %mnds ta$* yo' can set a $rea9point on any of a variety of A-AP state(ents* sho%n to yo' in the 1" Jelp. The possi$ilities incl'de setting a $rea9point at 3A00 1C&3TI=&* 3A00 1C&3TI=& D)STI&ATI=&* 3A00 1C&3TI=& I& ?)4=T) TASE* 3A00 1C&3TI=& I& CPDAT) TASE* .... 4any people didn6t 9no% that there are also different D)0)T) variants2 D)0)T) ITA- (delete fro( an internal ta$le) is different fro( D)0)T) D-TA- (delete fro( a data$ase ta$le).

Method "reakpoints .ith the *et(od ta$* yo' can set a $rea9point at the invocation of a (ethod of a class.

Simple #ransformation and &e$ Dynpro "reakpoints =n the ST Tem&late ta$* yo' can set a ro% $rea9point at the call to a Si(ple Transfor(ation te(plate. .ith the 6e# yn&ro ta$ yo' can set a $rea9point on .e$ Dynpro entities. .hen entering co(ponents* controllers and (ethods* the na(e of the generated class is deter(ined and the $rea9point is set there. :o' can also tell the de$'gger to stop at each A-AP stac9 and screen change (*isc ta$) or set a $rea9point on a (essage (*essage ta$).

'. )onditional Brea%points I(agine yo' need to de$'g an A-AP application in %hich an internal ta$le is grad'ally filled %ith a large n'($er of data records. So(e%here d'ring the e5ec'tion an error ta9es place and an incorrect data record gets inserted into the ta$le. To analy7e this $ehavior yo' can tell the de$'gger to stop as soon as this incorrect data record gets inserted into the ta$le. :o' can do this $y setting a $rea9point and adding a condition to it. To add a condition to a $rea9point* clic9 on yo'r $rea9point %ith a right (o'se $'tton and choose %reate %onditionfro( the conte5t (en'. An additional pop'p is displayed* in %hich yo' can enter the test condition. :o' can 'se varia$les in the condition* as %ell as de$'gger sy($ols and f'nctions. Cse the 11 Jelp on the +rea,&oint %onditionpop'p to see the possi$le condition operands and synta5.

. .ew +eatures in 6atchpoints &o% it is possi$le to set a %atchpoint for an internal ta$le (this %asn6t possi$le in the classic de$'gger). K'st press6atc(&oint $'tton and enter the internal ta$le na(e in the %reate 6atc(&oint pop'p. The de$'gger stops %hen the internal ta$le is changed. :o' can f'rther refine the %atchpoint $y specifying a condition (for e5a(ple stop only if internal ta$le contains (ore then 2<< ro%s). )nter a condition in the 4ree %ondition Entry field. Cse the 11 help to learn %hich f'nctions yo' can 'se in yo'r conditions. The de$'gger %ill stop only if the internal ta$le has changed and yo'r specified condition is f'lfilled. In addition* the +rea,./6atc(&oints ta$ sho%s %hich %atchpoint has a hit* and yo' can for e5a(ple vie% and co(pare a varia$les in its c'rrent (after stopping at a %atchpoint) and previo's state.

A f'rther ne% feat're is the a$ility to set %atchpoints on o$Aects. K'st enter the o$Aect na(e in the %reate 6atc(&ointpop'p. In this %ay yo' can (onitor the o$Aect d'ring e5ec'tion of yo'r progra(. The de$'gger %ill stop as soon as the o$Aect changes. :o' can also set a %atchpoint at o$Aect attri$'te (choose 6atc(&oint at )#5ect Attri#ute radio $'tton) and select any desired types of instance and static attri$'tes. The de$'gger then stops if an attri$'te has changed. After%ards yo' can ta9e a loo9 at this attri$'te change on the +rea,./6atc(&oints ta$ $y selecting yo'r %atchpoint there and clic9ing on its details (agnifier (in o'r e5a(ple the P)5pander6 attri$'te has changed fro( PQ6 to a Pspace6).

@. Statement :e$ugging &o% i(agine yo' are stepping thro'gh yo'r code in the de$'gger and e5ec'te a long I1... state(ent* consisting of (any different s'$condtions. :o' e5pect a positive res'lt* $'t 'nfort'nately the I1... state(ent delivers yo' the negative ans%er. To analy7e this $ehavior yo' need to 'nderstand %hich s'$condition of this long I1...state(ent failed. :o' can easily eval'ate the conditions in the I1 $y changing the step si7e in the de$'gger. -y pressing the Ste& Si7e$'tton yo' activate the state(ent de$'gging* and the de$'gger %ill e5ec'te the s'$conditions of for e5a(ple yo'r long I1... state(ent separately one after another. :o' can then analy7e ret'rn val'es of single s'$conditions on theAuto ta$ of the varia$le fast display %indo%. -y pressing the Ste& Si7e $'tton again yo' ret'rn to a nor(al line stepping in the de$'gger.

The ABAP 1untime Trace (SE !" - Cuic% and Easy


Posted $y Siegfried -oes in A-AP Testing and Tro'$leshooting on &ov 1;* 2<<+ #2;22"2 A4
inShare

Besides the SCB Trace5 the ABAP 1untime Analysis or ABAP Trace (transaction SE !" is the most important tool to use5 if you want to test the performance of your ABAPprogram. -nfortunately5 it can $e seen in the forum and other sources that many people have >uestions a$out ABAP Trace. This $log will provide you with a >uic% introduction to ABAP Trace5 show you how simple it is to e/ecute5 and tell you all you need to %now for a $asic performance analysis.

&. -sing the ABAP 1untime Trace


1. 2. ;. ". #. . +. Csing this tool is nearly as straightfor%ard as 'sing the S80 trace (see The S80 Trace (ST<#) 8'ic9 and )asy)2 3all the A-AP ?'nti(e Analysis (transaction S);<) 3hec9 the (eas're(ent restrictions and change the( if necessary. See the reco((endations $elo%. 4a9e s're yo' have e5ec'ted the test progra( at least once* or even $etter* a fe% ti(es* to fill the $'ffers and caches. :o' %ill o$tain reprod'ci$le trace res'lts only thro'gh repeated e5ec'tion. .e %ill neglect the initial costs in o'r e5a(ination. )5ec'te yo'r test progra( directly fro( the A-AP Trace. This is possi$le for transactions* progra(s* and f'nction (od'les. S%itch off the trace. If a trace file %as %ritten* it %ill appear 'nder PPerfor(ance Data 1ileR. )val'ate the res'lts file. There are several other %ays to e5ec'te the A-AP Trace* not descri$ed 'nder step "M $'t they are $eyond the scope of this $log* please go to the A-AP Trace doc'(entation for (ore infor(ation on the(.

The (eas're(ent restriction has three ta$s. +irst ta$, Program (Parts"

Second ta$, Statements

Third ta$, :urationAType

It is reco((ended that yo' create three (eas're(ent variants2 PE1+DB<D)ABB (defa'lt)2 nothing selected on the first ta$* on the state(ent ta$ everything selected $'t not the P9ernel-level r'nti(e ad(inistrationR and not the PInternal ta$lesR read and change operationsM on the third ta$ set aggregation Pper call positionR and set the (a5i('( file si7e to 2<.<<< E- and the (a5i('( r'nti(e to ;.<<< sec. PE1+DB<D)ABBDITAB2 as a$ove* $'t on the second ta$ the internal ta$le read and change operations are s%itched on. PE1+D.EDA002 as P)?1S-:S3A00* $'t on the third ta$ the aggregation is PnoneR. After the test progra( has finished (see step ;)* navigate $ac9 to the start screen of the A-AP Trace* %here yo' %ill find the latest trace file.

.ith P=ther 1ileR yo' can get a list of all trace files incl'ding previo's (eas're(ents. &ote* ho%ever* that the S);< traces are deleted a'to(atically after @ days. Also re(e($er that the files are stored per application server* so if yo' %ant to see traces of prior (eas're(ents* then yo' need to 9no% on %hich application server the trace %as e5ec'ted. This section shows how to e/ecute the ABAP Trace. E/ecuting the trace is >uite straightforward and can $e performed with little prior %nowledge. Interpreting the results re>uires some e/perience and is e/plained in the ne/t sections.

'. Trace 1esults Everview


.hen yo' eval'ate the trace yo' %ill first see the overvie% screen.

The (ost i(portant infor(ation on this screen is the total r'nti(e on the $ac9end* i.e. on application server and the data$ase. This is yo'r total opti(i7ation potential. Perhaps yo' already had so(e e5pectations or e5ternal li(its for the total r'nti(e. In general* dialog applications %ith s(all o$Aects sho'ld $e considera$ly faster than 2 seconds* in order to o$tain a total response ti(e of 2 seconds. 0arger $atch Ao$s (ay need ('ch longer. It is yo'r tas9 to interpret %hether a r'nti(e is good or $ad. -ased on 'ser feed$ac9* %e have noticed that the graph see(s to attract (ore attention than the act'al fig'res* and 'sers see( to foc's heavily on the percentages and the red or green colors in the diagra(. Jo%ever* the colors carry little infor(ation* as the color s%itches fro( green to red if the percentage is larger than #<N. And the percentages the(selves* of co'rse* al%ays add 'p to 1<<N. As a res'lt* if one percentage is larger the other one ('st $e s(aller. Syste( and data$ase (ay $e very s(all* or even 7ero* $'t sho'ld not $e too large. 1or syste(* 1<N is already too large* and for the data$ase* #<N is >'ite large. The arg'(ent %hy data$ase sho'ld $e considera$ly larger than A-AP is the follo%ing2 after the data has $een read fro( the data$ase* so(e 9ind of processing sho'ld occ'r on the records* so that a ratio of 2< to "<N for data$ase is desira$le. Progra(s %ith very special tas9s can of co'rse have very special percentage distri$'tions. The hit list is the only additional infor(ation availa$le for traces of aggregation type Pper call(ing) positionR. 1ort'nately* the hit list offers all yo' need for a >'ic9 and easy perfor(ance chec9. In this section the overview is e/plained. This is the total runtime and its distri$ution over the three categories ABAP5 :ata$ase and System. +rom the total time you should $e a$le to conclude whether your program is fast or slow5 while the percentages tell you where to $egin5 if you want to optimi4e performance.

. Trace 1esults 3it Bist

The hit list s'((ari7es the (eas're(ents of e5ec'tion and processing ti(es into one entry per operation. If the aggregation is Pper calling positionR* then yo' %ill see t%o separate entries for the sa(e operation if the operation is called fro( t%o different progra(s or if the operation is called fro( t%o different positions in the sa(e progra(. The 'ni>'e 9eys fields of the hit list are

therefore P3allR* i.e. operation (col. +)* PProgra( &a(eR (col.@) and P0ineR* i.e. calling position. Cnfort'nately* the line is not displayed in the defa'lt layo't of the hit list and can $e added $y layo't change. The i(portant (eas'red val'es are P&o.R (col. 1)* P/rossR (col. 2)* and P&etR (col. "). They tell yo' ho% often an operation %as e5ec'ted* and ho% ('ch ti(e it re>'ired* either as a total incl'ding s'$-operations (/ross ti(e)* or %itho't s'$-operations (&et ti(e). ?e(e($er that the ti(es are (eas'red in (icroseconds ((s) and that the sho%n ti(es are the total ti(es* not the ti(es per e5ec'tion. The other col'(ns contain additional* altho'gh less i(portant infor(ation. These are the e>'ality sign PHR (col. ;)* the percentages P/ross (N)R (col. #) and P&et (N)R (col. )* and also the PTypeR (col. !) and the P&o. 1ilterR (col. 1<). =f the 1# f'nction icons (ost are standard A0T f'nctions2 sorting (icons 1 and 2)* hori7ontal scrolling(icon # to @)* details (icon !)* A0T filter (icon 1<)* s'( of n'(erical col'(ns (icon 11)* layo't change (icon 12)* sending (icon 1;)* do%nloading (icon 1")* and finally infor(ation (icon 1#). &ot standard A0T f'nctions are the lin9 to the so'rce code (icon ;)* and the filter (icon ")* %hich has A-AP Trace-specific settings. .e reco((end that yo' display everything.

This section introduces the hit list5 which is the summari4ed view of the ABAP Trace li%e the SCB statement summary in the SCB Trace. It is e/plained what the hit list displays and what additional functions are hidden $ehind the icons. In the ne/t section the hit list is used for the detailed analysis.

@. )hec%s in the 3it Bist

Start the chec9s in the hit list %ith the sort order Pgross ti(e descendingR* %hich is also the defa'lt sort order. 3igh 0ross Time F E/pensive Branch 1or the top 2<* or $etter* for all lines %ith gross ti(es larger than 1< (s* chec9 %hether they are really necessary* i.e. as9 yo'rself if so(e of the e5ec'tions can $e avoided. It is not 'nco((on that operations are called too often. In ter(s of f'nctional correctness this is not a pro$le(* as the res'lt is correct. It A'st (eans that the sa(e res'lt is co(p'ted several ti(es. Then resort the hit list $y net ti(es descending* so that yo' can see the top cons'(ers2 3igh .et Time F E/pensive E/ecution Again* chec9 the top 2< or all cons'(er %ith net ti(es larger 1< (s. See %hether the n'($er of e5ec'tions are reasona$le or %hether it co'ld they $e lo%erG 3alc'late the net ti(e per e5ec'tion and try to 'nderstand* %hy that a(o'nt of ti(e is needed $y analy7ing the coding. 3an the coding $e i(proved to get $etter perfor(anceG 1inally* ta9e a loo9 at the large e5ec'tion n'($ers. Do yo' 'nderstand the highest e5ec'tion n'($ersG 1or e5a(ple* %hy is an operation e5ec'ted several tho'sand ti(esG Is this necessaryG 4ay$e yo' %ill reali7e that so(e of the e5ec'tions are not really necessary.

The A-AP Trace can provide yo' %ith the fig'res* $'t it cannot 9no% ho% ('ch ti(e an operation is allo%ed to need. This is so(ething only yo' can deter(ine* either $y 9no%ing the f'nctionality or $y chec9ing the coding in detail. It (a9es sense to classify the types of operations into different operations categories2 The modulari4ation units* i.e. the (ethods* f'nctions* and for(s* contain the act'al coding. 4ost of yo'r analysis efforts sho'ld $e foc'sed on these areas. The internal ta$les are a special part of the A-AP processing. It (a9es sense to chec9 the( separately in a f'rther analysis step. The 1+)s (remote function calls" are special (od'lari7ation 'nits that r'n in another (ode either on the sa(e server or even in a different syste(. If they clai( large fractions of the ti(e* then yo' sho'ld also chec9 the details of the ?13s. The data$ase operations are $y defa'lt (eas'red separately fro( the (od'lari7ation 'nits. This %ill al%ays represent a considera$le part of the total r'nti(e. If individ'al operations 'se 'p a large part of the ti(e* chec9 the( in detail %ith the S80 trace. There are (any other types of operations that are traced $y the A-AP Trace. Cs'ally* ho%ever* they are not critical to perfor(ance. 3hec9 the( if they cons'(e large portions of the net ti(e. These type categories %ill $eco(e (ore pro(inent in f'rther develop(ents of the S);<. In this section5 the details of the analysis are discussed. )hec% the top contri$utions in the hit list in detail and find out whether the coding can $e optimi4ed or whether the num$er of e/ecutions can $e reduced.

#. Aggregation G.oneH
The aggregation P&oneR provides ('ch (ore detailed res'lts* $eca'se every individ'al e5ec'tion of an operation is tracedM it covers a lot (ore screens than the aggregation P$y call positionR.

There are @ hit lists2 PJit listR* P/ro'p hit listR* PData$ase ta$le hit listR* P3lass hit listR* PInstance hit listR* 4ethod hit listR* P)vent hit listR and PInternal ta$le hit listR* P3all hierarchyR (icon !) And PStatisticsR and PDisplay 1ilterR The special hit lists are (ore or less A'st filtered vie%s of the hit list and offer little ne% infor(ation. =nly the call hierarchy offers so(ething ne%. It sho%s all e5ec'tions in the se>'ence of e5ec'tion* %ith individ'al gross and net ti(es pl's level in the call stac9. As yo' can i(agine* a rather si(ple call hierarchy can already get very long. As an e5a(ple* I have red'ced the call hierarchy of the si(ple e5a(ple progra(* $y selecting only the " (od'lari7ation 'nits on the second ta$ of (eas're(ent restrictions (left top corner)* and s%itching on only the first entry in the display filter* %hich gives the follo%ing call hierarchy2

A standard $'siness application %ill res'lt in a call hierarchy %ith tho'sands of lines* if yo' 'se standard settings. =$vio'sly no$ody %o'ld ever analy7e a call hierarchy in total* $'t only the parts that are of special interest. 1or a perfor(ance overvie%* the hit list is ('ch (ore i(portant. This section gives a short overview of the e/tended functionality of the ABAP Trace for non-aggregated traces. Besides the additional hit lists5 the call hierarchy is the most interesting feature. 3owever5 a$out I#J of all performance analysis sessions can $e done with the hit list of the trace aggregated $y calling position.

This $log e/plains the $asics a$out the ABAP Trace with focus on performance. <ou should now $e a$le to find the most critical performance $ottlenec%s in your system. Together with a similar $log on the SCB Trace (see The SCB Trace (ST!#" 2 Cuic% and Easy"5 you should $e a$le to get a good overview of the performance in your $ac%-end system.

&e% A-AP De$'gger Tips and Tric9s


Posted $y =lga Dolins9aAa in A-AP Testing and Tro'$leshooting on &ov 1<* 2<1< 122#12;+ A4
inShare2

The .ew ABAP :e$ugger was first released $y SAP with .et6eaver!@. As of release .et6eaver 7.! it fully replaces in the scope of its functionality the (old-fashioned( )lassic ABAP :e$ugger. :uring the last SAP TechEds I learned that more and more people use the .ew ABAP :e$ugger (that is a great news?" $ut still many are not aware of some of its useful features. The purpose of this $log is to point you to these features so that you can ma%e the most of the .ew ABAP :e$ugger.

So(e 'sef'l de$'gger settings

Jo% to handover a de$'gger pro$le( - Cse De$'gger Tariants Jo% to display all loaded progra(s and glo$al varia$les - Cse the 0oaded Progra(s Tool Jo% to test a f'nction (od'le in the de$'gger and pass para(eters Jelpf'l hints for analy7ing varia$les Jo% to de$'g a progra( %hich is r'nning in an endless loop Jo% to de$'g a $ac9gro'nd Ao$ %hich is r'nning in an endless loop Jo% to de$'g a finished or crashed $ac9gro'nd Ao$ Jo% to co(pare A-AP varia$les - Cse the Diff Tool Jo% to de$'g JTTP re>'ests Jelpf'l de$'gger o9-codes

Some useful de$ugger settings

The &e% A-AP De$'gger settings dialog lets yo' activate special de$'gging (odes and co(fort options that can speed 'p yo'r tro'$leshooting scenarios. Jere yo' %ill find so(e helpf'l de$'gger settings %ith instr'ctions on %hen and ho% to 'se the(. :o' can access de$'gger settings in the de$'gger $y 'sing Settings-> is&lay/%(ange e#ugger Settings2 System :e$ugging, if yo' have pro$le(s that involve syste( progra(s (s'ch as a f'nction that can6t $e accessed in the de$'gger)* t'rn on this setting (or 'se (en' Settings->System de#ugging )n/)"" , or the co((and /(s in the de$'gger co((and field). :o' can declare a progra( as a syste( progra( $y setting Status to ,Syste( Progra(, in its attri$'tes in the A-AP )ditor (S);@) (chec9 the radio$'tton Attri#utes and press %(ange $'tton). -pdate :e$ugging, t'rn on this setting if yo' need to analy7e asynchrono's 'pdates* %hich are f'nctions that are called as follo%s2 3A00 1C&3TI=& P...6 I& CPDAT) TASE. These f'nctions are e5ec'ted asynchrono'sly in a special 'pdate %or9 process (after the ne5t 3=44IT .=?E state(ent). The de$'gger can6t follo% the( since it is attached to a single process. Set a $rea9point in the f'nction that is called I& CPDAT) TASE* start de$'gging* t'rn on this setting* and the de$'gger %ill reach the $rea9point in yo'r 'pdate f'nction. T1+) (In Bac%ground Tas%", Bloc% Sending, t'rn on this setting if yo' need to analy7e transactional ?e(ote 1'nction 3alls (T?13)* %hich are called as follo%s2 3A00 1C&3TI=& P...6 I& -A3E/?=C&D TASE. These f'nctions are called asynchrono'sly* along %ith other T?13 f'nctions of this logical 'nit of %or9 (0C.)* after the ne5t 3=44IT .=?E state(ent. The de$'gger can6t follo% the( since it is attached to a single process. .hen yo' t'rn on this setting* these T?13 f'nctions are stored in the syste( for de$'gging instead of $eing sent. Cse the T?13 4onitor (transaction S4#@) to analy7e the 'nprocessed 0C.s and select Edit-> e#ug 0U6 to de$'g the(. )lose de$ugger After G)ontinue8 (+K" and 1oll Area End, 's'ally after yo' press %ontinue /48- in the de$'gger session* the de$'gger session re(ains availa$le $'t inactive %hen the progra( is finished. If yo' s%itch on this setting* then the de$'gger %ill $e closed a'to(atically after pressing %ontinue /48-* %hen the roll area (internal session) is ended. Always )reate E/ception E$;., t'rn on this setting if yo' need to analy7e e5ception o$Aects (if yo' catch A-AP e5ceptions in yo'r progra( via the 3AT3J 3QS4:S)Q3)PTI=& %itho't specifying a reference varia$le to %hich the e5ception o$Aect can $e assigned). :o' can then e5a(ine the created e5ception o$Aects in the de$'gger via is&lay Exce&tion )#5. (agnifier $'tton.

3ow to handover a de$ugger pro$lem - -se :e$ugger Lariants


I(agine that yo' have had to reprod'ce and tro'$leshoot a pro$le( in a rather co(plicated environ(ent. :o' have finally fo'nd the f'nction (od'le %hich doesn6t %or9 properly 'nder certain conditions. :o' (ay need to hand over this de$'gging session for f'rther analysis to a colleag'e %ho has e5pert 9no%ledge of this f'nction (od'le. In order to ens're that yo'r colleag'e can reprod'ce the pro$le(* yo' ('st create a very detailed description2 the so'rce lines at %hich to set $rea9points* the de$'gger settings that ('st $e active* and so on. This is ti(e cons'(ing and there is still a chance that yo' (ight forget critical infor(ation. In s'ch sit'ations* 'se a de$'gger variant ((en' e#ugger-> e#ugger Session>Save) to store yo'r de$'gger session. :o' can choose %hich parts to store2 c'rrent layo't (c'sto(i7ed des9tops)* de$'gger

settings* options and $rea9points. Then yo' can save the variant either in the data$ase or in a local file and send it per e(ail to yo'r colleag'e.

After%ards yo'r colleag'e can load the saved variant fro( a file or the data$ase after starting a de$'gging session ((en' e#ugger-> e#ugger Session->0oad). All settings and $rea9points %ill $eco(e active i((ediately. =f co'rse he can choose %hich co(ponents of the variant to load2 layo't* settings* options* $rea9points* or all of the(.

3ow to display all loaded programs and glo$al varia$les -se the Boaded Programs Tool
A do'$le-clic9 on the varia$le na(e in the so'rce code leads to the $aria#le 4ast is&lay Tool %here yo' get infor(ation a$o't varia$le2 type* val'e* etc. =n the 0ocals ta$ yo' get all para(eters (incl'ding para(eter 9ind) and local varia$les of the c'rrent f'nction (od'le* on the 9lo#als ta$* yo' can display all glo$al varia$les of the c'rrent progra(. -'t so(eti(es this local and glo$al infor(ation is not eno'ghM yo' (ay$e need to display all c'rrently loaded progra(s and their glo$al varia$les as %ell. 1or this p'rpose* 'se the 0oaded Programs Tool ($'tton !e' Tool3 S&ecial Tools->0oaded Programs). 0oaded Programs sho%s yo' t%o ta$s. =n the 0oaded Programs ta$ yo' see the attri$'tes of all loaded progra(s and their progra( gro'ps. =n the 9lo#al ata ta$ yo' get glo$al varia$les of each glo$al progra( A'st $y do'$le-clic9ing the progra( in the navigation tree.

3ow to test a function module in the de$ugger and pass parameters


I(agine yo' %ant to test a f'nction (od'le in the test fra(e%or9 of the 1'nction -'ilder (transaction S);+) in the de$'gger* and yo' need to pass as a para(eter a $ig internal ta$le %ith (any entries. It %o'ld $e very ti(e cons'(ing to enter the inp't data for s'ch a ta$le (an'ally in S);+. -'t yo' don6t have to do this. If yo' access the f'nction (od'le fro( the de$'gger* then yo' can do%nload its para(eters to the S);+ test fra(e%or9. Select the para(eter and 'se the right (o'se $'tton conte5t (en' Save Parameters as Test ata /SE:;-. Please consider that this do%nload is restricted to the data types %hich are allo%ed in the S);+ test fra(e%or92 yo' cannot do%nload o$Aects* nested internal ta$les or data references. After that A'st open the f'nction (od'le in a separate S);+ %indo% and r'n it in the test fra(e%or9. :o' can access yo'r do%nloaded data in S);+ via Test ata irectory $'tton.

3elpful hints for analy4ing varia$les

-se the Data Explorer to view deep nested o$;ects .ith the )#5ects Tool ()#5ects des9top) yo' can e5a(ine o$Aect properties incl'ding visi$ility* inheritance* references to the o$Aect (%here-'sed list ). :o' can do'$le-clic9 on attri$'tes in order to navigate to the s'$co(ponents of a class. -'t if yo' have to analy7e deep nested o$Aects* then the ata Ex&lorer Tool is the $etter choice. The ata Ex&lorer lets yo' drill do%n into nested o$Aects* str'ct'res* and references %itho't losing conte5t of the 'pper levels.

-se #ext #ranslation to display large he/ strings and the M*B Browser to display M*B data. It is very ti(e cons'(ing to analy7e the content of a varia$le that contains 2<<< $ytes of he5 code. Therefore* the detail vie% ( etail is&lay des9top) for si(ple types and strings allo%s yo' to translate he5 strings into reada$le te5t 'sing the appropriate code page (field $ie' * choose Text Translation). 1or $inary Q40 data* there is the Q40 vie%er (field $ie' * choose <*0 +ro'ser).

3ow to de$ug a program which is running in an endless loop

I(agine yo'r progra( is r'nning in an endless loop and yo' need to analy7e its $ehavior. In s'ch sit'ations yo' can force the r'nning progra( into the de$'gger si(ply $y setting a session $rea9point in a second A-AP )ditor. InUtilities->Settings...> e#ugging A'st choose the Session #rea,&oint active immed. option. .hen yo' activate this option* all (r'nning and %aiting) sessions of yo'r logon session i((ediately inherit all session $rea9points set in any of those sessions. It is reco((ended that yo' activate this option in develop(ent environ(ents.

3ow to de$ug a $ac%ground ;o$ which is running in an endless loop


&o% i(agine that yo' have a $ac9gro'nd Ao$ that is r'nning and r'nning* and yo' %ant to analy7e its $ehavior. K'st 'se the Process )vervie' (transaction S4#<)* select the r'nning process* and choose fro( the transaction (en' Program> e#ugging.

3ow to de$ug a finished or crashed $ac%ground ;o$


&o% A'st i(agine that yo'r $ac9gro'nd Ao$ finishes its e5ec'tion so >'ic9ly* that yo' don6t have a chance to attach a de$'gger to it in the Process )vervie' (S4#<)* or even %orse2 it crashed %ith a d'(p and yo' need to analy7e %hat ca'sed the d'(p. K'st choose yo'r Ao$ in the =o# )vervie' (transaction S4;+) and type ,Ad$g, into the co((and field. The de$'gger %ill start* and yo' A'st %o'ld need to press a co'ple of ti(es ?et'rn (1+) to get o't of the spool f'nctions chec9s and yo' can de$'g yo'r finished or crashed $ac9gro'nd Ao$ online in dialog.

3ow to compare ABAP varia$les - -se the :iff Tool


K'st i(agine yo' are in the de$'gger and need to co(pare t%o strings %hich are 2<<< $ytes long* or yo' need to co(pare t%o nested o$Aects to loo9 for differences in deeply nested attri$'tes. .ith the i"" Tool (Diff Des9top) yo' can co(pare t%o co(pati$le A-AP varia$les* e.g. t%o ta$les* o$Aects* str'ct'res or strings. The i"" tool provides differences concerning type and val'e. If yo' do'$le clic9 on a hit in the diff res'lt list* the varia$les are displayed in parallel* and the de$'gger navigates to the difference.

In order to ass're good perfor(ance of the diff tool* even for deeply nested varia$les no ,deep diff, is e5ec'ted. This (eans that if yo' have for e5a(ple an internal ta$le as the attri$'te of an o$Aect* then yo' can at first only chec9 if the ta$les of $oth o$Aects are e>'al. :o' %ill not get details a$o't %here they differ. To get the details of differences* yo' can r'n a diff for

the 'ne>'al s'$co(ponents ( i"" $'tton in the corresponding res'lt line). :o' can 'se the.istory ta$ to get $ac9 to the first res'lt list.

3ow to de$ug 3TTP re>uests


&o%adays* distri$'ted JTTP $ased applications (li9e -SP* .e$ Dynpro for A-AP applications) are the reality in (any IT scenarios. To tro'$leshoot s'ch applications* yo' ('st $e a$le to de$'g JTTP re>'ests. Cse transaction SI31 to activate the de$'gger for a specific %e$ service and a specific 'ser ((en' Edit-> e#ugging->Acivate e#ugging). Please 9eep in (ind that yo'r %e$ application ('st r'n on the server %here yo' set 'ser $rea9points and/or %here yo' activate JTTP de$'gging via SI31. Please refer to SAP note @2# for the details on JTTP de$'gging.

After activating de$'gging* yo' %ill stop in the syste( code of the http re>'ests in the de$'gger. :o' can set ne% 'ser $rea9points contin'ing. or %atchpoints to reach the point of interest. Don6t forget to save the( $efore

3elpful de$ugger o%-codes


Ah activate de$'gging Ahs activate syste( de$'gging Aha s9ip dynpro (PAI* P-=) and directly de$'g A-AP code Ah/ detach de$'gger Ahmusa create (e(ory snapshot (can $e 'sed in the transaction SS4)4=?:SI&SP)3T=? for (e(ory cons'(ption analysis) ;d$g in S* 7 restart of a finished or crashed $ac9gro'nd Ao$ for de$'gging Aron start A-AP ?'nti(e Analysis (eas're(ent (transaction S);<) Aroff stop A-AP ?'nti(e Analysis (eas're(ent (transaction S);<)

Potrebbero piacerti anche