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). (IT)
English reference (IT): Vol. 1, Book 1, Hadith 617 (IT)
Arabic reference (IT): Book 1, Hadith 660 (IT)