Hi,
Problem is with corresponding fields of table.Please create appropriate structure and try it.
I tried the below code and it was working.
TYPES : BEGIN OF ty_sflight ,
carrid TYPE sflight-carrid,
seatsmax TYPE sflight-seatsmax,
END OF ty_sflight.
DATA: t_sflight TYPE TABLE OF ty_sflight,
l_sflight TYPE ty_sflight.
SELECT carrid SUM( seatsmax ) FROM sflight INTO TABLE t_sflight GROUP BY carrid.
LOOP AT t_sflight INTO l_sflight.
WRITE :/ l_sflight-carrid, l_sflight-seatsmax.
ENDLOOP.
Regards,
Peri