Abu Dawud Book 1, Hadith Number 90.
Chapter : Can a man offer prayer while he is feeling the call of nature.
Narated By Thawban : The Messenger of Allah (PBUH) said: Three things one is not allowed to do: supplicating Allah specifically for himself and ignoring others while leading people in prayer; if he did so, he deceived them; looking inside a house before taking permission: if he did so, it is as if he entered the house, saying prayer while one is feeling the call of nature until one eases oneself.