How is it necessary to speak correctly?

Я должен быть сейчас на учебе, но я не пошел.

is it correctly or not? if not, when i must using that construction.

I am to be at lesson now, but i haven't gone to.