Green’s Dictionary of Slang

beans! excl.

(US) a mild excl. of surprise, disbelief etc.

[US]T. Thursday ‘Stroke of Genius’ in Top-Notch 1 Apr. [Internet] ‘And they own motors and live in swell hotels. Give ’em credit!’ ‘Credit beans!’ grunted he.
[US]T. Thursday ‘Nearly Over’ in Top-Notch 15 Apr. [Internet] ‘Cheer up, Jeff,’ I said, trying to make him feel better [...] ‘Cheer up beans!’ he raved.
[US]C.G. Booth ‘Stag Party’ in Penzler Pulp Fiction (2006) 120: ‘How about it, Mr. Littner?’ Captain Littner said, ‘Beans!’.
[US]Wentworth & Flexner DAS.
[US]‘Troy Conway’ Cunning Linguist (1973) 47: ‘Oh, beans,’ I sighed, stymied. I still had a job to do, no matter how good she was in the sack.
[US]H. Rawson Dict. of Invective (1991) 14: Foods also serve as metaphors for nonsense, e.g., applesauce, baloney, banana oil, beans, mush, pap, and tripe.