REPORT ZTRUERSP NO STANDARD PAGE HEADING.
*********************************************************************
* Display the true average response time.
* The result of this report contains the same data the ST03-workload
* overview screen has with one major difference: the values belonging
* to a defined set of abaps usually running online and taking a very
* long time to complete are ignored during the calculation. These
* abap's response time is not a real dialog response time (even if
* they run in dialog mode) and it can completely offset the actual
* response time of ST03 as well as all the other values (cpu time,
* sequential read ...)
*********************************************************************
TABLES: TRDIR.
DATA: R TYPE P DECIMALS 1, K TYPE P DECIMALS 1, I TYPE I, X TYPE I,
Y TYPE I, ELEM_PER_ROW TYPE I VALUE 8, LASTREC(8), ELAPSTIM(8).
*
DATA: BEGIN OF LIST OCCURS 10.
INCLUDE STRUCTURE MSXXLIST.
DATA: END OF LIST.
DATA: BEGIN OF SUMMARY OCCURS 50.
INCLUDE STRUCTURE SAPWLSUMRY.
DATA: END OF SUMMARY.
DATA: BEGIN OF HI OCCURS 50.
INCLUDE STRUCTURE SAPWLHITL.
DATA: END OF HI.
DATA: BEGIN OF STAB.
INCLUDE STRUCTURE SAPWLSUMRY.
DATA: END OF STAB.
*
PARAMETERS: DATE LIKE SY-DATUM MODIF ID SC1 OBLIGATORY.
PARAMETERS: SERVER(8) MODIF ID SC1 OBLIGATORY LOWER CASE.
PARAMETERS: TRUE_RSP AS CHECKBOX.
SELECT-OPTIONS ABPAP FOR TRDIR-NAME NO INTERVALS.
*
PERFORM CALCULATE.
FORMAT INTENSIFIED OFF.
* box1
PERFORM BOX USING 1 4 'Instance'.
SKIP TO LINE 2. POSITION 2.
* line1
WRITE: /2 'SAP System',
18 SY-SYSID,
29 'First record',
45 '00:00:00',
56 'Date',
72 DATE.
* line2
IF DATE = SY-DATUM.
LASTREC = SY-UZEIT.
ELSE.
LASTREC = '235959'.
ENDIF.
WRITE: / 'Server' UNDER 'SAP System',
SY-HOST UNDER SY-SYSID,
'Last record' UNDER 'First record',
LASTREC USING EDIT MASK '__:__:__' UNDER '00:00:00'.
* line3
READ TABLE LIST INDEX 1.
TRANSLATE LIST-SERV USING 's a p d '.
CONDENSE LIST-SERV NO-GAPS.
WRITE: / 'Instance no.' UNDER 'SAP System',
LIST-SERV UNDER SY-SYSID,
'Elapsed time' UNDER 'First record',
LASTREC USING EDIT MASK '__:__:__' UNDER '00:00:00'.
* box2
PERFORM BOX USING 7 14 'Workload'.
SKIP TO LINE 8. POSITION 2.
* line1
WRITE: /2 'CPU time',
26 STAB-CPUTI LEFT-JUSTIFIED,
38 'Database calls',
62 STAB-PHYCALLS LEFT-JUSTIFIED.
* line2
R = STAB-READDIRCNT + STAB-READSEQCNT + STAB-CHNGCNT.
WRITE: / 'Elapsed time' UNDER 'CPU time',
STAB-ELAPSEDTI UNDER STAB-CPUTI LEFT-JUSTIFIED,
'Database requests' UNDER 'Database calls',
R UNDER STAB-PHYCALLS LEFT-JUSTIFIED.
* line3
WRITE: / ' Direct reads' UNDER 'Database calls',
STAB-READDIRCNT UNDER STAB-PHYCALLS LEFT-JUSTIFIED.
* line4
WRITE: / 'Dialog steps' UNDER 'CPU time',
STAB-COUNT UNDER STAB-CPUTI LEFT-JUSTIFIED,
'Sequential reads' UNDER 'Database calls',
STAB-READSEQCNT UNDER STAB-PHYCALLS LEFT-JUSTIFIED.
* line5
R = STAB-RESPTI / STAB-COUNT.
WRITE: / ' AV. response time' UNDER 'CPU time',
R UNDER STAB-CPUTI LEFT-JUSTIFIED,
'Changes' UNDER 'Database calls',
STAB-CHNGCNT UNDER STAB-PHYCALLS LEFT-JUSTIFIED.
* line6
R = STAB-CPUTI / STAB-COUNT.
WRITE: / ' AV. CPU time' UNDER 'CPU time',
R UNDER STAB-CPUTI LEFT-JUSTIFIED.
* line7
R = STAB-QUEUETI / STAB-COUNT.
K = STAB-READDIRTI + STAB-READSEQTI + STAB-CHNGTI.
K = K / ( STAB-READDIRCNT + STAB-READSEQCNT + STAB-CHNGCNT ).
WRITE: / ' AV. wait time' UNDER 'CPU time',
R UNDER STAB-CPUTI LEFT-JUSTIFIED,
'Time per DB request' UNDER 'Database calls',
K UNDER STAB-PHYCALLS LEFT-JUSTIFIED.
* line8
R = STAB-READDIRTI / STAB-READDIRCNT.
K = STAB-LOADGENTI / STAB-COUNT.
WRITE: / ' AV. load time' UNDER 'CPU time',
K UNDER STAB-CPUTI LEFT-JUSTIFIED,
' Direct reads' UNDER 'Database calls',
R UNDER STAB-PHYCALLS LEFT-JUSTIFIED.
* line9
R = STAB-READSEQTI / STAB-READSEQCNT.
K = ( STAB-READDIRTI + STAB-READSEQTI + STAB-CHNGTI ) / STAB-COUNT.
WRITE: / ' AV. DB req. time' UNDER 'CPU time',
K UNDER STAB-CPUTI LEFT-JUSTIFIED,
' Sequential reads' UNDER 'Database calls',
R UNDER STAB-PHYCALLS LEFT-JUSTIFIED.
* line10
R = ( STAB-BYTES / 1024 ) / STAB-COUNT.
K = STAB-CHNGTI / STAB-CHNGCNT.
IF TRUE_RSP = 'X'.
WRITE: / ' AV. bytes req.' UNDER 'CPU time' COLOR 6,
R UNDER STAB-CPUTI LEFT-JUSTIFIED COLOR 6,
' Changes and commis' UNDER 'Database calls',
K UNDER STAB-PHYCALLS LEFT-JUSTIFIED.
ELSE.
WRITE: / ' AV. bytes req.' UNDER 'CPU time',
R UNDER STAB-CPUTI LEFT-JUSTIFIED,
' Changes and commis' UNDER 'Database calls',
K UNDER STAB-PHYCALLS LEFT-JUSTIFIED.
ENDIF.
* line11
WRITE: / .
* line12
R = STAB-ROLLINTI / STAB-ROLLINCNT.
WRITE: / 'Roll-ins' UNDER 'CPU time',
STAB-ROLLINCNT UNDER STAB-CPUTI LEFT-JUSTIFIED,
'Av. time/roll in' UNDER 'Database calls',
R UNDER STAB-PHYCALLS LEFT-JUSTIFIED.
* line13
R = STAB-ROLLOUTTI / STAB-ROLLOUTCNT.
WRITE: / 'Roll-outs' UNDER 'CPU time',
STAB-ROLLOUTCNT UNDER STAB-CPUTI LEFT-JUSTIFIED,
'Av. time/roll out' UNDER 'Database calls',
R UNDER STAB-PHYCALLS LEFT-JUSTIFIED.
* box3
PERFORM BOX USING 23 6 'Task types'.
SKIP TO LINE 24. POSITION 2.
WRITE /2
'Only dialog times! The following long running reports are excluded:'.
FORMAT INTENSIFIED ON.
LOOP AT ABPAP.
Y = 25 + ( ( SY-TABIX - 1 ) DIV ELEM_PER_ROW ).
X = ( ( SY-TABIX - 1 ) MOD ELEM_PER_ROW ) * 9 + 2.
SKIP TO LINE Y. POSITION X.
WRITE ABPAP-LOW.
ENDLOOP.
*
INITIALIZATION.
DATE = SY-DATUM.
SERVER = SY-HOST.
*
*---------------------------------------------------------------------*
* FORM BOX *
*---------------------------------------------------------------------*
FORM BOX USING VALUE(YPOS) HEIGHT TEXT.
*
DATA: WIDTH TYPE I VALUE 84,
R TYPE I, K TYPE I.
* Bottom horizontal line
R = HEIGHT + YPOS.
SKIP TO LINE R.
DO WIDTH TIMES.
WRITE '-' NO-GAP.
ENDDO.
* Top horizontal line with text
K = STRLEN( TEXT ).
R = WIDTH - 2 - K.
SKIP TO LINE YPOS.
WRITE: '--'.
WRITE AT 3(K) TEXT NO-GAP.
DO R TIMES.
WRITE: '-' NO-GAP.
ENDDO.
* Vertical lines
DO HEIGHT TIMES.
SKIP TO LINE YPOS.
WRITE: '|'. POSITION WIDTH. WRITE: '|'.
YPOS = YPOS + 1.
ENDDO.
ENDFORM.
*---------------------------------------------------------------------*
* FORM CALCULATE *
*---------------------------------------------------------------------*
FORM CALCULATE.
* Get the performance data
CALL FUNCTION 'TH_SERVER_LIST'
TABLES
LIST = LIST.
CALL FUNCTION 'SAPWL_GET_SUMMARY_STATISTIC'
EXPORTING
PERIODTYPE = 'D'
HOSTID = SERVER
STARTDATE = SY-DATUM
TABLES
SUMMARY = SUMMARY
HITLIST_RESPTI = HI.
LOOP AT SUMMARY.
IF SUMMARY-TASKTYPE = 'DIALOG'.
MOVE-CORRESPONDING SUMMARY TO STAB.
ENDIF.
ENDLOOP.
* Correction with the abaps
IF TRUE_RSP = 'X'.
LOOP AT HI.
LOOP AT ABPAP.
IF HI-REPORT = ABPAP-LOW.
STAB-CHNGCNT = STAB-CHNGCNT - HI-UPDCNT -
HI-DELCNT - HI-INSCNT.
STAB-CHNGTI = STAB-CHNGTI - HI-UPDTI - HI-DELTI -
HI-INSTI.
STAB-COUNT = STAB-COUNT - 1.
STAB-CPUTI = STAB-CPUTI - HI-CPUTI.
STAB-LOADGENTI = STAB-LOADGENTI - HI-GENERATETI -
HI-REPLOADTI - HI-CUALOADTI - HI-DYNPLOADTI.
STAB-PHYCALLS = STAB-PHYCALLS - HI-PHYDELCNT -
HI-PHYREADCNT - HI-PHYINSCNT - HI-PHYUPDCNT.
STAB-QUEUETI = STAB-QUEUETI - HI-QUEUETI.
STAB-READDIRCNT = STAB-READDIRCNT - HI-READDIRCNT.
STAB-READDIRTI = STAB-READDIRTI - HI-READDIRTI.
STAB-READSEQCNT = STAB-READSEQCNT - HI-READSEQCNT.
STAB-READSEQTI = STAB-READSEQTI - HI-READSEQTI.
STAB-RESPTI = STAB-RESPTI - HI-RESPTI.
STAB-ROLLINCNT = STAB-ROLLINCNT - HI-ROLLINCNT.
STAB-ROLLOUTCNT = STAB-ROLLOUTCNT - HI-ROLLOUTCNT.
STAB-ROLLOUTTI = STAB-ROLLOUTTI - HI-ROLLOUTTI.
ENDIF.
ENDLOOP.
ENDLOOP.
ENDIF.
ENDFORM.
Friday, October 15, 2010
abap program for Display the true average response time, CPU time, db time ...
Subscribe to:
Post Comments (Atom)
Automation Testing
- Manual and Automation testing Challenges
- What you need to know about BVT (Build Verification Testing)
- BVT types
- Learning basics of QTP automation tool and preparation of QTP interview questions
- QuickTest Pro - QTP Functional testing tool review
- Tips you should read before automating your testing work
- Choosing Automation tool for your organization
Blog Archive
-
▼
2010
(342)
-
▼
October
(127)
- free downloadABAP/4 OLE Automation Controller pdf ...
- sap abap program Sample XML Source Code For SAP
- sap abap XML file to word document through SAP
- abap program for How to determine the number of av...
- Handling favorites in ABAP Workbench
- ABAP/4 Programming Quickstart
- Number Range Object in sap
- PERFORMENCE TIPS IN ABAP
- ABAP Tips and Tricks
- ABAP Tips and Tricks
- What is the use of the POSITION and SIZE command i...
- How to find the Driver Program for the given SAPsc...
- How can I set the header and footer in the main wi...
- What the conditional statements used in SAP Scripts?
- What the conditional statements used in SAP Scripts?
- What is the difference between the SAP Script text...
- How can I change the page size of the layout?
- How can I apply shading for the BOXes in SAP Script?
- How can I format the date being displayed in the S...
- How can I format the time in the SAP Script?
- Frequently Used System Variables in SAPScript?
- What are the different types of windows in SAP Scr...
- How can I set the position of the leading sign to ...
- What are the various text formatting options in SA...
- How can I trigger new page in SAPScripts?
- How can I prevent page-break in the message that i...
- How can I copy SAPScripts from one client to another?
- How can I print logos in SAPScripts?
- How can I copy SAPScripts from one client to another?
- How can I Word Wrap the text being displayed in SA...
- How can I display barcodes in SAPScripts?
- I have created a script in language DE. Now I need...
- ABAP Tips and Tricks
- PERFORMENCE TIPS IN ABAP
- ABAP Tips and Tricks
- Number Range Object in sap
- Handling favorites in ABAP Workbench
- abap program for How to determine the number of av...
- ABAP/4 Programming Quickstart
- Some ABAP/4 Query header line variable
- ABAP Quick Viewer
- Creating The Query
- SAP ABAP Queries
- Creating Functional Areas Without a Logical Database
- Creating Functional Areas using a Logical Database
- Creating the ABAP Query
- Creating the User Group in SAP ABAP Queries
- Ranked List and Statistics in abap query
- Data Retrieval Using Program in abap query
- Authorizations in abap query
- What Is SAP Queries
- Authorizations in abap query
- SAP Query (BC-SRV-QUE)
- click on link
- HOW TO DEVELOPE ABAP QUERY
- ABAP/4 Query Hints and Tips IN Abap Query
- ABAP Program: Output of Date Format
- ABAP Programs : Using the events start-of-selectio...
- C program that uses the GUI automatization interfa...
- This ABAP rings the bell on any chosen pc, that ha...
- Method of displaying the hidden ABAPs of SAP - fro...
- abap program for Parallel processing: breaks a rep...
- Simple macro that prevents runnig more than one in...
- abap Program to download/upload table data dynamic...
- Create/Modify/Delete records in any table from CSV...
- Displaying Graphics using an ABAP Program
- ABAP Program: Output of Date Format
- Making a Java Editor in ABAP and compiling it
- Program to Hide ABAP's Source Code and Protects it
- Program to Hide ABAP's Source Code and Protects it
- Using Different Color in ABAP
- Protect part of ABAP code from modifying
- String Handling in ABAP - Removing Unwanted Char
- How to find out Total No of Pages of a Report Outp...
- Split String into two parts at delimiter in sap abap
- Macro to validate Date in abap sap
- How to get the field descriptions of a table?
- Dynamically increase/decrease the number of batch/...
- Have active URL-s in the list an ABAP report creates
- ABAP Program: show and hide windows by request
- Perl script to check the status of the SAP systems...
- abap program for Customized, dynamic login screen
- ABAP Program for refresh dynamically - once a seco...
- ABAP Program for Limit the parallel instances a pa...
- Hide and password-protect any ABAP's source - stil...
- Display the long raw fields of such SAP tables as ...
- ABAP Program for Yet another customized logon scre...
- The abap part, that retrieves the data from the SA...
- abap program for The remote script for 96a
- ABAP Program for This perl displays a self-refresh...
- abap program for Automatically save and circulate ...
- Tree display of the UNIX process table - a click o...
- ABAP Program for Continuously display the rejected...
- abap program for Display the true average response...
- COMMUNICATION INTERFACE IN ABAP COMPLETE
- COMMUNICATION INTERFACE 1
- COMMUNICATION INTERFACE 2
- COMMUNICATION INTERFACE 3
- COMMUNICATION INTERFACE 4
- COMMUNICATION INTERFACE 5
-
▼
October
(127)
No comments:
Post a Comment