Marwan al-Asfar said: I saw Ibn Umar (may Allah be pleased with them both) make his mount kneel facing the qiblah, then he sat down and urinated. I said: O Abu Abd al-Rahman! Has this not been forbidden? He said: Certainly! It has been forbidden in open space, but when there is something between you and the qiblah that screens you (that is, there is some barrier), then there is no harm in it.
Hadith Referenceالسنن الكبرى للبيهقي / كتاب الطهارة / 438