I did not see this until now, several months later. (My ISP stopped providing news server support, and the "new" and not so improved Google Groups does not notify me when new posts appear.) So this is no doubt too late for the OP, but I'll post it for the archives. The following AGGREGATE command in SPSS will give the same result as the OP's line of Stata code:
AGGREGATE
/OUTFILE=* MODE=ADDVARIABLES
/BREAK=hhid
/hhincome=SUM(totalinc).
Here is a demonstration, starting with Stata, and following with SPSS.
// Start of Stata code
// Use data file from this UCLA tutorial to illustrate:
//
https://stats.idre.ucla.edu/stata/modules/reshaping-data-wide-to-long/
use
https://stats.idre.ucla.edu/stat/stata/modules/faminc, clear
reshape long faminc, i(famid) j(year)
list, clean noobs
// Rename variables to match OPs variable names
rename (famid faminc) (hhid totalinc)
list, clean noobs
// Now execute the OP's Stata code and list the results
bysort hhid: egen hhincome=total(totalinc)
list, clean noobs
// End of Stata code
*** Start of SPSS syntax ***.
DATA LIST LIST / hhid year totalinc (3F8.0).
BEGIN DATA
1 96 40000
1 97 40500
1 98 41000
2 96 45000
2 97 45400
2 98 45800
3 96 75000
3 97 76000
3 98 77000
END DATA.
AGGREGATE
/OUTFILE=* MODE=ADDVARIABLES
/BREAK=hhid
/hhincome=SUM(totalinc).
LIST.
*** End of SPSS syntax ***.
Output from the final list command in the Stata code:
. list, clean noobs
hhid year totalinc hhincome
1 96 40000 121500
1 97 40500 121500
1 98 41000 121500
2 96 45000 136200
2 97 45400 136200
2 98 45800 136200
3 96 75000 228000
3 97 76000 228000
3 98 77000 228000
Output from the LIST command in the SPSS code:
hhid year totalinc hhincome
1 96 40000 121500.0
1 97 40500 121500.0
1 98 41000 121500.0
2 96 45000 136200.0
2 97 45400 136200.0
2 98 45800 136200.0
3 96 75000 228000.0
3 97 76000 228000.0
3 98 77000 228000.0