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:
• 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.
• 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).
• 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.
• 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.
• 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.
• 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.
• 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.
• 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).
• 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.
• 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.
• Know how to use  the 'collect' command. It can be very efficient.
• 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.
Tuesday, October 26, 2010
PERFORMENCE TIPS IN ABAP
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