US President Barack Obama was heckled as he urged both sides in the abortion debate to find common ground.