Sunan Abi Dawud 4680
Grading supplied with this record: Sahih (Al-Albani)
Narration text is preserved in its supplied Arabic and English. Translated interfaces and reading guides do not add narration translations in other languages.
حَدَّثَنَا مُحَمَّدُ بْنُ سُلَيْمَانَ الأَنْبَارِيُّ، وَعُثْمَانُ بْنُ أَبِي شَيْبَةَ، - الْمَعْنَى - قَالاَ حَدَّثَنَا وَكِيعٌ، عَنْ سُفْيَانَ، عَنْ سِمَاكٍ، عَنْ عِكْرِمَةَ، عَنِ ابْنِ عَبَّاسٍ، قَالَ لَمَّا تَوَجَّهَ النَّبِيُّ صلى الله عليه وسلم إِلَى الْكَعْبَةِ قَالُوا يَا رَسُولَ اللَّهِ فَكَيْفَ الَّذِينَ مَاتُوا وَهُمْ يُصَلُّونَ إِلَى بَيْتِ الْمَقْدِسِ فَأَنْزَلَ اللَّهُ تَعَالَى { وَمَا كَانَ اللَّهُ لِيُضِيعَ إِيمَانَكُمْ } .
Ibn "Abbas said:
when the Prophet (ﷺ) turned towards the Ka'bah (in prayer), the people asked : Messenger of Allah (ﷺ)! what will happen with those who died while they prayed with their faces towards Jerusalem ? Allah the Exalted, then revealed : "And never would Allah make your faith of no effect."
Full reference and source
Sunan Abi Dawud 4680 In-book : Book 42, Hadith 85 English translation : Book 41, Hadith 4663
View source on Sunnah.com (opens in a new tab)