The document outlines performance tuning guidelines for ABAP development, emphasizing the avoidance of nested SELECT statements and SELECTs within loops to reduce data block transfers. It recommends using SELECT INTO TABLE and FOR ALL ENTRIES for efficient data handling, specifying field names in SELECT statements, and grouping SELECT statements to minimize database connections. Additionally, it suggests utilizing indexes and joins to enhance database selection performance.
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0 ratings0% found this document useful (0 votes)
3 views1 page
Performance Tuning
The document outlines performance tuning guidelines for ABAP development, emphasizing the avoidance of nested SELECT statements and SELECTs within loops to reduce data block transfers. It recommends using SELECT INTO TABLE and FOR ALL ENTRIES for efficient data handling, specifying field names in SELECT statements, and grouping SELECT statements to minimize database connections. Additionally, it suggests utilizing indexes and joins to enhance database selection performance.
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 1
Performance tuning your developments can be a matter of applying some guidelines.
Any developer should adhere to them as part of quality development. Do sing along !
Avoid nested SELECT statements
Never put a SELECT statement inside the SELECT... ENDSELECT block of another select statement.
Whenever a database request is generated by an ABAP (typically a SELECT statement
call), a block of many Kb's is moved across the network. Whenever the database "answers", a similar block of data is passed back again. Performance tuning is much about limiting the number of data blocks that are copied across the network, thus ensuring that this is only done where and when necessary. The nested select is a very effective performance killer because it consumes so many data block moves. Select within a loop: never put a SELECT statement in a loop Even when it's a SELECT SINGLE. Generally it should be possible to do the selection before the loop e.g. By doing a SELECT INTO TABLE, placing the result into an internal table. This internal table can then be READ within the loop. Use SELECT INTO TABLE and FOR ALL ENTRIES where possible Your development should really not have an ENDSELECT at all, using SELECT SINGLE, SELECT INTO TABLE and FOR ALL ENTRIES should cover every possible selection requirement you may have. Note: FOR ALL ENTRIES works as a table of restrictions. This means that the internal table defines to select from should never be empty ! Intelligent internal table usage Internal tables can be defined as sorted tables or table with a key. Abap processing on these (internal) tables is dramatically faster ! Specify field names in your SELECT statement When SELECT * is used, all fields will be copied across, while often only a few of the available fields are required. E.g. The purchase order item actually has 236 fields which adds up to over 1500 bytes. When you specify the fields you need, only these fields will be copied from database to your program. Also refrain from using the ORDER BY clause, as it consumes processor time. Keep select statements grouped together Actual database connections can "time out" so when your selections are scattered all over your source code (at runtime), new database connections need to be established. Try to do all relevant selections together. Utilise indexes To improve the performance of your development where database selection are concerned, indexes can be used. Via transaction SE11 for a table, the button "Indexes" reveals available indexes which will automatically be used when all index fields are specified in your selection. Indexes can also be added, in extreme cases (as the system maintenance for the index is itself performance sensitive). Use joins When muliple tables are invloed in your selection, linking them together in < code>JOIN can be a strong performance improver. Leave the heavy selection logic to the database, where it has been optimized for you.