Entering content frameBackground documentationCounting Fields Locate the document in its SAP Library structure

The Counter option causes the counter number for a particular field to be increased by 1 every time that this field is found within the data set currently being read. The resulting counter total is displayed in much the same manner as a grand total at the end of the basic list. Just as with sum totals, counter subtotals can be displayed for individual control levels. These counter subtotals show how many values have been assigned to a particular control level.

Unlike totaling, counting fields are not displayed automatically. Fields you want to display counting fields for must be dragged to the Counter toolbar. This toolbar can be displayed by choosing Tools ® Counting fields on/off.

Note

The Counter option can also be selected for non-numerical fields.

Example

In this example, suppose you want to generate a list which contains booking information for each flight. A subtotal of revenues per booking should be displayed for each flight and a line containing a sum total of everything should appear at the end of the list. In addition, you want to know how many bookings were made per flight.

  1. Choose fields as shown below. Numeric fields are automatically totaled. Since you only want to total the field Amount (in foreign currency), use the trash can to delete the totals for the other fields.
  2. Sort the list according to the field Flight date. The flight date now appears at the beginning of each control level. Subtotals are displayed prior to each change of date.
  3. In order to find out how many bookings have been made per flight, choose Tools ® Counting fields on/off. The Counting fields toolbar appears. If the option Control level end - Display counter is selected in the Output Options for Control Levels (this is the setting in the standard), the number of bookings is displayed for each control level and the total number of bookings is displayed at the end of the list.

This graphic is explained in the accompanying text

 

Leaving content frame