It was narrated from Abu Umamah that:
The Messenger of Allah forbade a man to perform prayer when he was suppressing (the urge to urinate or defecate). (ES)
English reference (ES): Vol. 1, Book 1, Hadith 617 (ES)
Arabic reference (ES): Book 1, Hadith 660 (ES)