Professional Documents
Culture Documents
1. Select statement
Ensure that data is selected with primary key / secondary index.
Avoid negative WHERE cause (“NE”) because negative where clauses disable the index.
Avoid long selects within AT SELECTION-SCREEN event.
Select up to 1 rows when 'where' clause fields <> 'primary key fields‘
E.G. Select MATNR UPTO 1 rows from VBAP Where VBELN = ‘0001500080’
Select single when 'where' clause fields = 'primary key fields'
E.G. Select single AUDAT VBTYP from VBAK Where VBELN = ‘0001500080’
Select with join instead of nested select statements, if the number of record to be fetched is
more than 5. Ensure that join fields are the keyed field.
Limit tables in a join to three tables.
Select field only instead of select *, when no. of fields < 1/3 rd of total fields in table or no fields
getting selected less than or equal to 16.
Use SAP standards view for multiple table data selection.
Data should not be selected within loop …. Endloop statements. Instead use the select
statement in join or for all entries.
Select with where condition instead of checking them yourself with check-statemens
intransparent tables, else use the check-stateent in the pooled/cluster tables.
For a buffered table, if a program does requesre the lates data from a table it is better to qualify
the SELECT statenebt with ‘BYPASSING BUFFER’ specification.
Accesses to cluster type tables via non-key selection criteria should be avoided if possible.
Select using an aggregate function (SUM, MIN, MAX, COUNT) instead of computing the
aggregates yourself.
Use select into table than select + append statement.
2. Internal table usage
3. Database index