All perfect praise be to Allah, The Lord of the Worlds. I testify that there is none worthy of worship except Allah, and that Muhammad is His slave and Messenger.
The fact that most of the Hadeeth collections were compiled after the death of these four Imams (Abu Haneefah, Maalik, Ash-Shaafi‘i, and Ahmad) does not mean that they did not have knowledge of the Ahaadeeth. These Ahaadeeth were narrated and passed on from predecessors to successors either verbally or in written form but were not (yet) compiled in big volumes of Hadeeth collections. Moreover, the three Imams Maalik, Ash-Shaafi’i and Ahmad were well-versed Hadeeth scholars and narrators as well. Maalik compiled the well-known Hadeeth collection Al-Muwatta’, Ash-Shaafi‘i complied a brief Musnad, and Ahmad compiled the famous book of Hadeeth Al-Musnad Al-Kabeer. Abu Haneefah was also a Hadeeth narrator and scholar. He was one of the prominent scholars of Hadeeth during his lifetime and in his country and narrated on the authority of great reporters such as Sufyaan Ath-Thawri, Al-A‘mash, and others. These four Imams based their schools of Fiqh on the evidence that reached them, whether from the text of the Quran; the Ahaadeeth narrated on the authority of the Prophet, sallallaahu ‘alayhi wa sallam; or the reports narrated on the authority of the Companions . They were, undoubtedly, more knowledgeable of such evidence than the scholars who came after them. Following one of these four schools of Fiqh is permissible according to the Ijmaa’ (consensus of opinion) of the Ummah, and there is nothing wrong with that at all provided that immoderation and fanaticism are avoided. Our advice to you is that you should learn the school of Fiqh widely adopted in your country and follow it without fanaticism and immoderation. This means that whenever it is proven that a given opinion of your school of Fiqh is contrary to the authentic Sunnah, then you have to adhere to the Sunnah, for none other than the Prophet, sallallaahu ‘alayhi wa sallam, is infallible.
Allah Knows best.