It is narrated from Sayyiduna Ibn Umar (may Allah be pleased with them both) that a man passed by the Prophet (peace and blessings be upon him) while he was urinating. The man greeted the Prophet (peace and blessings be upon him) with salam, but the Prophet (peace and blessings be upon him) did not reply to his greeting.
Hadith Referenceصحيح ابن خزيمه / جماع أبواب الآداب المحتاج إليها في إتيان الغائط والبول إلى الفراغ منها / 73
Hadith Takhrij«صحيح مسلم: كتاب الحيض: باب التيمم ، رقم: 370 ، وسنن ترمذي: 90 ، و سنن ابن ماجه: 352 ، و سنن نسائي: 37 ، و سنن ابي داوٗد: 16 ، و ابن شبيبه فى مصنفه: 435/8»