Show TOC

Procedure documentationGenerating Intermediate Results Locate this document in the navigation structure

 

When you perform a calculation, the system uses all values of a numeric column. You can also display intermediate results for this calculation. If you perform a calculation in a sorted list, by default, the system shows intermediate results wherever data was changed in the sorted column or columns.

What do intermediate results have to do with sorting?

To display intermediate results in a column in which you make a calculation using all values, you must first specify where you want to place the intermediate result: You put all the data records that contain the values for an intermediate result into one group.

The criterion for grouping data records is not in the same column as the calculations.

Example Example

A list contains an Airline column containing the names of airlines, a Flight Number column containing the flights for each airline, and an Occupancy column containing the number of seats occupied for each flight.

To determine the seat occupancy for each airline, you first sort the list by airline and group the rows that contain the relevant seating information.

End of the example.

To group data records that are to provide an intermediate result, you sort the list according to the required criteria.

You can specify multiple columns as criteria for grouping the corresponding data records. This allows you to generate a hierarchical structure of intermediate results.

Specifying Columns for Intermediate Results

You can display intermediate results in any numeric column. To specify in which of the columns you want to display intermediate results, you simply perform a calculation in one. You can use all calculation types provided by SAP List View (ALV).

For more information: .

Example Example

In the example above, you make a calculation in the Occupancy column. You choose Total as the calculation type.

End of the example.

Specifying Columns for Criterion

Some columns that you can use to sort the list cannot be used as criteria for intermediate results. Only columns that contain alphanumeric values such as text, and date, are permitted.

Example Example

In the example above, you could have also used the Flight Number column as criterion. This is because even when a column contains mostly numbers, it can still be defined as an alphanumeric column. This means that special characters and alphanumeric characters can also be included.

End of the example.

Features

With intermediate results, you can:

  • Display intermediate result for all criteria

  • Define exceptions

  • Showing and Hiding Data Rows for Calculations

Prerequisites

  • Your application permits the creation of intermediate results.

  • The columns that form the criteria for the intermediate results contain alphanumeric values.

Procedure

Display intermediate result for all criteria

  1. To generate intermediate results, open the Settings dialog box.

  2. To group the data records that form an intermediate result, choose the Sorting tab page. Move all columns that are to form the criteria for the intermediate result to the right-hand list.

  3. To specify the columns for the intermediate results, choose the Calculation tab page and specify the required calculation type for each column in which you want to display intermediate results.

  4. Set the Display Intermediate Results for Sorted Columns indicator, if required.

  5. Apply these settings to the list.

Define exceptions

If you do not want all sorted columns to be used as criterion for intermediate results, you can explicitly specify which columns you want to use as criteria and which ones you do not want to use; you do this by defining exceptions.

  1. To define exceptions, open the dialog box and choose the Calculation tab page.

  2. Choose Exception...

    In the Only Generate Intermediate Results for Some Sorted Columns dialog box, a list of all the columns you can use as criteria is displayed.

  3. For any columns that you do not want to use as criteria, deselect the indicator under Subtotal.

  4. Close the dialog box by choosing OK and apply the settings to the list.

Result

  • The list is sorted.

  • A results row is inserted wherever the value changes in columns that contain the criteria for generating intermediate results. In the columns in which you make a calculation, the intermediate result is displayed in the results rows.

More Information

Read Showing and Hiding Data Rows of Calculation for how to show and hide rows that contain individual values of the intermediate result.

Making Calculations