SAPSQL_AGGREGATE_NOT_ALLOWED is an ABAP runtime error which you may come across when using or developing within an SAP system. See below for the standard details explaining what it means and how you can avoid or fix this runtime error.
Short Dump Classification: A - ABAP Programming Error
You can view further information about a runtme error by using transaction code ST22 which will show you this and all runtime erros that have happen in your SAP system.
Also check out the Comments section below to view or add related contributions and example screen shots.
The application program needs to be changed so that the dynamic field
list does not contain any aggregate functions for this SELECT or so
that it contains COUNT( * ) as the only entry.
Illegal use of aggregate functions in a dynamic field list.
Please see abap error for more details about the possible cause of this runtime error and how it could be avoided.
In a dynamic SELECT list, an illegal aggregate function has been used
with a FOR ALL ENTRIES SELECT.
In a SELECT with a FOR ALL ENTRIES condition, an illegal aggregate
function has been used in a dynamically entered field list. In SELECTS
with a FOR ALL ENTRIES condition, the only legal aggregate function is
COUNT( * ) without any other columns.
This is the same as a statically entered field list.
SAPSQL_AGGREGATE_NOT_ALLOWED - sapsql aggregate not allowed SAPSQL_AGGREGATE_LOB - sapsql aggregate lob SAPSQL_AGGREGATE_ILL_TABTYPE - sapsql aggregate ill tabtype SAPSQL_ACCESS_TO_RHS_TABLE - sapsql access to rhs table SAPGUI_NO_EVENT_DESCRIPTION - sapgui no event description RUNT_INTERNAL_ERROR - runt internal error