Can the same earned income be used to contribute to Roth 401k and Roth IRA?

I have an S-Corp where I am the sole owner-employee. I take the majority of my income as business income on schedule K and don't have much W2 Income. 

For simplicity sake, I have 20k in W2 income and 60k in schedule K income. 

Can I have a solo Roth 401k and max it out at 18k and then also have a Roth IRA, which I max out at 5500. Which at 23500 is more than my 20k in income.

I would think with normal pre-tax this wouldn't be possible as the 401k would reduce your earned income, but since the roth 401k wouldn't affect my W2, could I then still go and roth IRA 5500?