I know the ahnaaf say that to face the Qiblah or to turn one’s back to the Qiblah, while in open or closed space is haram due to the hadeeth of Abu Ayyub al-Ansaaree (radiyallaahu `anhu) where the Prophet :SAAWS: said, “When you go to relieve yourselves or urinate, then do not face the Qiblah nor turn your back to it. Instead turn (your direction) to the east or the west.” which is in Bukhari and Muslim.
But what do you guys say about the hadeeth narrated by `Abdullaah ibn `Umar (radiyAllaahu `anhu) that Marwan al-Asfar said: “I saw ibn `Umar make his camel kneel down facing the Qiblah, then he sat down urinating in its direction. So I said: Abu Abdur Rahman, has this not been forbidden? He replied: ‘Why not, that was forbidden only in open country; but when there is something between you and the Qiblah that conceals you, then there is no harm.'” (Abu Dawood
In one of my classes, my teacher said that the ahnaaf say to this hadeeth that thre will always be a barrier between one and the Ka`abah.
What is the response from Abu Hanifah (rahimahullaah) etc… to this hadeeth?
This is not the answer of Imaam Abu Hanifah (rahimahullaah) but rather the answer of one of the weak servants of the ahnaaf. It is the Usool of the ahnaaf that the ahaadeeth of Rasulullaah :SAAWS: is given preference to the aathaar of the Sahaabah. Also if there are any ahadeeth that outwardly contradict each other and we find one to be qowly (a verbal command) and the other fi3li (personal action) than we give precedence to the qowly hadeeth. Under this topic both usool are used. Your first quote is a hadeeth of Rasulullaah :SAAWS: and the second is an action of a Sahaabi :radhiyallahuanh:. You will also find ahaadeeth narrated by Sayyidina ibni Umar :radhiyallahuanh: that he had seen Rasulullaah :SAAWS: doing as he had done but that again is a fi3li hadeeth opposing a qowli hadeeth. Therefore, we do not give precedence to the qowl of Sayyidina Umar :radhiyallahuanh:. This is but a brief answer to your question. The details can be found in Sharh ma3aanil aathaar of Imaam Tahaawi (rahimahullaah).
And Allah knows best.