Show TOC

Background documentationSettings for Aggregation Locate this document in the navigation structure

 

You are able to make the following settings for the calculation of field values:

  • Specify aggregation types

  • Specify the position of the results row

  • Disallow aggregation for a field

Specifying Aggregation Types

The following calculation (aggregation) types are available:

  • Total

    Adds together all values of the field

  • Minimum

    Determines the lowest value of the field

  • Maximum

    Determines the highest value of the field

  • Mean value

    Determines the geometric average of all values of the field

To define the calculation type, use methods of class CL_SALV_WD_AGGR_RULE.

Methods for changing the calculation type

Function

Method

Specify calculation type

SET_AGGREGATION_TYPE

Get calculation type

GET_AGGREGATION_TYPE

In addition to the calculation types listed above, you can also determine the total number of data records. The result is displayed in the results row in the first available column. Because this setting affects the entire ALV output, you use methods of interface class IF_SALV_WD_FIELD_SETTINGS (implementing class CL_SALV_WD_CONFIG_TABLE).

Methods for displaying the data records of a result

Function

Method

Display the number of data records

SET_COUNT_RECORDS_ENABLED

Check whether the number of data records is displayed

IS_COUNT_RECORDS_ENABLED

Specifying the Position of Results Rows

You are able to define whether you wish to display the results row for the calculations in an ALV output above or below the rows that are included in the calculation. To do this, you use the methods of interface class IF_SALV_WD_FIELD_SETTINGS (implementing class CL_SALV_WD_CONFIG_TABLE).

Methods relating to the position of the results row

Function

Method

Place results row before data records

SET_AGGR_BEFORE_ITEMS

Check whether the results row is placed before the data records

IS_AGGR_BEFORE_ITEMS

Disallowing Aggregation for a Field

By default, all fields with a numeric data type can be aggregated. You can disallow the aggregation of a field, if required. This has the following effects:

  • The column in question is no longer available on the Calculation tab of the Settings dialog box.

  • If you have defined an aggregation rule for this field in your application, the calculation is not carried out.

To forbid the aggregation of a field, use the methods of interface class IF_SALV_WD_AGGR (implementing class CL_SALV_WD_FIELD).

Methods for forbidding aggregation

Function

Method

Forbid aggregation

SET_AGGREGATION_ALLOWED

Check whether aggregation is allowed

IS_AGGREGATION_ALLOWED