Sunan Abi Dawud, Book 2, Hadith 82 (Abu Dawud 472)

Abu Hurairah reported the Messenger of Allah (May peace be upon him) as saying; one shall have the thing the for which one comes to the mosque.