The parts about the timescale are both fine. However, the present continuous of "to have" sounds unnatural here to indicate the future.
I have an exam in two weeks/in two weeks' time.
The present continuous is possible with different verbs:
I'm sitting an exam in two weeks.
I'm taking an exam in two weeks.