Retirement tax questions

Thank you!  I am creating the 1099R form. What code do I enter for box 7?    I think it will be 8, J, or both.  My main concern is that I am only taxed on the earnings, and not the excess contribution. 

I withdrew $9437.   $7000 was excess contribution for 2024, and $2437 was the earnings.