Hi,
Welcome to the ehealthforum and I am really glad to help you out.
This wetting of bed is called adult urinary incontinence. It can be due to overtaking the fluids at night, urge incontinence, inappropriate bladder contractions. constipation, infection ,a stone in the bladder or use of diuretics.
To confirm the diagnosis get it checked from a urologist.
Regarding the erection problem, Common causes causing erection problem are stress and anxiety, poor communication, unrealistic sexual expectations, negative feelings about non performance, smoking, alcohol and medical conditions like diabetes, high blood pressure, heart or thyroid conditions, poor circulation, low testosterone, depression, spinal cord and neurological causes. Medications such as blood pressure medications (especially beta-blockers), heart medications (such as digoxin), some peptic ulcer medications, sleeping pills, and antidepressants may also cause erectile dysfunction.
It is only after examination can a diagnosis be drawn. So get an examination done from a urologist.
It is very difficult to precisely confirm a diagnosis without examination and investigations and the answer is based on the medical information provided. For exact diagnosis, you are requested to consult your doctor. I sincerely hope that helps. Take care.