************************************************************************
* Performance Tuning using parallel cursor
*
* Extracts from program ZFAL2002
************************************************************************
************************************************************************
* START-OF-SELECTION
SELECT *
INTO TABLE I_KEPH FROM KEPH
WHERE KADKY <= SY-DATUM
AND TVERS = '01'
AND KALKA IN ('01','Z1','Z2')
AND BWVAR IN ('Z01','Z02','Z03','Z04','Z07')
AND KKZST = ' '
AND KKZMA = ' '
AND KKZMM = ' '
AND KEART = 'H'
AND PATNR = 0.
* Table must be sorted to ensure all required records are together
SORT I_KEPH BY KALNR KALKA BWVAR KADKY.
* Perform actual processing
Perform get_cost_values.
*----------------------------------------------------------------------*
FORM GET_COST_VALUES.
* Determine start position and then process all records for given key
* from that starting point
* i_keph is sorted on kalnr kalka bwvar kadky.
READ TABLE I_KEPH WITH KEY KALNR = W_KEKO-KALNR
KALKA = W_KEKO-KALKA
BWVAR = W_KEKO-BWVAR
KADKY = W_KEKO-KADKY BINARY SEARCH.
IF SY-SUBRC = 0.
* Loop at itab from first record found (sy-tabix) until record
* no-longer matches your criteria.
LOOP AT I_KEPH FROM SY-TABIX.
IF I_KEPH-KALNR = W_KEKO-KALNR AND I_KEPH-KALKA = W_KEKO-KALKA
AND I_KEPH-BWVAR = W_KEKO-BWVAR AND I_KEPH-KADKY = W_KEKO-KADKY.
* Key match
D_MAT_COST = D_MAT_COST + I_KEPH-KST001.
D_LAB_COST = D_LAB_COST + I_KEPH-KST004.
D_OVER_HEAD = D_OVER_HEAD + I_KEPH-KST010.
D_EXT_PURCH = D_EXT_PURCH + I_KEPH-KST014.
D_MISC_COST = D_MISC_COST + I_KEPH-KST002 + I_KEPH-KST003
+ I_KEPH-KST005 + I_KEPH-KST006 + I_KEPH-KST007
+ I_KEPH-KST008 + I_KEPH-KST009 + I_KEPH-KST011
+ I_KEPH-KST012 + I_KEPH-KST013 + I_KEPH-KST015
+ I_KEPH-KST016 + I_KEPH-KST017 + I_KEPH-KST018
+ I_KEPH-KST019 + I_KEPH-KST020 + I_KEPH-KST021
+ I_KEPH-KST022 + I_KEPH-KST023 + I_KEPH-KST024
+ I_KEPH-KST025 + I_KEPH-KST026 + I_KEPH-KST027
+ I_KEPH-KST028 + I_KEPH-KST029 + I_KEPH-KST030
+ I_KEPH-KST031 + I_KEPH-KST032 + I_KEPH-KST033
+ I_KEPH-KST034 + I_KEPH-KST035 + I_KEPH-KST036
+ I_KEPH-KST037 + I_KEPH-KST038 + I_KEPH-KST039
+ I_KEPH-KST040.
ELSE.
* Key greater - can't be less
EXIT. " Exit loop
ENDIF.
ENDLOOP.
ENDIF.
D_MAT_COST = D_MAT_COST / W_KEKO-LOSGR.
D_LAB_COST = D_LAB_COST / W_KEKO-LOSGR.
D_OVER_HEAD = D_OVER_HEAD / W_KEKO-LOSGR.
D_EXT_PURCH = D_EXT_PURCH / W_KEKO-LOSGR.
D_MISC_COST = D_MISC_COST / W_KEKO-LOSGR.
ENDFORM. " GET_COST_VALUES
Monday, December 3, 2007
Performance Tuning using Parallel cursor
Labels:
Performance tuning using GROUPBY
Subscribe to:
Post Comments (Atom)
Blog Archive
-
▼
2007
(952)
-
▼
December
(236)
- Working with events in a Global Class
- Events in Table Maintenance
- Archiving IDocs
- Using Sorted table and Index while processing Inte...
- Highlighting only a particular cell instead of ent...
- Raising exceptions in a method and handling the sa...
- Maintaining Translations for Work item texts and O...
- Understanding "Local Workflow"
- Implementing Enhancements in a view
- Sending recursive mails upon reaching the deadline...
- ABAP Proxy communication
- Creation of a web service in SAP
- Step by Step approach to ceate simple BDC session ...
- General Application Transaction Codes
- Inroduction TO LSMW
- 24 Column Account Managers Report
- sap ABAP report on Column Account Managers Report
- sap ABAP report on Detail Transaction Report (DTR)...
- sap ABAP report on Summary Statement Quick Reference
- free download book on abap reporting on all modules
- ABAP REPORTS
- Report YRS_DOWNLOAD_TRANSPORT_REQUEST
- Report YRS_UPLOAD_TRANSPORT_REQUEST
- Displaying Available Report Variants in sap
- Creating Report Variants in sap
- SAP helpful reports, transactions and tables
- Useful SAP Tables
- ABAP REPORTING
- SAP Solution Manager’s centralized solution
- SAP Solution Manager
- Report Tree Using SARP and SERP
- User Profile Parameters
- XML sample file
- XSLT options
- Create XSLT program
- XML XSLT with ABAP
- Transport Guide
- ABAP Acronyms
- ABAP Code Sample
- ALV Pdf books
- ALV Articles
- Class ALV
- How to do the EXCISE ANNEXURE10 report?
- How to calculate last date of the month?
- How to change the deadline of the workitem program...
- How to convert from one currency value to other?
- How do I display / add the Terms and Conditions to...
- How do I create a long text for a document?*
- Where are the long texts of a document stored and ...
- I am using a SELECT query on a database table. Sin...
- How can I convert numerals into the corresponding ...
- How can I read an Excel file from presentation ser...
- How can I download my internal table into an Excel...
- How can I get the IP address of the system program...
- How do I download data in my internal table in a C...
- How to convert a date to internal or external format?
- How are RANGES different from SELECT-OPTIONS?
- What does R/3 stands for ?
- What does ABAP stand for?
- What is this new transaction 'n' all about?
- Casino Game in SAP ABAP
- Moving Characters in SAP ABAP Report Output
- Database Table Operations- A Performance Considera...
- SAP ABAP Performnace consideration while using ‘fo...
- Applying the having clause
- Avoid nested SELECT-ENDSELECT loops
- Use high-speed array operations with UPDATE, INSER...
- Coding Style
- Building A Binary Table
- how can we change the font for weite statement
- Import graphics to SAP
- Uploading Graphics TTF files into SAp Script Text
- Schedule Background Job
- How to change Package name/Development class for a...
- Useful User Paramters
- Finding a transaction code via SE93
- Standard Conversion Exits
- How to transport Standard Texts
- Search SAP Menu
- A FM which can create internal session
- Procedure for uploading Font
- Save content of internal tables in Excel format du...
- Where all SAP ABAP programs get stored!!
- Debugging a popup window
- Spool Conversion tp PDF
- A tips on error message while writting a BDC program
- Get the next available number in Number Range Object
- SAP ABAP Macro to validate Date
- Adding pushbuttons on the application toolbar of r...
- Display your report output lines inside a Title Box
- Using Subscreens on Report Selection Screens
- Save your ABAP report list output in your desktop ...
- Listbox on Selection Screen
- Get the Report selection Criteria
- What is sequence of event triggered in report?
- What is the difference between Primary key and Uni...
- What are the various types of selection screen event?
- What are standard layouts sets in the SAP Script?
- What are the data types of Internal Tables?
- What is the difference between 'Select single * ' ...
-
▼
December
(236)
No comments:
Post a Comment