You are able to make calculations in field with a numeric data type: You generate an aggregation condition. The result of the calculation is then displayed in a separate results row.
Usually all values in a field are used in a calculation during aggregation. You are also able to obtain intermediate results. To do this you have to sort the ALV output and group the rows that you want to use for the intermediate result (see Sorting).
You are able to make the following settings for aggregations:
● Creating, getting, and deleting an aggregation rule
● Making settings for aggregation (see Settings for Aggregation )
● Generating intermediate results (see Intermediate Results)
● Hiding and showing interface elements for calculations or intermediate results (see Providing Standard ALV Functions)
You are able to create a maximum of one aggregation rule for a field. Aggregation is a property of a field in the ALV output. To create, get, or delete the aggregation rule of a field, use the methods of the interface class IF_SALV_WD_AGGR (implementing class CL_SALV_WD_FIELD).
Methods for Creating, Getting, and Deleting the Aggregation Rule
Function |
Method |
Get aggregation rule |
GET_AGGR_RULE |
Create aggregation rule |
CREATE_AGGR_RULE |
Delete aggregation rule |
DELETE_AGGR_RULE |
The aggregation rule of a field is represented by an object of the class CL_SALV_WD_AGGR_RULE.
If you assign a new data table with a new structure to your ALV output, all aggregation rules for all fields are deleted automatically.