Let him know if he wont go to the bathroom it will back up and he will eventually throw it up. That is what the doctor told my son when he was afraid to go because it hurt. They suggested miralax and the chocolate bar laxative. Both are over the counter at any drug store. It took about 2 days for it to work he was so stopped up but it cleared him out.
I think the OTC recommendations are good for this time. If he knows what it's like to have an enema, it sounds like maybe constipation happens somewhat often for him. That makes me wonder if he's taking in enough water and fiber. Your pediatrician can advise you best about how to keep his digestive system functioning well.