CNT


Basic form

... CNT(h) ...

Effect

CNT(h) is not a statement, but a field which is automatically created and filled by the system if f is a sub-field of an extract dataset .

CNT(h) can only be addressed from within a LOOP on a sorted extract.
TypeStandard output lengthOutput
Clen left-justified
D8 left-justified
F22 right-justified
I11 right-justified
Nlen left-justified
P2*len or 2*len+1 right-justified
T6 left-justified
X2*len left-justified
sorted extract.

If h is a non-numeric field (see also ABAP/4 number types ) from the field group HEADER and part of the sort key of the extract dataset, the end of a control level (AT END OF , AT LAST ) is such that CNT(h) contains the number of different values which the field h has accepted in the group, i.e. the number of records in the group for which the field f has changed its value.
Related
SUM(g)

Index
© SAP AG 1996