Mishkat al-Masabih 733
Abu Huraira reported God’s Messenger as saying:
When you see anyone buying or selling in a mosque, say, “May God not make your trading profitable!” And when you see anyone calling out in it about something lost, say, “May God not restore it to you.” 

Tirmidhi and Darimi transmitted it.
وَعَنْ أَبِي هُرَيْرَةَ رَضِيَ اللَّهُ عَنْهُ قَالَ: قَالَ رَسُولُ اللَّهِ صَلَّى اللَّهُ عَلَيْهِ وَسَلَّمَ: 
" إِذَا رَأَيْتُمْ مَنْ يَبِيعُ أَوْ يَبْتَاعُ فِي الْمَسْجِدِ فَقُولُوا: لَا أَرْبَحَ اللَّهُ تِجَارَتَكَ. وَإِذَا رَأَيْتُمْ مَنْ يَنْشُدُ فِيهِ ضَالَّةً فَقُولُوا: لَا رَدَّ اللَّهُ عَلَيْكَ ". رَوَاهُ التِّرْمِذِيُّ وَالدَّارِمِيُّ