Sunan an-Nasa'i, Book 25, Hadith 56 (In-Book) ⓘ
It was narrated that Abu 'Umamah Al-Bahili said: "A man came to the Prophet and said: 'What do you think of a man who fights seeking reward and fame - what will he have?' The Messenger of Allah said: 'He will not have anything.' He repeated it three times, and the Prophet said to him: 'He will not have anything.' Then he said: 'Allah does not accept any deed, except that which is purely for Him, and seeking His Face.'"
أَخْبَرَنَا عِيسَى بْنُ هِلاَلٍ الْحِمْصِيُّ، قَالَ حَدَّثَنَا مُحَمَّدُ بْنُ حِمْيَرٍ، قَالَ حَدَّثَنَا مُعَاوِيَةُ بْنُ سَلاَّمٍ، عَنْ عِكْرِمَةَ بْنِ عَمَّارٍ، عَنْ شَدَّادٍ أَبِي عَمَّارٍ، عَنْ أَبِي أُمَامَةَ الْبَاهِلِيِّ، قَالَ جَاءَ رَجُلٌ إِلَى النَّبِيِّ صلى الله عليه وسلم فَقَالَ أَرَأَيْتَ رَجُلاً غَزَا يَلْتَمِسُ الأَجْرَ وَالذِّكْرَ مَا لَهُ فَقَالَ رَسُولُ اللَّهِ صلى الله عليه وسلم " لاَ شَىْءَ لَهُ " . فَأَعَادَهَا ثَلاَثَ مَرَّاتٍ يَقُولُ لَهُ رَسُولُ اللَّهِ صلى الله عليه وسلم " لاَ شَىْءَ لَهُ " . ثُمَّ قَالَ " إِنَّ اللَّهَ لاَ يَقْبَلُ مِنَ الْعَمَلِ إِلاَّ مَا كَانَ لَهُ خَالِصًا وَابْتُغِيَ بِهِ وَجْهُهُ " .
also referenced under: Hadith 3140 (Reference) & Volume 4, Book 25, Hadith 3142 (DarusSalam)