It is narrated from Ibn Sammah (may Allah be pleased with him) who says: I passed by the Prophet ﷺ while he was urinating. I greeted him with salam, but he did not reply to me until he stood by a wall and scratched it with a stick that he had with him. Then he struck his hand on the wall, wiped his face and hands, and then replied to my salam.
Hadith Referenceمسند الإمام الشافعي / كتاب الطهارة / 38
Hadith Takhrijأخرجه البخاري: التیمم، باب التيمم في الحضر إذا لم يجد الماء وخاف فوت الصلاة: (337).