I think my boyfriend has erectile dysfunction.
Ouch! What happened? Has he not been able to have sex with you because of it?
He just can't maintain an erection and it's making our sex life terrible. I'm so annoyed at him.
Don't judge him for a health condition, that's something he can't change on his own and is completely unfair of you.  Talk to him about it and see if there is anything you two can do together to solve it. There's plenty of other avenues of help and sexual activities you can do to please each other.
Its been 3 weeks, but it hasn't gotten better, he needs to get rid of it.
It's not easy to "get rid" of it. Is he taking drugs or steroids or something that might have caused this? It's a big deal, but luckily you can always have him take a Viagra, though I'd say that's only a short-term solution.