Narrated Abdullah bin Omar: People say, “Whenever you sit for answering the call of nature, you should not face the Qiblah or Bait-ul-Muqaddis.” I told them, ‘Once I went up the roof of our house and I saw Allah’s Messenger, peace be upon him, answering the call of nature while sitting on two bricks facing Bait-ul-Muqaddis, but there was a screen covering him.
[1: 147- O.B. Sahih Al-Bukhari)

[Added: The present day toilets have walls to serve as screen. Care is warranted in the open areas.]