Entering content frameProcedure documentation Executing Queries Online Locate the document in its SAP Library structure

To execute a query online, select Query followed by Execute or Execute with variant. If you select Execute with variant, you see a dialog box where you can enter the variant name.

Note

A variant is a saved set of selection criteria for a query or the report generated by the query. If you specify a variant when starting a query, the system uses the values in the variant for the query selection criteria.

You enter variants on the selection screen and save them under any name. For each query, you can create any number of variants. To create a variant, select Goto ® Maintain variants.

With queries from the global query area you can create system variants. For further information, see Query Areas.

For further information about variants, please refer to the appropriate sections in the ABAP User Manual or to the online documentation Getting started with R/3.

You can create one standard variant per query. This standard variant is always used when you choose Execute. If you select Exec. with variant, the system sets the standard variant as the default value (see Assigning Title, Format, and Notes ).

In addition to the functions Execute and Execute with variant, the function Test is also available on query maintenance screens. This function allows you to determine the maximum number of read accesses to the database and thus is especially useful for test purposes.

When you execute this function, a window appears where you can determine the maximum number of data records you want to read. Each individual record is considered a database access. If you are using a logical database to select data from multiple tables, all records from all tables used are counted. The system terminates data selection when the maximum number of selections has been reached. You can also enter a variant in this same window if you want to execute with variant.

After you choose one of the functions described above, the selection screen is sent. Here you may enter selection criteria, just as if you were starting a report. Below is an example of a selection screen.

This graphic is explained in the accompanying text

Selection screens normally consist of two parts:

Note

These program parameters may consist of any of the following:

Caution

The radio button SAP List Viewer is set in the selection screen under Output type. Many of the query-specific output functions mentioned in the following sections are available to you if you choose ABAP List as an output form.

When you have entered the selections, choose Execute to display your list.

This graphic is explained in the accompanying text

Whenever a query is started and no entries are made on the selection screen, a dialog box appears asking you to limit the number of database accesses. Here you can either enter a number of your choice or confirm the default value (100). This dialog box prevents you from starting queries and mistakenly reading the entire dataset contained within an InfoSet.

All selection criteria and parameters from you selection screen are checked to see if the number of database accesses should be limited. The following parameters are NOT checked:

The query is executed without further testing as soon as the system comes across a single parameter or selection criteria in any of the other fields. If this is not the case, the dialog box asking you to restrict the number of database accesses appears, much the same as the dialog box that appears during the Test function. (Exception: this does not occur if you are executing the query with variants or in the background).

If you want to output the list to a printer instead of the screen, choose Program ® Execute and Print from your selection screen. You then see a screen where you can specify the print options.

For a description of the different options, refer to the ABAP User Manual and the online documentation Getting started with R/3.

Note

You can also display the list on the screen first and then select Print.
If a query contains multiple sublists, a dialog box appears with checkboxes allowing you to select which sublists you want to be printed.

 

 

 

 

Leaving content frame