Retirement tax questions

I got two 1099-R. One is P, and the other is 8 which is for the current year.  The second one is the investment gain from the excess amount.  Both say 2017 as the calendar year.