Generate intermediate results
Use
When you perform a calculation, the system uses all values of a numeric column. You can also display intermediate results for this calculation.
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.
To group data records that are to provide an intermediate result, you sort the list according to the required criteria.
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). See Making Calculations).
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.
Key Features
With intermediate results, you can:
-
Display intermediate result for all criteria
-
Defining Exceptions
-
Showing and Hiding Data Rows for Calculations (see 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
-
To generate intermediate results, open the Settings dialog box (see Using the Dialog Box with Settings for the List).
-
To group the data records that form an intermediate result, choose the Sorting tab. Move all columns that are to form the criteria for the intermediate result to the right-hand list.
-
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.
-
Set the Display Intermediate Results for Sorted Columns indicator, if required.
-
Apply your settings to the list.
Defining 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. To do this, you define exceptions.
-
To define exceptions, open the dialog box and choose the Calculation tab.
-
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.
-
For any columns that you do not want to use as criteria, deselect the indicator under Subtotal.
-
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.
Read Showing and Hiding Data Rows for Calculations to find out how to show and hide rows that contain individual values of the intermediate result.