1.ABAP/4 programs can take a very long time to execute, and can make other processes have to wait before executing. Here are some tips to speed up your programs and reduce the load your programs put on the system:
2.Use the GET RUN TIME command to help evaluate performance. It's hard to know whether that optimization technique REALLY helps unless you test it out. Using this tool can help you know what is effective, under what kinds of conditions. The GET RUN TIME has problems under multiple CPUs, so you should use it to test small pieces of your program, rather than the whole program.
3.Generally, try to reduce I/O first, then memory, then CPU activity. I/O operations that read/write to hard disk are always the most expensive operations. Memory, if not controlled, may have to be written to swap space on the hard disk, which therefore increases your I/O read/writes to disk. CPU activity can be reduced by careful program design, and by using commands such as SUM (SQL) and COLLECT (ABAP/4).
4.Avoid 'SELECT *', especially in tables that have a lot of fields. Use SELECT A B C INTO instead, so that fields are only read if they are used. This can make a very big difference.
5.Field-groups can be useful for multi-level sorting and displaying. However, they write their data to the system's paging space, rather than to memory (internal tables use memory). For this reason, field-groups are only appropriate for processing large lists (e.g. over 50,000 records). If you have large lists, you should work with the systems administrator to decide the maximum amount of RAM your program should use, and from that, calculate how much space your lists will use. Then you can decide whether to write the data to memory or swap space. See the Fieldgroups ABAP example.
6.Use as many table keys as possible in the WHERE part of your select statements.
Whenever possible, design the program to access a relatively constant number of records (for instance, if you only access the transactions for one month, then there probably will be a reasonable range, like 1200-1800, for the number of transactions inputted within that month). Then use a SELECT A B C INTO TABLE ITAB statement.
7.Get a good idea of how many records you will be accessing. Log into your productive system, and use SE80 -> Dictionary Objects (press Edit), enter the table name you want to see, and press Display. Go To Utilities -> Table Contents to query the table contents and see the number of records. This is extremely useful in optimizing a program's memory allocation.
8.Try to make the user interface such that the program gradually unfolds more information to the user, rather than giving a huge list of information all at once to the user.
9.Declare your internal tables using OCCURS NUM_RECS, where NUM_RECS is the number of records you expect to be accessing. If the number of records exceeds NUM_RECS, the data will be kept in swap space (not memory).
10.Use SELECT A B C INTO TABLE ITAB whenever possible. This will read all of the records into the itab in one operation, rather than repeated operations that result from a SELECT A B C INTO ITAB... ENDSELECT statement. Make sure that ITAB is declared with OCCURS NUM_RECS, where NUM_RECS is the number of records you expect to access.
11.If the number of records you are reading is constantly growing, you may be able to break it into chunks of relatively constant size. For instance, if you have to read all records from 1991 to present, you can break it into quarters, and read all records one quarter at a time. This will reduce I/O operations. Test extensively with GET RUN TIME when using this method.
12.Know how to use the 'collect' command. It can be very efficient.
13.Use the SELECT SINGLE command whenever possible.
Many tables contain totals fields (such as monthly expense totals). Use these avoid wasting resources by calculating a total that has already been calculated and stored.
Wednesday, February 4, 2009
Subscribe to:
Post Comments (Atom)
Archives
-
▼
2009
(86)
-
▼
February
(58)
- Vb codes (or VBA macro code) for access SAP, and r...
- An Introduction to SAP
- sap abap program for Upload Logo for REUSE_ALV_COM...
- What is SLIS in sap abap ALV
- How to Refresh ALV List/Grid once it is displayed?
- sap abap ALV 'Classic' Creating User/Global Layout...
- How to use ALV for Hierarchical Lists
- sap abap program for Sample ALV: Heading in ALV
- sap abap program for Test ALV Display With Header ...
- Sample programs on sap abap ALV Grid
- what is abap REUSE_ALV_GRID_DISPLAY Functions Example
- Display a Secondary List using ALV Grid
- sap abap program for Line Color in ALV Example
- sap abap program for How to make ALV header like t...
- sap abap program for Use Simple ALV Functions to M...
- sap abap ALV Reporting - Z_LIST_MATERIALS
- sap abap program for Reincarnation of REUSE_ALV_FI...
- ALV Reporting - REUSE_ALV_BLOCK_LIST_DISPLAY
- sap abap program for An Interactive ALV Report
- sap abap program for Example of a Simple ALV Grid ...
- ABAP Example Program ALV Grid Control
- What Are The Events In abap ALV
- abap program for Creation Of Active Icon
- using alv grid real time implementation
- Adding custom buttons on ALV grid controls
- SAP free download book on ALV grid Control Tutorial
- SAP Highlighting only a particular cell instead of...
- SAP ALV - Details of Y/Z objects with lists of use...
- SAP ALV report to find the list of infotypes confi...
- SAP ALV Report using REUSE
- ALV ABAP List Viewer
- What is ALV Programming in sap abap?
- SAP ALV Function Modules
- All the SAP Online Help in PDFs
- All the SAP Online Help in PDFs A-C
- All the SAP Online Help in PDFs D-M
- All the SAP Online Help in PDFs N-S
- All the SAP Online Help in PDFs T-Z
- PDF freedownloads for all module books
- PDF free download ALE Programming Guide
- PDF free download ALE Programming Guide
- ABAP ALE Tutorials PDF Free downloads
- PDF Free Download Advance Payments
- Adding additional fields to Delivery Due List
- PDF Free Download Actual Costing / Material Ledger
- PDF Book free download activity-Based Costing
- Free Download Activity-Based Costing CO-OM-ABC
- SAP Activity-Based Costing pdf free download
- SAP Activities/Strategies in FI
- SAP ABAP program OR implementation: Accounting Doc...
- Accessing BAPI using VB PPT free download
- SAP ABAP4 Tuning Checklist
- sap abap/4 sample codes
- SAP ABAP/4 programming language overview
- SAP ABAP/4 Optimization Techniques
- ABAP/4 OLE Automation Controller pdf book free dow...
- ABAP/4 OLE Automation Controller pdf free download
- Questions and Answers about ABAP/4 and Developments
-
▼
February
(58)
No comments:
Post a Comment