Entering content frameBackground documentation Optimizing Access to Queries Locate the document in its SAP Library structure

Background

The OPEN SQL option enables you to define SELECT and GET statements in such a way that only certain fields are read from the database table. This improves the performance in ABAP reports considerably. SAP Query uses these options to improve the runtime of query reports.

SELECT enhancement

In SELECT statements, you can specify a list of fields that you want the system to read from the database table.

Note

If you type ‘*’ as the field list, the system reads all of the fields.

Transferring fields from the database into the corresponding program fields often involves one or more conversion processes. Using a wildcard search (‘*’) is therefore ineffective if the database table contains a lot of fields, but only a few of these fields are really needed in the program. This is usually the case with query reports.

GET enhancement

The GET statement also enables you to specify a list of fields that are required in a report. Only these fields are read from the logical database. The connection between the GET statement and the SELECT statement is that in a database program the SELECT statement helps implement the GET statement. You are able to specify a field list in a GET statement only if the relevant logical database supports this option.

Functions

The term access optimization refers to the way that the query supports the use of field lists in SELECT and GET statements.

When an InfoSet is generated, a reference list is created containing all the fields that are needed in a query when the InfoSet is used.

Using additional tables and coding segments (additional fields, coding for GET and GET LATE events, record processing) is more problematic, because additional tables and coding segments can also access fields that do not appear in the reference list. If you use ABAP coding, it can sometimes happen that the InfoSet does not contain all of the information that is needed to determine the required fields. If this is the case, the system generates an incomplete reference list. This can mean that when query reports are processed some of the required fields only ever contain their initial values.

The reference list ensures that the report generator is able to determine from the list of required fields, all of the fields that are needed if an additional table or coding is used. This information enables the report generator to specify field lists for all SELECT and GET statements that are generated.

This graphic is explained in the accompanying text

Provided that an InfoSet has no additional fields and no sections of coding, a complete reference list can be created without errors when the InfoSet is generated.

Before a reference list can be generated, the system needs to know which fields are required for generating query reports. These can be the following fields:

See also:

 

 

Leaving content frame