Asking Professor for Letter of Recommendation before finishing class
Yes, it's fine.  You could visit office hours a couple of times, to get to know him better, to make up for the missing second half of the semester.