Sayyiduna Abdullah bin Amr (may Allah be pleased with him) narrates: The Prophet (peace and blessings be upon him) would pray in the pens of sheep and goats, and he would not pray in the pens of camels or cattle.
Ahmad, and Tabarani in al-Mu'jam al-Kabir, recorded something similar, except that he did not mention cattle. Its chain contains Ibn Lahi'ah, about whom there is criticism.
Hadith Referenceمجمع الزوائد ومنبع الفوائد / كتاب الصلاة / 2053