أَخْبَرَنَا عِيسَى بْنُ هِلاَلٍ الْحِمْصِيُّ، قَالَ حَدَّثَنَا مُحَمَّدُ بْنُ حِمْيَرٍ، قَالَ حَدَّثَنَا مُعَاوِيَةُ بْنُ سَلاَّمٍ، عَنْ عِكْرِمَةَ بْنِ عَمَّارٍ، عَنْ شَدَّادٍ أَبِي عَمَّارٍ، عَنْ أَبِي أُمَامَةَ الْبَاهِلِيِّ، قَالَ جَاءَ رَجُلٌ إِلَى النَّبِيِّ صلى الله عليه وسلم فَقَالَ أَرَأَيْتَ رَجُلاً غَزَا يَلْتَمِسُ الأَجْرَ وَالذِّكْرَ مَا لَهُ فَقَالَ رَسُولُ اللَّهِ صلى الله عليه وسلم ‏"‏ لاَ شَىْءَ لَهُ ‏"‏ ‏.‏ فَأَعَادَهَا ثَلاَثَ مَرَّاتٍ يَقُولُ لَهُ رَسُولُ اللَّهِ صلى الله عليه وسلم ‏"‏ لاَ شَىْءَ لَهُ ‏"‏ ‏.‏ ثُمَّ قَالَ ‏"‏ إِنَّ اللَّهَ لاَ يَقْبَلُ مِنَ الْعَمَلِ إِلاَّ مَا كَانَ لَهُ خَالِصًا وَابْتُغِيَ بِهِ وَجْهُهُ ‏"‏ ‏.‏

It was narrated that Abu 'Umamah Al-Bahili said: "A man came to the Prophet (PBUH) and said: 'What do you think of a man who fights seeking reward and fame - what will he have?' The Messenger of Allah (PBUH) said: 'He will not have anything.' He repeated it three times, and the Prophet (PBUH) 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.'" Translation Not Available

Book Ref: Sunan An Nisai Book 25 Hadith 3140
Web Ref:  Sunan An Nisai Vol 1 Book 25 Hadith 3142