SAP Message RSDA401 - Aggregate function &2 for field &1 not allowed with "FOR ALL ENTRIES"

RSDA401 : Aggregate function &2 for field &1 not allowed with "FOR ALL ENTRIES"